I have a Rails 3.0 app (technically 3.0.7) which I would like to upgrade to Rails 3.1 to make use of the new asset pipeline and other fancy new features. What is the best approach to doing this? Should I use the rails new generator, then copy everything from my old app over to the new one? What about version control? I already have my old app using Git.
I have a Rails 3.0 app (technically 3.0.7) which I would like to upgrade
Share
Just upgraded one of my apps from 3.0.9 to 3.1.0, here’s my approach, your mileage might vary:
Edit Gemfile, change Rails gem version
Also adds new gems introduced in 3.1.0
run
bundle update railsThen run
rake rails:updateand resolve conflicts.Move your css/javascript/images etc to
app/assetsfolder, make sure there’s anapplication.jsand anapplication.cssfile (you might want to take a look at those two from newly created 3.1.0 projects)Include css/javascript links in your layout file like this