2011-09-29

Running an old rails 2.3.8 with rvm

I was helping set up a local (legacy) rails 2.3.8 server on a macbook today, autonomous from the system ruby installation. This was a bit messy, as modern versions of rubygems conflict with the old rails 2.3.8 environment to the tune of:
Uninitialized constant ActiveSupport::Dependencies::Mutex (NameError)
...when you try to start the server. Here's the recipe I came up with:
  1. Install rvm.
  2. # Install ruby 1.8.7 and downgrade its rubygems to 1.5.3:
    rvm install 1.8.7 && \
      rvm use 1.8.7 && \
      rvm gem install -v 1.4.2 rubygems-update && \
      rvm gem update --system 1.4.2 && \
      update_rubygems && \
      echo 'Okay.'
  3. # Install all the gems you need, for instance:
    rvm gem install -v 2.3.8 rails && \
      rvm gem install -v 3.0 haml && \
      rvm gem install -v 2.1 authlogic && \
      rvm gem install -v 1.0 dalli && \
      rvm gem install -v 0.2 omniauth && \
      rvm gem install -v 2.7.0 erubis && \
      rvm gem install -v 1.3.3 sqlite3 && \
      echo 'Gems installed!'
  4. If needed, run rake db:setup in your rails tree to set up its databases.
  5. Done! rails/script/server -p your_port is ready for action.
blog comments powered by Disqus