After an OS upgrade I needed to reinstall all the gems for my Rails project (well, I probably didn’t need to do it, but it seemed the quickest way).
Since I used RVM and only had one Ruby on Rails project I was working on, doing so is easy, though not intuitive.
To uninstall all the gems:
$ rvm gemset empty
Then install them the regular way:
$ bundle install
You might get an error that looks like this: “There was an error in your Gemfile, and Bundler cannot continue.”. If that’s the case, run:
$ gem install bundler
If your Ruby on Rails unit tests complain about not being able to find a table after you’ve added a new model, it just means you forgot to prepare the test database with the latest data. The error looks like this:
ActiveRecord::StatementInvalid: Could not find table ‘yourtablenamehere’
To fix, just run:
and then re-run your test.