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

    Modifying the Code
    If you've been developing on rails 1.x and are now moving to a rails 2.x server, you'll probably notice that your code doesn't work the same anymore. Here's a common list of changes you might need to make:

    1. Replace all instances of model in your code with require_dependency
    Old:
       model :cart
       model :order_detail
    New:
       require_dependency 'cart'
       require_dependency 'order_detail'
    


    2. Remove instances of include Reloadable from your code. They are not needed

    3. start_form_tag and end_form_tag are no longer used. Replace with:
       <% form_tag do %>
          <% end %>
    


    4. text_field_with_auto_complete is no longer standard with rails. This has been moved into a plugin that you can install with:
    
        script/plugin install auto_complete
    
    


    5. ActiveRecord::count() syntax has been modified:
    Old:
        model.count("column = '23'")
        model2.count(['column = ?', 23])
    
    New:
        model.count( :conditions => ['column = ?', 23])
        model2.count( :conditions => ['column = ?', 23])
    


    Here's a larger list of deprecated items



    <<Previous: Modifying the Environment ^Up to Mayukh's World^

    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.