So ruby-debug is still broken for 2.0, but someone came up with a package called byebug. Check it out.
Reason: Incompatible library version: libMagickCore.5.dylib requires version 16.0.0 or later, but libfreetype.6.dylib provides version 15.0.0
$ brew uninstall freetype $ brew install freetype $ brew link -f freetype
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.
I’ve never had this issue before, but I recently started using rvm and for whatever reason got the following error when trying to do rake db:migrate
uninitialized constant Rake::DSL
After googling around and trying a bunch of convoluted solutions (many which addressed a broken 0.9.0 build of rake), I found that adding the following line to my Rakefile fixed everything:
EdgeCase has published a great walkthrough of the various Ruby language features. They call it Ruby Koans. The Ruby Koans are a a collection of broken tests. Each broken test is designed to teach you something about the Ruby language. Many are fill-in-the-blank, eg:
def test_every_object_has_different_id obj = Object.new another_obj = Object.new assert_equal __, obj.object_id != another_obj.object_id end
To pass this koan/test, you’d replace the “__” with true, because new instances of objects have new object_ids.
I wouldn’t recommend this for people new to programming, but if you’re like me and used Ruby a few years ago but have fallen out of practice, it’s a perfect re-introduction. If you’re new to Ruby but have a solid background in other languages, this may be of use as well.