Different version of RoR on server

The best plan would be to get the server updated if possible.


Another options is to put rails 2.3.2 into the app structure itself:

On the development machine

rake rails:freeze:gems

This puts unpacks the gems which comprise rails ( activerecord,
activesupport, actionpack etc) under the vendor/rails

Assuming that deployment is via a repository (svn, git...) commit the
application making sure that vendor/rails is placed under version

Then it doesn't matter what the current 'official' rails version is on
the server, it will use the same version you use in development.

This is a bonus both ways, you can use a later version than the one
installed as gems on the server, and you are isolated if the 'it guys'
update the rails gems without telling you, something which can easily
break your app.

Rick Denatale wrote:

Freezing unpacks the gems into vendor/rails. Unfreezing is a simple as
blowing away that directory (there's probably a rake task that does
that too)


Rick Denatale wrote:
> rake rails:freeze:gems

A possibly stupid question, but why do I get a .gem directory in my home
directory when I do freeze? Well I get the idea, but why not keep the
.gem in the app root or somewhere? What happens with my other apps
running, they will use the .gem too, right?

.gem isn't used for frozen stuff. It's something gem does in some
cases when ran as a user that can't write to the system wide gem


Yep, one of my peeves with gem is that it does this. I always want
gems to be installed in the system location, if I forget to sudo gem I
don't want it to be installed in my home directory.

I finally removed all permisions from my ~/.gem directory so if I
forget, it let's me know rather than giving me a useless install.

  chmod 000 ~/.gem