The procedure is as follows: 1. choose to use root for installation 2. install curl # Installcurl. itsneededtoinstallrvmtheeasyway. ignoretheerroraboutthejava. so: apt-getinstallcurl3. install rvm # Installrvm: (here bash is followed by a space, and then a space) bash (curl
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 RaiLs3:
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 andFile'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 haveFindThe version of Passenger that you just installed (WhichIs inDiffErent 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 (this error will be reported if Rails 3.1 is not installed. cocould not find a JavaScript runTime. See https ://GitHub.com/ssteenson/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!