Sunday, February 19, 2012

Setting up RubyEE and Rails 2 Development Environment on Ubuntu 10.04

I decided to add this post as a supplement to my earlier post on setting up Ubuntu 11.10 for Rails 3 Development.

I recently had a need to set up a Rails 2 environment that used Ruby EE, and although I had documented that process elsewhere, I decided to share on my blog as well, in hopes it could help others.



Using Ubuntu 10.04 (LTS)

Make sure your install is fully patched:

$ sudo apt-get update && sudo apt-get upgrade

Getting everything installed and in place:


Do a quick install of git and curl so we can install RVM:

$ sudo apt-get install git-core curl

Install RVM:

$ bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)

Now, setup RVM function sorucing to your .bashrc

$ echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bashrc

And...reload your .bashrc (or just reopen your terminal):

$ . .bashrc


Next add this additional repository:

$ sudo apt-add-repository ppa:ubuntu-on-rails && sudo apt-get update

Install a few packages:

$ sudo apt-get install libruby1.8 zlib1g-dev libssl-dev libreadline-dev build-essential ruby irb rdoc rake ruby gems rubygems1.8 ruby1.8-dev mysql-common mysql-client  mysql-server mysql-admin libfreeimage3 memcached libopenssl-ruby libmysqlclient15-dev libimage-science-ruby libimage-science-ruby-doc libmagickcore-dev libxml2-dev libxslt-dev libsasl2-dev zip libopenssl-ruby rdoc

Install Ruby. I found that I had to install 1.8.7 before I could install REE.

$ rvm install 1.8.7

$ rvm use 1.8.7

$ rvm install ree-1.8.7

$ rvm use ree-1.8.7

$ rvm install rubygems latest

Set up MySQL:

$ mysql -u root -p

mysql> create database <database_name>;

mysql> create database <database_name_development>;

mysql> GRANT ALL ON *.* TO '<username>'@'localhost' IDENTIFIED BY '<username>';


Install Gems:

$ gem install bundler;

$ bundle