References:
Http://www.turnkeylinux.org/forum/support/20110826/how-upgrade-turnkey-rails-rails-301
Https://rvm.beginrescueend.com/rvm/install/
The procedure is as follows:
1. Select root for Installation
2. Install curl
# Install curl. It's needed to install rvm the easy way. Ignore the error about the java. So:
Apt-Get install curl
3. Install rvm
# Install rvm: (here Bash is followed by a space, and then <, another space)
Bash <(curl-s https://rvm.beginrescueend.com/install/rvm)
4. Install ruby1.9.2 in rvm
# Install 1.9.2 under rvm:
Rvm install ruby-1.9.2
5. Specify 1.9.2
# Make it the default:
Rvm use ruby-1.9.2 -- default
# Change to it (although the -- default line probably does this ):
Rvm use ruby-1.9.2-p (patchlevel)
6. Create a gemset
# Gemset for rails 3:
Rvm gemset create rails3
# Use That gemset:
Rvm gemset use rails3
# (Re-) install rails:
Gem install rails
(For the specific installation version 3.1.0, you will see some unable to covert and file 'lib 'not found, which can be ignored)
Rails-V shows the installed rails version.
7. Install passenger (ROR deployment technology)
# (Re-) install PASSENGER:
Gem install passenger
# Install the necessary prerequisite Library:
Apt-Get install libcurl4-openssl-dev
Compile and install the passenger module. First you have to find the version of passenger that you just installed (which is in a different place from the one preinstalled in the appliance ):
Find/usr/local/rvm-name passenger-install-apache2-module
Two paths will appear, one of them in BIN and the other one in gems. Take the shorter one and copy it. For my system, the two paths were:
/Usr/local/rvm/gems/ruby-1.9.2-p290 @ rails3/bin/passenger-install-apache2-module
And
/Usr/local/rvm/gems/ruby-1.9.2-p290 @ rails3/gems/Passenger-3.0.8/bin/passenger-install-apache2-module
Run that script:
/Usr/local/rvm/gems/ruby-1.9.2-p290 @ rails3/bin/passenger-install-apache2-module
Important: Grab the configuration lines at the end of the passenger install process! If you just use the default passenger loadmodule, passengerroot, and passengerruby lines the gem_home and paths won't be set up correctly, and you'll run into issues like "bundler: cannot Load file ". for my system, those lines were:
Loadmodule passenger_module/usr/local/rvm/gems/ruby-1.9.2-p290 @ rails3/gems/Passenger-3.0.9/EXT/apache2/mod_passenger.so
Passengerroot/usr/local/rvm/gems/ruby-1.9.2-p290 @ rails3/gems/Passenger-3.0.9
Passengerruby/usr/local/rvm/wrappers/ruby-1.9.2-p290 @ rails3/Ruby
In/etc/apache2/CONF. d/passenger, replace the three corresponding lines with the new stuff you copied.
8. Install node. js (not installing rails 3.1 will report this error cocould not find a javascript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (execjs: runtimeunavailable ))
Apt-Get install Python-software-Properties
Add-Apt-repository PPA: Chris-Lea/node. js
Apt-Get update
Apt-Get install nodejs
Set up your rails application in/var/www/railsapp, do a bundle install, restart Apache (/etc/init. d/apache2 restart), and you're golden!