Skip to content

Upgrading rails version

David Corking edited this page Aug 4, 2013 · 12 revisions

From Rails 3.1 to 3.2

You need to upgrade Ruby to version 1.9.3 to get the rake cucumber task to work. You need to do this anyway to match the ruby deployed by Heroku. rvm works, but you could also try rbenv which is recommended by the Rails team.

Rails 3.2 is now merged into tansaku/master . To upgrade your copy, git pull upstream master then run bundle install. You may also need to run bundle exec rake db:migrate and bundle exec rake db:categories if your database isn't up to date. See also Installation for the latest seeding commands.

What we changed

We ran bundle update after upgrading Rails in the Gemfile, which upgraded versions in Gemfile.lock. Then we checked Gemfile.lock into git. You can see our changes in pull request #80

Deprecation warnings while testing

Sam fixed these warnings in upstream/master, in commit ab993f

Travis logged these warnings in Build 275

DEPRECATION WARNING: Calling set_table_name is deprecated. Please 
use `self.table_name = 'the_name'`    instead. (called from <class:CategoryOrganization> at 
/home/travis/build/tansaku/LocalSupport/app/models/category_organization.rb:2)

app/models/category_organization.rb

RSpec stub! is deprecated - use stub

RSpec mock is deprecated - use double

twitter-bootstrap

We made small changes to the font-awesome code in app/assets/stylesheets/bootstrap_and_overrides.css.less to suit the upgrade from version 2.2.6 to 2.2.7 of the twitter-bootstrap-rails gem.

Cucumber / Minitest crash

Weird crash in minitest when running cucumber in Travis. See line 903 of Build275. We fixed it by upgrading the Ruby version in .travis.yml from 1.9.2 to 1.9.3.

vendor/plugins deprecation warnings while deploying to Heroku

vendor/plugins is deprecated in Rails 3.2, and does not work in Rails 4.

LocalSupport doesn't use vendor plugins but Heroku does, in Rails 3.

When we upgraded to Rails 4.0, Heroku dealt automatically with the deprecations

From 3.2 to 4.0

Run bundle install after checking out a Rails 4.0 version of LocalSupport.

You may also need to run bundle exec rake db:migrate and bundle exec rake db:categories if your database isn't up to date.

Development branch mtc2013:rails40

As we did when upgrading to 3.2, we ran bundle update after upgrading Rails in the Gemfile, which upgraded versions in Gemfile.lock. We then checked Gemfile.lock into git.

Gmaps blank on first display

Sometimes, the Google Map does not render on first visit to the home page. Some errors show in the browser javascript console. How can we make this failure repeatable?

[7:59:38 PM] Michael: maybe theres a javascript error [8:02:53 PM] Michael: Uncaught ReferenceError: Gmaps is not defined [8:03:00 PM] Michael: Uncaught Error: Sprockets::FileNotFound: couldn't find file 'twitter/bootstrap' (in /app/app/assets/javascripts/application.js:9)

There is some progress on Issue 357 above, including these links to possible workarounds:

Until we make time to test the workarounds, or see a fix, we are treating this as a blocker.

(Read background info on Turbolinks in a Rails Guide.)

HTTP verb constraint

Mass assignment protection

protected_attributes gem or strong parameters protection model? (gem not supported after 4.0)

Weird minitest crash returns

We haven't seen it in LocalSupport yet, but according to several threads elsewhere on github, the weird minitest crash is back again in Rails 4. It seems to be a cucumber-rails issue, and is not a blocker as it can probably be worked around. Nevertheless, this pull request is under review at cucumber-rails: