参考:
https://rvm.beginrescueend.com/rvm/install/
http://ruby-china.org/wiki/install_ruby_guide
http://blog.ninjahideout.com/posts/a-guide-to-a-nginx-passenger-and-rvm-server
以前步骤我都是在root下进行
安装开发包
$ apt-get install wget vim build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libxml2-dev libxslt-dev autoconf automake libtool imagemagick libpcre3-dev
安装RVM
$ bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
RVM会安装到 /usr/local/rvm/ 下
vim .bashrc

#[ -z "$PS1" ] && return 
if [[ -n "$PS1" ]]; then
#add
. /usr/local/rvm/scripts/rvm

source .bashrc

$ rvm -v
rvm 1.9.2 by Wayne E. Seguin (wayneeseguin@gmail.com) [https://rvm.beginrescueend.com/]

用 RVM 安装 Ruby 环境
$ rvm pkg install readline
$ rvm install 1.9.3 --with-readline-dir=$rvm_path/usr
$ rvm 1.9.3 --default
$ ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
$ gem -v
1.8.10

安装 Rails
$ gem install rails
bundler好像默认就有了

安装 passenger
gem install passenger

安装 nginx
rvmsudo passenger-install-nginx-module
这个步骤需要一些required softwares,可以按照提示完成
测试nginx
$ nginx -v
nginx: nginx version: nginx/1.0.6
检查nginx.conf
http {
    # load passenger
    passenger_root /usr/local/rvm/gems/ruby-1.9.3-p0/gems/passenger-3.0.9;
    passenger_ruby /usr/local/rvm/wrappers/ruby-1.9.3-p0/ruby;  

启动 Nginx
$ nginx

 

Home Blog Delicious Github Flickr About Contact

© Miclle.Zheng . Powered by Forest Chalet