read

If your application is currently on any version of Rails 2.1.x,
Then following changes needs to be done for upgrading your application to Rails 2.3.11

1. First install Rails version 2.3.11

<div class='code-highlight'><pre class='code-highlight-pre'><div data-line='1' class='code-highlight-row numbered'><div class='code-highlight-line'>gem install rails -v2.3.11</div></div></pre></div>

2. Freeze app ruby gems

<div class='code-highlight'><pre class='code-highlight-pre'><div data-line='1' class='code-highlight-row numbered'><div class='code-highlight-line'>rake rails:freeze:gems</div></div></pre></div>

Hopefully it should work for you but it gave me following error
> undefined method `manage_gems’ for Gem:Module

3. Create sample rails 2.3.11 app

<div class='code-highlight'><pre class='code-highlight-pre'><div data-line='1' class='code-highlight-row numbered'><div class='code-highlight-line'>rails 2.3.11 testsapp</div></div></pre></div>

Now, Copy all missing “config/initializers/*” files from newly created “testapp” to the application that is to be upgraded.

<div class='code-highlight'><pre class='code-highlight-pre'><div data-line='1' class='code-highlight-row numbered'><div class='code-highlight-line'>cp testapp/config/initializers/* config/initializers</div></div></pre></div>

4. Change Rails version inside environment.rb to Rails 2.3.11

<div class='code-highlight'><pre class='code-highlight-pre'><div data-line='1' class='code-highlight-row numbered'><div class='code-highlight-line'># Specifies gem version of Rails to use when vendor/rails is not present </div></div><div data-line='2' class='code-highlight-row numbered'><div class='code-highlight-line'>RAILS_GEM_VERSION = '2.3.11'</div></div></pre></div>

5. Rename app/controllers/application.rb file to app/controllers/application_controller.rb

OR

<div class='code-highlight'><pre class='code-highlight-pre'><div data-line='1' class='code-highlight-row numbered'><div class='code-highlight-line'>rails:update:application_controller</div></div></pre></div>

6. Start rails server and fix the issues one by one

<div class='code-highlight'><pre class='code-highlight-pre'><div data-line='1' class='code-highlight-row numbered'><div class='code-highlight-line'>ruby script/server</div></div></pre></div>

Blog Logo

Sandip Ransing


Published

Image

Fun On Rails

Journal of a Web Developer #ruby #rails #JS

Back to Overview