{"id":3417,"date":"2009-03-16T00:00:00","date_gmt":"2009-03-15T22:00:00","guid":{"rendered":"http:\/\/www.theill.com\/blog\/2009\/03\/16\/upgrading-rails-engines-project-to-rails-2-3-2\/"},"modified":"2019-04-14T20:40:59","modified_gmt":"2019-04-14T18:40:59","slug":"upgrading-rails-engines-project-to-rails-2-3-2","status":"publish","type":"post","link":"https:\/\/www.theill.com\/blog\/2009\/03\/16\/upgrading-rails-engines-project-to-rails-2-3-2\/","title":{"rendered":"Upgrading Rails Engines Project to Rails 2.3.2"},"content":{"rendered":"
My lifestyleapps<\/a> project (still in very early beta) was running Rails 2.2.2 with the Rails Engines plugin ten minutes ago. Today, Rails 2.3.2 was released so I decided to try if I could easily upgrade it and avoid using the Rails Engines plugin anymore. It was beautiful simple and took me less than ten minutes.<\/p>\n First, I had to update our Apache Passenger module with a version supporting Rails 2.3 so I did a<\/p>\n and then run the install to build our apache module<\/p>\n In my config\/environment.rb I changed<\/p>\n to<\/p>\n and asked Rails to update my various script files by issuing<\/p>\n Finally I remembered the application.rb should be named application_controller.rb now so I issued an explicit task for this as well<\/p>\n In the Rails Engines plugin you need to have the \u201croutes.rb\u201d file in the root of your plugin but with Rails 2.3.2 you should have it in the \u2018config\u2019 folder under your plugin and its content should be wrapped in \u201cActionController::Routing::Routes.draw do |map|\u201d as the root routes.rb. So I changed this from<\/p>\n to<\/p>\n The contents of this routes.rb was changed from<\/p>\n to<\/p>\n Finally I had to update the root \u201croutes.rb\u201d to avoid using the \u201cfrom_plugin\u201d call e.g. I simply removed lines such as<\/p>\n Now I don\u2019t need the Rails Engines plugin anymore so I removed it with<\/p>\n That\u2019s it .. I was now able to run my tests and start up my project and have it run on Rails 2.3.2.<\/p>\n Enjoy!<\/p>\n","protected":false},"excerpt":{"rendered":" My lifestyleapps project (still in very early beta) was running Rails 2.2.2 with the Rails Engines plugin ten minutes ago. Today, Rails 2.3.2 was released so I decided to try if I could easily upgrade it and avoid using the Rails Engines plugin anymore. It was beautiful simple and took me less than ten minutes. … Continue reading Upgrading Rails Engines Project to Rails 2.3.2<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"amp_status":"","spay_email":"","jetpack_publicize_message":""},"categories":[98],"tags":[101,99],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"yoast_head":"\n$ gem update passenger\n<\/code><\/pre>\n
$ passenger-install-apache2-module\n<\/code><\/pre>\n
RAILS_GEM_VERSION = '2.2.2' unless defined? RAILS_GEM_VERSION\n<\/code><\/pre>\n
RAILS_GEM_VERSION = '2.3.2' unless defined? RAILS_GEM_VERSION\n<\/code><\/pre>\n
$ rake rails:update\n<\/code><\/pre>\n
$ rake rails:update:application_controller\n<\/code><\/pre>\n
\/vendor\/plugins\/life_intake\/routes.rb\n<\/code><\/pre>\n
\/vendor\/plugins\/life_intake\/config\/routes.rb\n<\/code><\/pre>\n
map.resources :foods\n<\/code><\/pre>\n
ActionController::Routing::Routes.draw do |map|\n map.resources :foods\nend\n<\/code><\/pre>\n
map.from_plugin :life_intake\n<\/code><\/pre>\n
$ .\/script\/plugin remove engines\n<\/code><\/pre>\n