使用RVM和Bundler引用本地gem?

时间:2012-07-27 21:02:45

标签: ruby git rvm bundler

我想在构建应用程序时使用支持库,同时使用RVM和Bundler来管理我的应用程序环境。

我的Gemfile是

# forked and cloned to local directory
gem 'feedzirra', :path => '../../feedzirra'

然后在命令行上:

$ bundle install
..
Using feedzirra (0.2.0.rc2) from source at /Users/ryan/dev/feedzirra 
..
$ bundle show feedzirra
/Users/ryan/dev/feedzirra
$ gem which feedzirra
ERROR:  Can't find ruby library file or shared library feedzirra

IRB:

1.9.3p194 :001 > require 'feedzirra'
LoadError: cannot load such file -- feedzirra
    from /Users/ryan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/ryan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from (irb):1
    from /Users/ryan/.rvm/rubies/ruby-1.9.3-p194/bin/irb:16:in `<main>'

我错过了什么?

1 个答案:

答案 0 :(得分:2)

你需要在bundler上下文中运行它:

bundle exec gem which feedzirra

bundle exec irb