0

I have tried everything google has thrown at me to get my rails application running with nokogiri. I am running my app using ruby v2.2.7 and my ruby version is managed via rbenv.

I have followed every step here http://www.nokogiri.org/tutorials/installing_nokogiri.html

I have xcode installed. But keep receiving this error when I try to boot up my rails server:

dlopen(/Users/USER/dev/APP/vendor/bundler/ruby/2.2.0/extensions/x86_64-darwin-17/2.2.0-static/nokogiri-1.8.1/nokogiri/nokogiri.bundle, 9): Library not loaded: /Users/USER/.rvm/rubies/ruby-2.2.7/lib/libruby.2.2.0.dylib

dennismonsewicz
  • 25,132
  • 33
  • 116
  • 189

1 Answers1

0

It looks like you also have rvm still activated. Try uninstalling that (rvm implode) and then double-checking rbenv is initialized (which ruby should point to a version installed in the shimmed directory). After that try re-bundling in your rails project.

myconode
  • 2,518
  • 1
  • 26
  • 28
  • I started this system with `rvm`, then backed it out and uninstalled all things `rvm`. Not sure how its still floating around. RVM isn't in my path at all – dennismonsewicz Feb 19 '18 at 21:35
  • Hard to tell exactly what the root problem is from the error alone, but looks like your app dependencies are located in a different ruby version directory than 2.2.7. A few suggestions would be to check if you have the ruby version specified in your rails app's `.ruby-version` file installed via rbenv, remove the `vendor` directory in your app and rebundle, and/or removing the `.rvm` directory in your user dir. – myconode Feb 19 '18 at 21:55
  • Yeah, I figured it would be a long shot. Kind of a weird issue. But I do have the correct version of ruby install (2.2.7), I have no `.rvm` directory and have removed the `vendor/bundle` directory numerous times. – dennismonsewicz Feb 19 '18 at 22:00
  • Ended up figuring out my problem. There was some odd gem caching going on. I removed all references to my gem cache files and rebundled everything, again, and it all started working properly – dennismonsewicz Feb 20 '18 at 13:50
  • What were your exact steps? Just curious – myconode Feb 20 '18 at 15:22
  • Removing `vendor/bundler` then running `rm -rf ~/.bundle/ ~/.gem/bundler/ ~/.gems/cache/bundler/` and then making sure nokogiri bundles with system libs and then running `bundle install` – dennismonsewicz Feb 20 '18 at 15:38