3

我正在使用 MacPorts 来管理我的 Ruby/Rails/Gems 安装。最近gem install wirble,当我启动一个 irb 实例时,wirble 无法加载。这是输出:

$ irb --simple-prompt
Couldn't load Wirble: no such file to load -- wirble

Wirble gem 没有出现在我的 $LOAD_PATH 中:

>> puts $:
/opt/local/lib/ruby1.9/gems/1.9.1/gems/actionmailer-2.3.5/lib
/opt/local/lib/ruby1.9/gems/1.9.1/gems/actionpack-2.3.5/lib
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-2.3.5/lib
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activeresource-2.3.5/lib
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activesupport-2.3.5/lib
/opt/local/lib/ruby1.9/gems/1.9.1/gems/mysql-2.8.1/lib
/opt/local/lib/ruby1.9/gems/1.9.1/gems/mysql-2.8.1/ext
/opt/local/lib/ruby1.9/gems/1.9.1/gems/mysql-2.8.1/bin
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rack-1.0.1/bin
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rack-1.0.1/lib
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rails-2.3.5/bin
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rails-2.3.5/lib
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rake-0.8.7/bin
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rake-0.8.7/lib
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rubygems-update-1.3.7/hide_lib_for_update
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rubygems-update-1.3.7/bin
/opt/local/lib/ruby1.9/site_ruby/1.9.1
/opt/local/lib/ruby1.9/site_ruby/1.9.1/i386-darwin10
/opt/local/lib/ruby1.9/site_ruby
/opt/local/lib/ruby1.9/vendor_ruby/1.9.1
/opt/local/lib/ruby1.9/vendor_ruby/1.9.1/i386-darwin10
/opt/local/lib/ruby1.9/vendor_ruby
/opt/local/lib/ruby1.9/1.9.1
/opt/local/lib/ruby1.9/1.9.1/i386-darwin10
.
=> nil
>> 

肯定安装了gem:

$ gem list |grep -i wirble
wirble (0.1.3)

它位于/opt/local/lib/ruby/gems/1.9.1/gems/wirble-0.1.3/

如何将我安装的这个和未来的 gem 附加到我的 $LOAD_PATH 中?

4

2 回答 2

3

你在 irb 中需要 RubyGems 吗?

require 'rubygems'

在需要任何宝石之前可能是必要的。你也可以把这条线放进去,~/.irbrc这样当 irb 启动时你就会自动需要 RubyGems。

我不确定为什么您的某些 Gem 在您的加载路径中 - gem 通常不会出现在$:.

于 2010-05-30T00:17:16.503 回答
1

我得到了这个工作!

使用了这个版本:https ://github.com/blackwinter/wirble.git并且成功了!

希望有帮助!

约翰

于 2010-12-11T16:22:25.493 回答