malone
malone

Reputation: 63

Ruby complaining about nokogiri libiconv.2.dylib

I've recently tried to write a small scraping script with Ruby and Capybara; however, when I compile code that requires Capybara, I get the following error:

/Library/Ruby/Gems/1.8/gems/nokogiri-1.5.5/lib/nokogiri/nokogiri.bundle:       dlopen(/Library/Ruby/Gems/1.8/gems/nokogiri-1.5.5/lib/nokogiri/nokogiri.bundle, 9): Library  not loaded: /opt/local/lib/libiconv.2.dylib (LoadError)
Referenced from: /Library/Ruby/Gems/1.8/gems/nokogiri-1.5.5/lib/nokogiri/nokogiri.bundle
Reason: Incompatible library version: nokogiri.bundle requires version 8.0.0 or later, but libiconv.2.dylib provides version 7.0.0 - /Library/Ruby/Gems/1.8/gems/nokogiri-1.5.5/lib/nokogiri/nokogiri.bundle
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `require'
from /Library/Ruby/Gems/1.8/gems/nokogiri-1.5.5/lib/nokogiri.rb:27
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `require'
from /Library/Ruby/Gems/1.8/gems/capybara-1.1.2/lib/capybara.rb:2
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:60:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:60:in `require'

I've uninstalled and reinstalled nokogiri several times. I've checked to make sure the only install of Ruby on my Mac is in //usr/bin. I've recently updated Xcode and uninstalled MacPorts at Homebrew's behest. What have I done wrong, if anything, and what's the fix?

Upvotes: 3

Views: 1471

Answers (1)

phoet
phoet

Reputation: 18845

there are several things broken on the mac that make it quite hard to work with the onboard ruby stuff.

i would suggest using RVM or RBENV to manage your ruby installation (RVENV is more lowlevel though). removing MacPorts is a good idea. homebrew has less problems integrating into OS X.

run brew doctor to see any possible errors.

Upvotes: 2

Related Questions