Installing Ruby & Rails on Ubuntu 8.04 Hardy Heron
*** I wrote a script that does this. Get it at here. Just make sure you unzip the file and set the permission to execute. ***
This is what I did to get Ruby and Rails working on my new Ubuntu 8.04 LTS. It appears that nothing really changed from previous version. The basic step is to install the Ruby using apt-get and installing the Gem from the source. I learned my lesson NOT to install Ruby from the source on Ubuntu. Just remember that if any gem installation fails, just get the required library using apt-get and get the ‘dev’ version as well. This is the rule of thumb I’ve been following and has worked out well for me.
Step 1: Install Ruby from apt-get.
~$ sudo apt-get install ruby irb ri rdoc ruby1.8-dev libzlib-ruby libyaml-ruby libreadline-ruby libncurses-ruby libcurses-ruby libruby libruby-extras libfcgi-ruby1.8 build-essential libopenssl-ruby libdbm-ruby libdbi-ruby libdbd-sqlite3-ruby sqlite3 libsqlite3-dev libsqlite3-ruby libxml-ruby libxml2-dev
Step 2: Download and install RubyGems
Just download and extract the latest Gem and run following command.
~$ sudo ruby setup.rb
After successful installation, run this to create the link in /usr/bin
~$ sudo ln -s /usr/bin/gem1.8 /usr/bin/gem
Step 3: Install Rails and Gems
~$ sudo gem install rails
~$ sudo gem install sqlite3-ruby mongrel capistrano
Since I don’t use MySQL anymore, it’s really optional. It’s basically same as before, just make sure you are using following command to get everything you need for MySQL.
~$ sudo apt-get install mysql-server mysql-client libdbd-mysql-ruby libmysqlclient15-dev
** UPDATE **
- “libmysqlclient-dev” is now “libmysqlclient15-dev” => I found this out while installing my new server, but it appears that maurizio de magnis already posted the solution in the comments. Thanks!
- “buildessential” is no longer required when installing Ubuntu Server.
Comments
24 Responses to “Installing Ruby & Rails on Ubuntu 8.04 Hardy Heron”


Thx dude. Great info!
[...] on Linux for the first time (yes, I’m a Windows user - and a C# developer for $$$): rubyhead Posted by f.pighi Filed in ruby on rails Tagged: ruby on rails, [...]
Nice info. Thanks. Exactly what I needed.
Info is really helpful.
I am a PHP developer and starting with ROR. I was wandering how to install ROR and your post is really helpful and easy to follow. I installed ROR without any problem.
Thanks !!
Just curious, why do you prefer SQLite over MySQL? Thank you very much for your concise and accurate documentation.
Hi … great work .. all works up to ..
~$ sudo apt-get install mysql-server mysql-client libdbd-mysql-ruby libmysqlclient-dev
it come an error messages by libmysqlclient-dev
@Jim Wyatt - I prefer SQLite for development ever since I actually started trusting db migration. Besides, I like the fact that it’s a file that I can wipe out… Just as a reminder, it’s just for development only!
@louis - take a look at your apt source list. You’re probably getting the error message because you need to activate other sources.
Been using ROR on Windows… switching to Ubuntu… great tutorial… unfortunately when I type ‘ruby scripts/generate ….’ I get an error. Is there a path variable I’m missing or something?
@RB - It should be ruby script/generate, not scripts/generate. If you’re using Ubuntu, you don’t need to type ruby.
Okay… I created a “rails” directory under my $HOME directory. Then typed the following: script/generate controller Site index about help
then pre-pended with ruby. Both give an error. With “ruby” pre-pended I get: ruby: No such file or directory — script/generate (LoadError)
without ruby I get: bash: script/generate: No such file or directory
When you say you created a “rails” directory, I’m assuming it’s “rails application_name” and running the command under application_name directory. Right?
Hold head in shame
Thanx. Newbie error. assumed it was Ubuntu… Old dog, new tricks.
Hi, this tutorial has been very useful but I encountered a problem with the last step:
~$ sudo apt-get install mysql-server mysql-client libdbd-mysql-ruby libmysqlclient-dev
the problem is that the package “libmysqlclient-dev” is not recognized correctly on my ubuntu 8.04 here’s the log (in italian):
“Lettura della lista dei pacchetti in corso… Fatto
Generazione dell’albero delle dipendenze in corso
Lettura delle informazioni di stato… Fatto
Il pacchetto libmysqlclient-dev è un pacchetto virtuale fornito da:
libmysqlclient15-dev 5.0.51a-3ubuntu5.1
Bisogna esplicitamente sceglierne uno da installare.
E: Il pacchetto libmysqlclient-dev non ha candidati da installare”
I think the solution is, as proposed by apt-get, to rename the package “libmysqlclient-dev” in “libmysqlclient15-dev”.
hf :)
I had to do a “sudo gem install net-ssh” before “sudo gem install Capistrano” to get this to work on Hardy Heron 8.04
gc
[...] تنصيب روبي و ريلز على أوبنتوا 8.04 بصراحة هذه المقالة مترجمة و الرابط الرئيسي لها هو : تنصيب روبي و ريلز على اوبنتو 8.04 [...]
[...] RubyHead Hur installationen av Ruby On Rails “bör” göras på Ubuntu 8.04 (Hardy Heron) [...]
[...] RubyHead.com [...]
[...] RubyHead.com [...]
[...] forward way I know to install a Ruby & Rails working environment. I have to give mention to RubyHead and Enrailed for pointing me in the right direction, and this guide is based on their [...]
hey… i’m trying to install ruby on rails on ubuntu 8.04 following your notes…
it’s all going down good except for trying to install rails via gem ( sudo gem install rails ). i get the following error messages and it seems that rails is not really installed as i cannot create anything afterwards:
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require’: no such file to load — zlib (LoadError)
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require’
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/package.rb:10
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require’
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require’
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/format.rb:9
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require’
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require’
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/installer.rb:11
… 11 levels…
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:104:in `process_args’
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:75:in `run’
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:39:in `run’
from /usr/local/bin/gem:24
could someone please tell me what i’m doing wrong? it’s really getting annoying :(
ruby and gem seem to be there and return a valid version number.
oh and this is what i get when trying to create a simple and dumb hello-application with rails (rails creates the application, but i get problems creating the controller):
./script/../config/../vendor/rails/railties/lib/initializer.rb:159:in `require_frameworks’: no such file to load — openssl (RuntimeError)
from ./script/../config/../vendor/rails/railties/lib/initializer.rb:88:in `process’
from ./script/../config/../vendor/rails/railties/lib/initializer.rb:49:in `send’
from ./script/../config/../vendor/rails/railties/lib/initializer.rb:49:in `run’
from /media/Data/Programming/ruby/rubydev/hello/config/environment.rb:13
from /media/Data/Programming/ruby/rubydev/hello/vendor/rails/railties/lib/commands/generate.rb:1:in `require’
from /media/Data/Programming/ruby/rubydev/hello/vendor/rails/railties/lib/commands/generate.rb:1
from script/generate:3:in `require’
from script/generate:3
i don’t really get the error messages… openssl should be installed all along with ruby in the first place… am I missing out on something? sorry for being a complete n00b :(
Dave,
Did anything go wrong during the installation? See if you can re-install. It would also help to provide how you’re getting these errors. In other words, I would like to see what commands you’re typing and where.
ehm, well, by creating the controller for the program i meant using a command like “ruby script/generate controller App” in the folder of the newly created application (hello, or whatever).
the creation of the application itself does not lead to error messages, but trying to generate the controller “App” for it afterwards does (that’s the second post by me).
there have not been installation problems as far as i know (up till the moment i tried to get rails through gem <– first post by me), but right now i’ve installed, uninstalled and reinstalled all that stuff several times, i guess i must have messed up something :(
i’ve used the synaptics package manager to uninstall all the ruby stuff and after that started free from scratch. but still i get the problems with rails. :(
maybe i’ll try this tutorial (https://help.ubuntu.com/community/RubyOnRails)now, as it provides the 3rd or 4th different approach of installing ruby on rails on ubuntu 8.04. this is a crazy world…
maybe you have another solution?
hahaha, lol…
i managed to get it all installed now. i just was too dumb ;)
had like 20 versions of ruby on ubuntu…. rofl… geez…