Upgrading from Rails 3 to Rails 3.1 [closed] Upgrading from Rails 3 to Rails 3.1 [closed] ruby ruby

Upgrading from Rails 3 to Rails 3.1 [closed]


This is what worked for me when updating an existing rails 3.0.8 project. Your mileage may vary...

Update the rails version specified in my Gemfile to use the latest release candidate:

gem 'rails', '3.1.0.rc4’

Update the bundle:

bundle update

Then update the project with the rake command:

rake rails:update

After cherry picking though the change conflicts I ran all my tests and they passed (yay!). I restarted the server and everything seems good so far.

However, this is not using the new asset pipeline yet. By that I mean the javascript and css (or sass) files are still being handled in the pre-pipeline manner. As I understand it, this is a perfectly viable option. But of course, I want the new goodness, so I believe the next steps are to include and additional gems (e.g. coffeescript, sass, uglifier, etc) and then to migrate the old files to the app/assets directory.

I found some details about that are here:

http://blog.nodeta.com/2011/06/14/rails-3-1-asset-pipeline-in-the-real-world/

Hope that was helpful.


I just upgraded from 3.0 to 3.1 by changing my Gemfile to:

gem 'rails', '3.1.0.rc1'gem 'sqlite3'gem 'sass'gem 'coffee-script'gem 'uglifier'

I also commented out the following line below in config/environments/development.rb

# config.action_view.debug_rjs = true

Finally, make sure you enable the asset pipeline in config/application.rb

config.assets.enabled = true

I'm not sure if you've already read the release notes http://weblog.rubyonrails.org/2011/4/21/jquery-new-default