STEP1 . ADD sudo user

… ####STEP2. Set domain … ####准备工作 sudo apt-get install build-essential libssl-dev libyaml-dev libreadline-dev openssl curl git-core zlib1g-dev bison libxml2-dev libxslt1-dev libcurl4-openssl-dev libsqlite3-dev sqlite3 ### I . install ruby 2.1.7 mkdir ~/ruby
cd ~/ruby
wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.7.tar.gz
tar -xzf ruby-2.1.7.tar.gz
cd ruby-2.1.7
./configure
sudo make sudo make install
ruby -v 测试一下 #### install passenger sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 561F9B9CAC40B2F7 sudo nano /etc/apt/sources.list.d/passenger.list 插入一行:

deb https://oss-binaries.phusionpassenger.com/apt/passenger trusty main

继续,增加一点权限

sudo chown root: /etc/apt/sources.list.d/passenger.list sudo chmod 600 /etc/apt/sources.list.d/passenger.list

sudo apt-get update

sudo apt-get install libapache2-mod-passenger

检查一下:
sudo a2enmod passenger

sudo service apache2 restart

sudo rm /usr/bin/ruby sudo ln -s /usr/local/bin/ruby /usr/bin/ruby

参考网址: https://www.digitalocean.com/community/tutorials/how-to-deploy-a-rails-app-with-passenger-and-apache-on-ubuntu-14-04