Just installed Ubuntu 9.04 (released Apr 23, 2009) on my work laptop. Here are all the things I needed to do to get a Rails environment working. One additional complication is that I use Heroku to deploy.
Install non-default Ubuntu packages
- mysql-client & mysql-server
- ruby
- git, svn, cvs, & integration with git (git-svn, git-cvs)
- sun-jdk 6 (for eclipse)
- lynx, wget, curl
Install RubyGems
Once the base ruby package is installed, all the rest of the ruby/rails stuff is installed via sudo and tar.gz download. In this case,
- download the latest Ruby Gems tarball from http://rubygems.org/
- untar
- cd into the directory
- run: ruby setup.rb
- make a symbolic link to gem1.8: cd /usr/bin; sudo ln -s gem1.8 gem
Install Rails
Install Heroku
If this error results, then install ruby1.8-dev
- sudo apt-get install ruby1.8-dev
Running Heroku
Running heroku for the first time will probably get an error because libopenssl_ruby isn't installed
- sudo apt-get install libopenssl-ruby
Creating a MySQL database via rake
Invoking "rake db:create" in the new Rails app directory will probably get this error:
"sudo gem install mysql" will cause another set of errors. That's because libmysqlclient5-dev is not installed. I tried installing it on the command line via "sudo apt-get install libmysqlclient5-dev" but that didn't work. However, the Synaptic Package Manager did the right thing.
Lastly, if the mongrel gem is not installed, then running rails will fire up WebBrick.
- sudo gem install sqlite3-ruby
causes this error:
The fix is to install libsqlite3-dev
- sudo apt-get install libsqlite3-dev
and that should allow sqlite3-ruby to install properly.
Labels: heroku, rails, ruby, ubuntu