The World of Mayukh Bose

<< Back to Main Page Mayukh's world: e-mail me | about
Mayukh's World: Migrating Your Rails Program to a New Server Saturday, February 16, 2019
  • Background
  • Copying Gems
  • Modifying the Environment
  • Modifying the Code
  • My Free Software
  • Delphi/C++ Builder
  • Pocket PC
  • FreeSpeech Chat
  • C/C++ Freebies
  • Perl
  • Python
  • Ruby
  • My Ruby Code
  • Filtering with auto_complete
  • Migrating Rails
  • Ruby Tutorials and Software e-mail me

    Migrating your Rails programs to a new server

    Editing the Environment
    Ok, so now you've copied your project code over from your old server to your new server. Chances are that the version of rails that you have on the new server is different from your old server. In that case, you may need to make a few changes to your project. The first change is to edit environment.rb
    # Specifies gem version of Rails to use when vendor/rails is not present
    RAILS_GEM_VERSION = '2.0.2' unless defined? RAILS_GEM_VERSION
    Adjust the version of rails to match the version you have.

    Then continue down the file and find the line that says: do |config|
    Below this, add the following lines in bold (needed if you're migrating from rails 1.x to rails 2.x) do |config|
      config.action_controller.session = { :session_key => "_myapp_session", 
                                           :secret => "this is a string that is at least 30 characters long" }

    The next step after this is to modify your code to handle rails 2.x

    <<Previous: Copying Gems ^Up to Mayukh's World^ Next: Modiyfing the Code >>

    Copyright © 2004 Mayukh Bose. All rights reserved.
    This work may be freely reproduced provided this copyright notice is preserved.
    OPTIONAL: Please consider linking to this website ( as well.