Passenger and locally installed Rails gems

It’s not uncommon that you need to install multiple Rails applications on the same host. They all might use different versions of Rails, and you need to install all of them in order to keep your applications running. One of solutions is to install multiple Rails gem versions globally in the system. However, if you don’t have root access to the server, you are forced to install gems in your ~/.gems directory. This works perfectly well with mongrel, but it fails with Passenger.

Passenger can’t find Rails installed locally in user’s home directory. The only workaround I have found is to freeze rails gems.

Say you have Rails installed in: /home/hubert/.gems and your application sits in: /home/hubert/app

All you need to do is:

$ cd /home/hubert/app
$ rake rails:freeze:gems
$ touch tmp/restart.txt

Voila!

Posted by Hubert Łępicki Mon, 23 Mar 2009 20:26:00 GMT


Rails 2.3 - best release ever?

I have been using Ruby on Rails since the 1.1 release, and there have been more and less successful releases since. Rails 1.2 was amazing and brought us REST - most of us never looked back. However, the 1.2 series was still very buggy and was breaking backward compatibility several times between minor releases.

I wasn’t too much excited about Rails 2.0, particularly because it wasn’t backward-compatible and most of plugins had to wait for several months to be rewritten to work with 2.0. However, since then, Rails is evolving quite nicely and version 2.3 seems to be best you could ever get in Ruby web applications development. And here is why:

  • nested model mass-assignment significantly simplifies building complicated forms. At the time of writing, it’s still a bit buggy when it comes to validation (in RC1), but that is about to change before final release.

  • http digest authentication which is great news for everyone who build web services and need a bit more security in place.

  • metal, using which we can finally bypass routing monster and save some milliseconds for “mission-critical” requests.

  • overall performance boost, as pointed out by one of my friends. I didn’t see any benchmarks yet but overall feeling, especially with environment startup and running rake tasks is astonishing.

Now, let’s just wait for 3.0 revolution to come…

Posted by Hubert Łępicki Sun, 15 Mar 2009 21:25:00 GMT