42

Just upgraded (i.e. not a new install) to Lion from Leopard and my previously well-working rmagick now doesn't work anymore and gives me this error:


Your Rack app raised an exception when Pow tried to run it.

LoadError: dlopen(/Users/rassom/.rvm/gems/ruby-1.8.7-p334/gems/rmagick-2.13.1/lib/RMagick2.bundle, 9): Library not loaded:
/System/Library/Frameworks/OpenCL.framework/Versions/A/Libraries/libclparser.dylib
Referenced from: /Users/rassom/.rvm/gems/ruby-1.8.7-p334/gems/rmagick-2.13.1/lib/RMagick2.bundle
Reason: image not found - /Users/rassom/.rvm/gems/ruby-1.8.7-p334/gems/rmagick-2.13.1/lib/RMagick2.bundle
~/.rvm/gems/ruby-1.8.7-p334/gems/rmagick-2.13.1/lib/RMagick2.bundle
~/.rvm/gems/ruby-1.8.7-p334/gems/rmagick-2.13.1/lib/rmagick.rb:11
~/.rvm/gems/ruby-1.8.7-p334/gems/bundler-1.0.15/lib/bundler/runtime.rb:68:in `require'
~/.rvm/gems/ruby-1.8.7-p334/gems/bundler-1.0.15/lib/bundler/runtime.rb:68:in `require'
~/.rvm/gems/ruby-1.8.7-p334/gems/bundler-1.0.15/lib/bundler/runtime.rb:66:in `each'

Tried uninstalling rmagick and re-installing, but that didn't help.

Does anybody have a solution?

Thanks :-)

rassom
  • 2,896
  • 5
  • 34
  • 45

6 Answers6

70

I had the same problem and resolved it by uninstalling ImageMagick, removing the rmagick gem and running bundle install again.

Make sure the rmagick gem is completely gone from your ~/.rvm/gems/ruby-1.8.7-p334/gems/ folder before re-installing and running bundle install and it should at least get you beyond that error.

Marcus
  • 2,021
  • 2
  • 21
  • 20
  • 5
    This worked for me. However, when I first tried to reinstall imagemagick via brew, it failed because I didn't have the latest version of xcode for lion. Just an FYI for those running into that problem, you can get xcode via the App Store. Also, even though the App Store will say that xcode is "installed" after it downloads, you actually have to go to Launch Pad to run the installer. A couple of silly little tidbits that wasted more time than I'd like to admit. – Adam Rubin Jul 20 '11 at 20:30
  • NICE!! Just updated to Lion and stumbled across this issue. The solution by @Marcus worked wonders. Only downside is it took an hour to install ImageMagick via MacPorts :/ oh well, all is good now. – raidfive Jul 21 '11 at 05:29
  • Thanks @Adam! reinstalling Xcode it works like a charm for me as well! – gicappa Jul 21 '11 at 16:33
  • The uninstall of ImageMagick will vary depending on how you installed it. I had to do the following: sudo port uninstall ImageMagick @6.6.5-0_0+q16 sudo port uninstall ImageMagick @6.5.7-0_0+q1 sudo brew uninstall ImageMagick – Austin Ginder Jul 29 '11 at 00:11
  • FYI - Xcode is no longer required on Lion for this stuff. Apple released a dev tools package: http://kennethreitz.com/xcode-gcc-and-homebrew.html – jmccartie Feb 17 '12 at 16:24
  • Just upgraded to Lion. I use macports and xcode. Uninstalled the rmagick gem. Uninstalled ImageMagick (sudo port uninstall ImageMagick), then uninstalled xcode 3 (ran uninstallers in /Developer). Installed xcode 4.3 from the app store (takes a long time). Reinstalled ImageMagick (using details I noted before, specifically with --disable-openmp). That failed. Did " sudo xcode-select -switch /Applications/Xcode.app/", then it worked. Ran bundle install. That failed b/c of missing c compiler. Did "cd /usr/bin; sudo ln -s llvm-gcc-4.2 gcc-4.2" then it worked. – pduey Mar 13 '12 at 12:53
  • @raidfive macports can take hours because it will try to install and compile every single library, despite the fact that it shall already be part of the system libraries. You should try HomeBrew as a better alternative. Here took just one minute – Gabriel Mazetto Sep 09 '12 at 19:42
  • Gabriel Mazetto - Yea I switched to homebrew a little over six months ago and haven't looked back. – raidfive Sep 10 '12 at 22:14
  • Worked on OS X Mavericks too, using homewbrew and up to date tools – guapolo Nov 07 '13 at 03:42
  • The same problem arises in Yosemite, however Marcus solution still works. Reinstall the gem and be happy... – Motine Oct 29 '14 at 06:37
14

I've found this: https://stackoverflow.com/questions/6674666/installing-imagemagick-leads-to-weird-error-involving-opencl

Copied /System/Library/Frameworks/OpenCL.framework/Versions/A/Libraries/libclparser.dylib from 10.6 computer into the same folder on 10.7.

The file, i've uploaded here: http://www.workdreamer.com/uploads/libclparser.dylib

Community
  • 1
  • 1
workdreamer
  • 2,836
  • 1
  • 35
  • 37
9

In my case, the error occurred after ImageMagick was upgraded via homebrew. Unlike @Marcus' answer, I did not have to uninstall ImageMagick. All it took was:

$ gem uninstall rmagick
$ bundle

Cheers

Giuseppe
  • 5,188
  • 4
  • 40
  • 37
4

On Mac OSX Lion (10.7) with imagemagick installaed through homebrew this one fixed my problem:

First of all remove the broken rmagick from your rvm installation path: ~/.rvm/gems/ruby-1.9.3-p194/gems/

Afterwards reinstall imagemagick through brew and then run bundle again:

brew uninstall imagemagick
brew install imagemagick
bundle
Fa11enAngel
  • 4,690
  • 2
  • 39
  • 38
2

Because I previously used 'bundle package' in my rails app, just uninstalling and reinstalling the gem didn't solve the problem, because a copy remained in vendor/. Removing the copy in vendor/ and running bundle install again fixed the problem.

Emil Tin
  • 21
  • 2
1

Here is my full checklist to upgrade ruby environment to Mountain Lion: http://tektastic.kig.re/2012/07/getting-rmagic-and-friends-to-work-on.html

[ -- fixed June 19, 2007 ]