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 Monday, October 23, 2017
Contents
  • 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

    Copying Gems
    The first order of business of course, is to make sure that your new server has all the gems installed which were setup on your old server. If you don't do this, you'll end up with error messages such as the following:
    => Booting Mongrel (use 'script/server webrick' to force WEBrick)
    => Rails application starting on http://0.0.0.0:3000
    => Call with -d to detach
    => Ctrl-C to shutdown server
    ** Starting Mongrel listening at 0.0.0.0:3000
    ** Starting Rails with development environment...
    Exiting
    /opt/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/servers/mongrel.rb:15: warning: already initialized constant OPTIONS
    /opt/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/servers/mongrel.rb:19: undefined method `options' for []:Array (NoMethodError)
            from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:32:in `gem_original_require'
            from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:32:in `require'
            from /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in `require'
            from /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in `new_constants_in'
            from /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in `require'
            from /opt/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/server.rb:39
            from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
            from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in `require'
            from /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in `require'
            from /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in `new_constants_in'
            from /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in `require'
            from script/server:3
    
    Unfortunately, this error message is a bit mysterious and usually doesn't indicate which modules need to be installed. The best solution is to first note down the list of gems that were installed in your old server. You can do this by running the following command on your old server:
    gem list
    
    Note down the list of installed gems on your old server. Then go to your new server and add the necessary gems. Note that some gems may need some other third party programs (for instance, gbarcode requires imagemagick and libgd installed as well)

    Don't forget to update your installed gems to the latest version:
    gem update --include-dependencies
    



    <<Previous: Intro ^Up to Mayukh's World^ Next: Modiyfing the Environment >>

    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 (http://www.mayukhbose.com/) as well.