I have a private gem, I added to my gemfile
gem 'saml-response', '0.0.0', :path =>"#{Fi开发者_运维问答le.expand_path(FILE)}/../vendor/gems/"
Then bundle install it, and the bundle gets installed in:
DANIELs-MacBook-Air:Authy-Google-SSO dani$ bundle show saml-response
/Users/dani/Development/authy/Authy-Google-SSO/vendor/gems
But rails 3.1 seems not no load any gems from vendor/gems
ruby-1.9.2-p290 :001 > require 'saml-response'
LoadError: no such file to load -- saml-response
So if vendor/gems are not loaded why is bundler installing the gem there.
Why the path magic?
Simply:
gem "yourgem", :path => "vendor/gems/yourgem"
will work, and yeah, it will load from there.
It appears to be your path. You're pointing to your gems directory but you need to point to directory of the gem itself.
# not
:path => "vendor/gems"
# but rather
:path => "vendor/gems/saml-response"
精彩评论