Installing Ruby & Rails on Ubuntu 8.04 Hardy Heron
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
19 Responses to “Installing Ruby & Rails on Ubuntu 8.04 Hardy Heron”
Leave a Reply
You must be logged in to post a comment.
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 [...]