How To Install Ruby On Rails On Ubuntu Hardy 8.04
Okay, Ubuntu Hardy is pretty old now but my Hardy server is still humming along just fine and I don't see a good reason to break it just to run a few Ruby On Rails apps. The ruby, ruby1.9 and rubygems packages on Hardy simply don't work anymore and the rails package is too old to run my app.
So here is how I got the latest rails running on this 4 year old server. I hope it saves you some pain.
1. Install JRuby 1.6.8. The Ubuntu ruby1.9 package just hangs silently when trying to install rubygems, but JRuby does the job.
# cd /opt # wget http://jruby.org.s3.amazonaws.com/downloads/1.6.8/jruby-bin-1.6.8.tar.gz # tar -zxf jruby-bin-1.6.8.tar.gz # export PATH=$PATH:/opt/jruby-1.6.8/bin
2. Install Rubygems 1.8.24
# wget http://production.cf.rubygems.org/rubygems/rubygems-1.8.24.zip # unzip rubygems-1.8.24.zip # cd /opt/rubygems-1.8.24 # jruby setup.rbHow To Install Ruby On Rails On Ubuntu Hardy 8.04
3. Patch rubygems. Out of the box, jgems produces the following error:
# jgem --help /opt/jruby-1.6.8/bin/jgem: line 13: syntax error near unexpected token `Gem::QuickLoader' /opt/jruby-1.6.8/bin/jgem: line 13: `if RUBY_VERSION =~ /^1\.9\.1/ && defined?(Gem::QuickLoader)'
You can fix it by changing the first line of /opt/jruby-1.6.8/bin/jgem to
4. Install rails and some extras.
# jgem install rails # jgem install jruby-openssl
5. Test it out!
# rails new /tmp/app # cd /tmp/app # rails server
Make sure your firewall has port 3000 open, and visit http://localhost:3000 .
Hope that works for you.
Roger Keays is an artist, an engineer, and a student of life. Since he left Australia in 2009, he has been living as a digital nomad in over 40 different countries around the world. Roger is addicted to surfing. His other interests are music, psychology, languages, and finding good food. Click here to subscribe to his weekly blog, or stalk him on Facebook and Twitter.