Ruby无法找到已安装的gem

时间:2014-07-29 18:42:57

标签: ruby gem

我正在从jumpstartlabs做一个教程

http://tutorials.jumpstartlab.com/projects/eventmanager.html#iteration:-day-of-the-week-targeting

在安装了sunshine-congress gem之后,它说安装了它,但是当试图在.rb文件中使用它时我收到错误

event_manager.rb文件:

require 'rubygems'
require 'csv'

要求'阳光/国会'

 require 'sunlight-congress'

当我尝试通过控制台启动它时:

d:\Sites\TOP\event_manager\lib>event_manager.rb
d:/program files/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:
    55:in `require': cannot load such file -- sunlight/congress (LoadError)
    from d:/program files/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kerne
    l_require.rb:55:in `require'
    from D:/Sites/TOP/event_manager/lib/event_manager.rb:3:in `<main>'

我的红宝石环境:

d:\Sites\TOP\event_manager\lib>gem env
RubyGems Environment:
- RUBYGEMS VERSION: 2.0.2
- RUBY VERSION: 2.0.0 (2013-05-14 patchlevel 195) [i386-mingw32]
- INSTALLATION DIRECTORY: d:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0
- RUBY EXECUTABLE: d:/RailsInstaller/Ruby2.0.0/bin/ruby.exe
- EXECUTABLE DIRECTORY: d:/RailsInstaller/Ruby2.0.0/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-mingw32
- GEM PATHS:
 - d:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0
 - C:/Users/Mie/.gem/ruby/2.0.0
- GEM CONFIGURATION:
 - :update_sources => true
 - :verbose => true
 - :backtrace => false
 - :bulk_threshold => 1000
 - REMOTE SOURCES:
 - https://rubygems.org/

为什么在红宝石中找不到宝石?

1 个答案:

答案 0 :(得分:1)

您的需要声明必须是:

require 'sunlight-congress'