Upgrading from Rails 3 to Rails 3.1

How to update rails 3.0.3 to 3.1?

This question has a lot of useful information which might help you out: Upgrading from Rails 3 to Rails 3.1

It doesn't answer specifically for Windows, but there's a lot of advice and insight that you'll find useful for the upgrade.

The only advice I can offer on top of reading the answers in the above question is to have a bit of patience and not expect it to work straight away. There's a lot of changes in the way 3.1 works so expect to spend some time fixing it up.

Good luck!

Upgrade from Rails 3.0 to 3.1 and then to 3.2 - but keep 3.0 working

You should definitively use git branches. A possible good git workflow would be this one:

  • Let's assume that your Master branch is currently on Rails 3.0.x and it's in production.
  • From this master branch, you create 2 branches: rails_30, rails_31.
  • You start working in the rails_31 branch with all the necessary changes needed for upgrading to Rails 3.1.x (This screencast from Ryan Bates will help you a lot: http://railscasts.com/episodes/282-upgrading-to-rails-3-1 )
  • When you are done migrating to Rails 3.1.x (hint: all your tests passing) you can create a new rails_32 branch from this one. Then you can continue to upgrade to Rails 3.2.x (check out this other railscast: http://railscasts.com/episodes/318-upgrading-to-rails-3-2 )
  • When you need to introduce changes to your current Rails 3.0.x code base, you will work on the rails_30 branch. If a change is good to go and tested, you can push it to master. Once this is pushed you can either try to merge or cherry pick code this branch to your rails_31 or rails_32 branch (whichever you are working with at this point in time)

Remember that upgrading Rails apps it's not always a trivial task, so take you time & plan accordingly. If you get stucked; a gem is not supported, you logic fails in a newer version of Rails (believe it will most probably happen) Just remember that the Ruby on Rails community is huge, many developers have passed through this before and have share their knowledge in stackoverflow and other sites/blogs. Just keep pushing play.

Good Luck.

Upgrade from rails 3.1.3 to rails 3.2.1. Error with assets

Apparently some gem dependency is broken and bundle exec rails server should resolve this. This should be run without sudo ... unless you usually work with your app with root privileges (which is not good). Check the files/folders permissions in your rails root, which might have been broken by misusing sudo commands earlier. While in development you hardly need any root privileges.

Other than that, similar issues have also appeared before and the answer was to update your entire gemset, primarily sprockets and rails. Your configuration files look okay to me and I can't reproduce the error.

If that does not help, I would create a new rails app, check the assets pipeline working there with the same gemset that you have and manually cross-check all config files.

There are various debugging tools for routing too, but try the above first.

Error while upgrading from Rails 3.1 to Rails 3.2

The error is happening inside ActiveSupport::BufferedLogger#add method call and you appear to be monkey-patching this class. The internals of ActiveSupport::BufferedLogger have likely changing between the versions of Rails you're using.

Try removing all of the ActiveSupport::BufferedLogger code from your environment.rb to work past this error and get your app running. Then, if you still need the monkeypatch (don't know why), you'd have to rewrite it on top of the newer version of the class.

Upgrading from Rails 3.0.9 to Rails 3.1 errors from CanCan

Just upgrade to latest version of mysql2 gem. In my case it is 0.3.7 now.

wrong number of arguments (3 for 1) after upgrading rails from 3.1.1 to 3.1.3

Run bundle show and check version of omniauth gem. May be while upgrading rails you updated omniauth as well.

Version 1.* of omniauth requires separate gem omniauth-twitter for twitter authentication. As you don't have it in your Gemfile it tries to load as middleware Twitter class from twitter gem that would cause similar error.

To avoid issues like that in the future consider using "~> 0.2.6" for gems versioning instead of ">= 0.2.6". It protects you from unexpected major releases of gems you're using.



Related Topics



Leave a reply



Submit