您的位置:首页 > 运维架构 > Linux

CentOS安装python、Ruby

2014-12-26 16:59 369 查看
CentOs版本查看命令:
lsb_release -a

查看系统位数:
getconf LOGN_BIT

CentOS的软件源未包含有最新的nodejs, 需要手动编译安装。首先安装依赖的库与工具yum install libtool automake autoconf gcc-c++ openssl-devel

然后下载nodejs的源码包tar, 解压缩后直接三板斧编译安装./configure --prefix=/usr
make
make install

最后用 node -v和 npm -v 查看安装的版本
到这里其实还没完, 还需要安装 node-gyp 之类的包npm install -g node-gyp

npm的另一种安装方式是wget http://npmjs.org/install.sh
chmod +x ./install.sh
./install.sh

./configure: No such file or directory

一般情况下,多看看目录下的readme和INSTALL文件,里面会告诉你怎么安装软件。这里我目前知道可能有两种情况:1、目录下没有configure,但有configure.am或configure.in时,需要用autoconf命令来生成configure。代码如下:$cd (软件名)-(版本号)
$autoconf2、此软件或库安装方式不是按以下套路来安装,$cd (软件名)-(版本号)
$./configure
$make
$sudo make install就需要认真阅读文件夹下的相关文件readme等等,按里面写的方式来安装!

Yeoman and Grunt Server Nodej Error

November 13, 2014 Leave a comment
POssible solution for error 
testapp>grunt server
Loading "imagemin.js" tasks...ERROR
>> Error: Cannot find module 'imagemin-gifsicle'

npm -g install npm@2.0.0

OR

npm -g install npm@1.4.28
.4.28

Clear the cache
npm cache clear


Some of the above fix worked for some users but i found installing msysgit fixed
the error that i was having when running the grunt server
[/code]

grunt serve
Loading "imagemin.js" tasks...ERROR
>> Error: Cannot find module 'imagemin-pngquant'

Running "serve" task

Running "clean:server" (clean) task

Running "wiredep:app" (wiredep) task
Warning: ENOENT, no such file or directory 'C:\a\b\c\yup\app\bower.json' Use --force to continue.

Aborted due to warnings.
down vote acceptedI had the same problem try commenting the line 166 in your
Gruntfile.js
:
I did it and it should look like this :
// Automatically inject Bower components into the app
wiredep: {
  options: {
    //cwd: '<%= yeoman.app %>'
  },
Then run again your server with :
grunt serve
如果还不管用,则还需要运行如下的命令:

npm install grunt-contrib-imagemin --save-dev

http://cloudfoundry-doc.csdn.net/frameworks/ruby/installing-ruby.html http://yeoman.io/learning/deployment.html
在使用yeoman工具链时需要安装一下如下环境:Node.js、Ruby、Compass。

首先来安装Node.js,由于Node在安装时需要依赖于python,且版本不能过低,所以需要先升级python的版本。

1、由于系统自带的python版本较低,可以通过
python -V 查看,所以需要升级,升级步骤如下:

下载/安装python
yum install -y bzip2* #nodejs 0.8.5需要,请安装python前,先安装此模块。

wget http://www.python.org/ftp/python/2.7.3/Python-2.7.9.tgz tar zvxf Python-2.7.9.tgz
cd Python-2.7.9
./configure
make && make install
/usr/local/bin/python2.7 -V #查看Python版本
建立软连接,使系统默认的python指向python2.7
正常情况下即使python2.7安装成功后,系统默认指向的python仍然是2.4.3版本,考虑到yum是基于python2.4.3才能正常工作,不敢轻易卸载。

mv /usr/bin/python /usr/bin/python.bak
ln -s //usr/local/bin/python2.6 /usr/bin/python
python -V #检验python指向是否成功
解决系统python软链接指向python2.6版本后,yum不能正常工作
$vi /usr/bin/yum
将文本编辑显示的#/usr/bin/python修改为#/usr/bin/python2.4,保存修改即可。

2、安装Ruby

要在centos 中安装ruby,直接使用 sudo yum install ruby 即可。
3、安装Compass
To install Compass on CentOS 6.4 run the following commands:
sudo yum install ruby
sudo yum install rubygems
sudo gem update --system
sudo gem install compass


你曾经试过在CentOS 5.5上面运行 yum install ruby 命令吗?如果你使用的是默认的应用库配置,你会发现你安装的是老版本的Ruby 1.8.5。如果你还没有准备好升级到Ruby 1.9,而是准备安装Ruby 1.8.7,请往下看! [c-sharp] view plaincopyyum install -y gcc zlib zlib-devel
wget ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.7-p334.tar.gz
tar xvf ruby-1.8.7-p334.tar.gz
cd ruby-1.8.7-p334
./configure --enable-pthread
make
make install

VMware下的CentOS与Windows7共享目录:建立挂载命令如下:mount -t cifs //192.168.81.12/share share -o username="Administrator",password="你的密码"
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: