【问题标题】:Referencing a local gem with RVM and Bundler?使用 RVM 和 Bundler 引用本地 gem?
【发布时间】:2012-07-27 21:02:45
【问题描述】:

我想在构建应用程序的同时使用支持库,同时使用 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>'

我错过了什么?

【问题讨论】:

    标签: ruby git rvm bundler


    【解决方案1】:

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

    bundle exec gem which feedzirra
    

    或

    bundle exec irb
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-04-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多