From Zero to Rails: Clean Maverick Meerkat install to working Rails app – Part 1

I haven’t done it yet – let’s see how this goes. Writing/researching while watching Mythbusters.

I’ve never known Ubuntu and Ruby to play nicely out of the box. Especially not when you’re trying to get rails involved. Ubuntu’s repositories are known to rubyists not to be safe, sudo isn’t a good idea to use with gem, and the maze of dependency confusion between mysql, postgresql, sqlite3, apache2, rails2/3, and ruby1.8.6/7 and 1.9.1/2 is a novice’s (read: my) nightmare.. What I’ve read again and again is that I should use a tool called RVM to install ruby; so let’s try that.

It looks like (from various blogs and such) the way to install RVM is by running

sudo apt-get install curl git-core
bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )

then adding

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

to your .bashrc — right at the end is cool. It’s important to now note that you should check whether or not your .bashrc has a ‘return’ floating around anywhere. Very likely that it does. If you find one, follow the instructions in the ‘Troubleshooting’ section here. I’m expecting to have to do this. After you’ve checked (and maybe fixed) that hiccup, reloading your .bashrc and install the ruby stuff:

source ~/.bashrc
sudo apt-get install libruby1.8 zlib1g-dev libssl-dev libreadline5-dev build-essential
rvm install ruby-1.9.2
rvm install ruby-1.8.7
rvm use ruby-1.9.2 --default

lastly, we need to get rails going, so let’s do: (note that I’m not using sudo)

sudo apt-get install sqlite3 libsqlite3-dev
gem install sqlite3-ruby
gem install rails
gem install mongrel

Heh. I’ve got all the steps written out — now let’s try it and see how things go. Culminating steps will be:

rails new example
cd example/
bundle install
rake db:create
rails s

And check out localhost:3000 to see how she reports.

Okay! So, that’s a skeletal plan; next up is actually doing it. That will come in post 2, which I’ve just written!

Leave a Reply

Your email address will not be published.