Rails 3.x uses bundler by default. The following will install rails 3.0.10 into the directory "rails30".

An example of using bundler with PHP Shell:

$ mkdir rails30
$ cd rails30
$ bundle init
$ editor Gemfile
$ cat Gemfile
source 'http://rubygems.org'
gem "rails","3.0.10"
gem 'mysql2', '~> 0.2.11'
$ bundle install --path vendor
Fetching source index for http://rubygems.org/
Installing rake (0.9.2)
Installing abstract (1.0.0)
Installing activesupport (3.0.10)
Installing builder (2.1.2)
Installing i18n (0.5.0)
Installing activemodel (3.0.10)
...
$ bundle exec rails -v
Rails 3.0.10
# the following is to overwrite Gemfile that was originally created
$ bundle exec rails new ../rails30 -d mysql < /bin/echo "Y"
...
$ cat Gemfile
source 'http://rubygems.org'

gem 'rails', '3.0.10'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'mysql2', '~> 0.2.11'
...

You'll need to create a symlink from your virtualhost root directory to your rails application.  The following is an example for the virtual host "test-vhostssl.hosting.cornell.edu" :

$ pwd
/infra/lamp/mounts/emc256/emc256test2/htdocs/test-vhostssl.hosting.cornell.edu
# find relative path to rails application
$ ls ../../rails
rails23/  rails30/  rails31/
# create symlink to "public" directory
$ ln -s ../../rails/rails23/public rails30
cd rails30
# create .htaccess file for passenger
$ editor .htaccess
$ cat .htaccess
RackBaseURI /rails30
PassengerAppRoot /infra/lamp/mounts/emc256/emc256test2/rails/rails30/
  • No labels