Installing Ruby 1.8.6 on Ubuntu Feisty Fawn (7.04)
Ubuntu seems to be the big distro these days. (Remember all of those other “it” distros? Slackware? The original Red Hat? Mandrake? I am vaguely tired of the trendiness of distros.)
Anyway, there is no package yet for Ruby 1.8.6 on Ubuntu Feisty Fawn (7.04), which is unfortunate, since mongrel_cluster doesn’t work properly under Ruby 1.8.5.
The install steps I got at Urban Puddle (here) were nice, but Rails still wasn’t happy: I kept getting that awful `require’: no such file to load – rubygems (LoadError) error.
Here’s what I did to fix it. YMMV.
Building Ruby (from Urban Puddle):
tar xjvf ruby-1.8.6.tar.bz2 cd ruby-1.8.6 apt-get build-dep ruby1.8 ./configure --prefix=/usr make sudo make install
Next, to fix it:
cd /usr/src/rubygems/rubygems-0.9.4 sudo ruby setup.rb
Et voilà :
max@somehost:~ $ irb irb(main):001:0> require 'rubygems' => true
I’m not quite sure why the Ruby source doesn’t ship with the rubygems source. Is it because rubygems is still a < 1.0 release?
Capistrano and its gotchas
I did my first successful Capistrano deployment last night. The rubyonrails manual is pretty nice, though it is a bit out of date, and uses rake migrations, which are now deprecated in Capistrano. What really was a tremendous help for me was Coda Hale’s article *Time For A Grown-Up Server: Rails, Mongrel, Apache, Capistrano and You*, which not only convinced me of the superiority of a Mongrel cluster proxied via Apache’s mod\_proxy\_balancer to anything using FastCGI, but which also provided a fantastically useful walkthrough.
I was flummoxed for a bit by my failed deployment, when it turned out that all I had wrong was that the :repository variable in config/deploy.rb was set to something slightly wrong, so the remote Subversion client was unable to check out the code. And I even thought that I saw the activity appearing correctly in the Subversion server’s Apache logs. Once that was fixed, “cap cold_deploy” worked like a charm. The error was a bit inscrutable (to me) for a while. See the dumb syntax error? My “prj” abbreviation for “project” was what killed me. (That’s not the real project name; I have anonymized the thingy.)
my-host:~/project max$ cap cold_deploy
* executing task cold_deploy
* executing task update
** transaction: start
* executing task update_code
* querying latest revision…
svn: REPORT request failed on ‘/repos/!svn/bc/40/prj/trunk’
svn: ‘/repos/!svn/bc/40/prj/trunk’ path not found
*** [update_code] transaction: rollback
* [update_code] rolling back
* executing “rm -rf /u/apps/project/releases/20070601032656″
servers: [”www.project.com”]
Password:
[www.project.com] executing command
command finished
/usr/local/lib/ruby/gems/1.8/gems/capistrano-1.4.1/lib/capistrano/scm/subversion.rb:24:in `latest_revision’: Could not determine latest revision (RuntimeError)
from /usr/local/lib/ruby/gems/1.8/gems/capistrano-1.4.1/lib/capistrano/configuration.rb:62:in `initialize’
from /usr/local/lib/ruby/gems/1.8/gems/capistrano-1.4.1/lib/capistrano/configuration.rb:89:in `call’
from /usr/local/lib/ruby/gems/1.8/gems/capistrano-1.4.1/lib/capistrano/configuration.rb:89:in `[]’
from /usr/local/lib/ruby/gems/1.8/gems/capistrano-1.4.1/lib/capistrano/configuration.rb:236:in `method_missing’
from /usr/local/lib/ruby/gems/1.8/gems/capistrano-1.4.1/lib/capistrano/scm/subversion.rb:63:in `checkout’
from /usr/local/lib/ruby/gems/1.8/gems/capistrano-1.4.1/lib/capistrano/recipes/standard.rb:80:in `load’
from /usr/local/lib/ruby/gems/1.8/gems/capistrano-1.4.1/lib/capistrano/actor.rb:159:in `instance_eval’
from /usr/local/lib/ruby/gems/1.8/gems/capistrano-1.4.1/lib/capistrano/actor.rb:159:in `update_code’
… 13 levels…
from /usr/local/lib/ruby/gems/1.8/gems/capistrano-1.4.1/lib/capistrano/cli.rb:12:in `execute!’
from /usr/local/lib/ruby/gems/1.8/gems/capistrano-1.4.1/bin/cap:11
from /usr/local/bin/cap:16:in `load’
from /usr/local/bin/cap:16
Look out: Capistrano 2 is *just* about to come out, and migrating from 1.4 -> 2.0 will be somewhat involved.
I am profoundly disappointed that previous family commitments are going to keep me from attending this month’s Boston Ruby meeting, which includes a presentation by the delightfully acerbic Zed Shaw, the author of Mongrel.
