Alright if I get anything done today I think this will be it. I worked on this for a while last night and couldn’t really nail it down. I guess it was the fact I was trying to get ahead of the game. First off this posting is just to talk about Rails 3.0 Beta on Ubuntu 10.04. After searching the web and really coming up with nothing but a couple of errors posted to developer forums. I found Mohammad Kotb’s blog on installing Ruby on Rails (current release) on Ubuntu 10.04.
One of the main issues with Ubuntu with Rails running on top is Ubuntu isn’t one to package up and install cutting edge software without you making some machine mods. There maybe a better way of doing this by adding a repository to your repository list but I didn’t take that route. Instead Mohammad went for a clean Rails build compiled on his system and I followed his steps with these modifications.
First off install the following packages.
sudo apt-get install build-essential libssl-dev libreadline5-dev zlib1g-dev
move to /usr/local/src to download source code and compile it in this folder
cd /usr/local/src
Then pull down the RC2 code from this site (this is where Mohammad and I split up the installation).
sudo wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-rc2.tar.gz
sudo tar xzf ruby-1.9.2-rc2.tar.gz
cd ruby-1.9.2-rc2
Mohammad suggested checking your gcc version and if it was at 4.4 “errors will occur” this isn’t the case with the 1.9.2 version of Ruby you are install. It seems to work fine on my build (and I have done it twice now). So move on to the make process.
sudo ./configure –prefix=/usr/local/ruby-1.9.2
sudo make
sudo make install
After these steps you have finally installed Ruby 1.9.2, to check its version
/usr/local/ruby-1.9.2/bin/ruby -v
output like that: ruby 1.9.2dev (2010-07-11 revision 28618) [x86_64-linux]
Now just follow his information on creating your links.
sudo ln -s /usr/local/ruby-1.9.1/bin/ruby /usr/local/bin
sudo ln -s /usr/local/ruby-1.9.1/bin/rake /usr/local/bin
sudo ln -s /usr/local/ruby-1.9.1/bin/gem /usr/local/bin
sudo ln -s /usr/local/ruby-1.9.1/bin/irb /usr/local/bin
sudo ln -s /usr/local/ruby-1.9.1/bin/ri /usr/local/bin
sudo ln -s /usr/local/ruby-1.9.1/bin/rdoc /usr/local/bin
Now instead of installing Rails 2.X I went for the newest version by following the instructions from Riding Rails.
Just run these two commands…
gem install tzinfo builder memcache-client rack rack-test rack-mount erubis mail text-format thor bundler i18n
gem install rails –pre
And now you should have Rails 3 Beta install on your Ubuntu 10.04 server. Warning this code is pretty new and is going to change pretty fluidly.
Mohammad also talks about installing the database but anyone running Ubuntu and Rails for any time should know this and I am moving away from MySQL if I can so I will stay off of the topic.
UPDATE!!!!
OK so after I posted this I screwed up one pretty important piece. I forgot to mention that Ubuntu will not know where your rails installation is and after using GEMS to install it you will need to set up a link to rails. I found the tip off of this Ubuntu Forum posted by knetcozd.
locate rails |grep bin
for me its here:
/usr/local/ruby-1.9.2/bin/rails
then just add the link
sudo ln -s /usr/local/ruby-1.9.2/bin/rails /usr/bin/rails
Now you should see your rails version as 3.0.0.beta4 if you run a rails –version.
The compile doesn’t work for me. Apart from numerous warnings this seems to be the fatal error:
Search tclConfig.sh and tkConfig.sh…………………
Fail to find [tclConfig.sh, tkConfig.sh]
Use X11 libraries.
Can’t find proper Tcl/Tk libraries. So, can’t make tcltklib.so which is required by Ruby/Tk.
Richard I haven’t had to do this install in months. I will have to run trough it again and update my blog.