[Ruby] bundler の vendor path が変わっていて、LoadError になったという話

凡ミスの記録。

libxml2 が load できない。
まったく違う問題と早とちり。

% bundle exec ruby sample.rb
/Users/****/projects/test_anemone/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.1/lib/nokogiri.rb:28:in `require': dlopen(/Users/****/projects/test_anemone/vendor/bundle/ruby/2.1.0/extensions/x86_64-darwin-12/2.1.0-static/nokogiri-1.6.1/nokogiri/nokogiri.bundle, 9): Library not loaded: /Users/****/projects/anemone/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.1/ports/x86_64-apple-darwin12.5.0/libxml2/2.8.0/lib/libxml2.2.dylib (LoadError)
  Referenced from: /Users/****/projects/test_anemone/vendor/bundle/ruby/2.1.0/extensions/
x86_64-darwin-12/2.1.0-static/nokogiri-1.6.1/nokogiri/nokogiri.bundle
  Reason: Incompatible library version: nokogiri.bundle requires version 11.0.0 or later, but libxml2.2.dylib provides version 10.0.0 - /Users/****/projects/test_anemone/vendor/bundle/ruby/2.1.0/extensions/x86_64-darwin-12/2.1.0-static/nokogiri-1.6.1/nokogiri/nokogiri.bundle

よく考えたら、プロジェクトフォルダの名称を変更していた。。。

anemone => test_anemone

削除して、インストールし直しました。

% rm -rf vendor
% bundle install --path vendor/bundler
Fetching gem metadata from https://ruby
Fetching additional metadata from https
Installing mini_portile (0.5.2)
Installing nokogiri (1.6.1)
Installing robotex (1.0.0)
Installing anemone (0.7.2)
Installing bson (1.9.2)
Installing bson_ext (1.9.2)
Installing mongo (1.9.2)
Using bundler (1.5.3)
Your bundle is complete!
It was installed into ./vendor/bundler

教訓:エラーはちゃんと読もう。