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

An example of using bundler with PHP Shell:

$ mkdir rails31
$ cd rails31
$ bundle init
Writing new Gemfile to /infra/lamp/mounts/emc256/emc256test2/rails/rails31/Gemfile
$ editor Gemfile
$ cat Gemfile
source "http://rubygems.org"

gem "rails","3.1.0"
gem "mysql2"
$ bundle install --path vendor
Fetching source index for http://rubygems.org/
Installing rake (0.9.2)
Installing multi_json (1.0.3)
Installing activesupport (3.1.0)
...
$ bundle exec rails -v
Rails 3.1.0
$ bundle exec rails new ../rails31 -d mysql < /bin/echo "Y"
...
$ cat Gemfile
source 'http://rubygems.org'

gem 'rails', '3.1.0'

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

gem 'mysql2'
...
# pull in missing gems
$ bundle install --path vendor

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 rails31
cd rails31
# create .htaccess file for passenger
$ cat .htaccess
RackBaseURI /rails31
PassengerAppRoot /infra/lamp/mounts/emc256/emc256test2/rails/rails31/
  • No labels