Getting Rmagick to work again

Although we are running Lion on all our dev machines, we had an issue where a project using RMagick suddenly stopped working in dev mode, giving the error

Incompatible library version: RMagick2.bundle requires version 10.0.0 or later, but libltdl.7.dylib provides version 9.0.0

Managed to fix it following these steps:

Ran this in terminal:

gem uninstall rmagick
brew uninstall imagemagick
brew install –fresh imagemagick
gem install rmagick

After this, RMagick worked flawlessly again!