0

I get this error when attempting to use the rails generate commands:

gem install minitest
WARNING: Nokogiri was built against LibXML version 2.7.3, but has dynamically loaded 2.7.8

Could not open library 'libgtk-x11-2.0': dlopen(libgtk-x11-2.0, 13): image not found. 
Could not open library 'libgtk-x11-2.0.dylib': dlopen(libgtk-x11-2.0.dylib, 13): image not found.
Could not open library 'libgtk-x11-2.0.so.0': dlopen(libgtk-x11-2.0.so.0, 13): image not found.
Could not open library 'libgtk-x11-2.0.so.0.dylib': dlopen(libgtk-x11-2.0.so.0.dylib, 13): image not found.
Could not open library 'libgtk-x11-2.0.so': dlopen(libgtk-x11-2.0.so, 13): image not found.
Could not open library 'libgtk-x11-2.0.so.dylib': dlopen(libgtk-x11-2.0.so.dylib, 13): image not found.
Could not open library 'libgtk-3': dlopen(libgtk-3, 13): image not found.
Could not open library 'libgtk-3.dylib': dlopen(libgtk-3.dylib, 13): image not found.
Could not open library 'libgtk-3.so.0': dlopen(libgtk-3.so.0, 13): image not found.
Could not open library 'libgtk-3.so.0.dylib': dlopen(libgtk-3.so.0.dylib, 13): image not found.
Could not open library 'libgtk-3.so': dlopen(libgtk-3.so, 13): image not found.
Could not open library 'libgtk-3.so.dylib': dlopen(libgtk-3.so.dylib, 13): image not found
the Tin Man
  • 158,662
  • 42
  • 215
  • 303
Ethan
  • 1
  • 2
  • Search for that error on google and you'll find many references to the same or similar questions here on SO. Has the command worked previously on your machine? Have you made any changes to Ruby, Rails, Nokogiri, the OS lately? – the Tin Man Jun 07 '13 at 23:24
  • i have tried every google result. its on an OSX mountain lion, rails generate has always received this erorr. – Ethan Jun 08 '13 at 00:43
  • You need to say that when you create the question. Look at the information you gave in the question and imagine what you would want to know to help someone answer that question, then add that. We aren't able to see what you have tried or read the error messages and results so you have to tell us. The long error message you gave us tells us very little. – the Tin Man Jun 08 '13 at 01:26
  • Is this about the nokogiri error or the libgtk errors? Does the generate command work even with the notices? Does the Gemfile have libnotify or similar notification package that wants a Linux package? – davidfurber Jun 10 '13 at 13:11

2 Answers2

3

for RVM:

rvm gemset pristine

for non RVM:

gem pristine nokogiri
mpapis
  • 52,729
  • 14
  • 121
  • 158
  • `gem pristine nokogiri` should take care of the problem for any use of Nokogiri. – the Tin Man Jun 08 '13 at 18:24
  • 1
    indeed it solves the nokogiri issue, but if one library was out of date it most likely means that other libraries are updated too, it is safer to update all the gems, `rvm gemset pristine` is better from just `gem prisitine` (all the gems) because it will not break on the first failing gem (manually given compilation paths), it will iterate through all of the gems and return list of those that failed – mpapis Jun 08 '13 at 20:54
0

Nokogiri tends to complain when your current version of libxml is different from the one it compiled against. That doesn't always cause it to blow up, however. May even be a red herring. I would remove nokogiri from gemfile and see if the error persists. If so, then I'd start removing other stuff. Googling your error message suggests it has to do with a gem that uses libnotify.

Image Not Found Errors after Upgrade to Rails 3.1, how to fix? rake db:migrate error (Function 'inotify_init' not found)

Community
  • 1
  • 1
davidfurber
  • 5,274
  • 1
  • 20
  • 11