RSpec和慢性病的问题

时间:2009-02-04 09:52:40

标签: ruby rubygems rspec chronic

我正在尝试在我的非rails项目中使用Chronic。当我试图得到 'spec'的规格我得到以下错误:

$ spec spec/parsers/parser_english_spec.rb

/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- chronic (LoadError)
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
from ./spec/parsers/../../lib/recurring_events.rb:6
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
from ./spec/parsers/../spec_helper.rb:3
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
from ./spec/parsers/parser_english_spec.rb:1
from /Library/Ruby/Gems/1.8/gems/rspec-1.1.12/lib/spec/runner/example_group_runner.rb:15:in `load'
from /Library/Ruby/Gems/1.8/gems/rspec-1.1.12/lib/spec/runner/example_group_runner.rb:15:in `load_files'
from /Library/Ruby/Gems/1.8/gems/rspec-1.1.12/lib/spec/runner/example_group_runner.rb:14:in `each'
from /Library/Ruby/Gems/1.8/gems/rspec-1.1.12/lib/spec/runner/example_group_runner.rb:14:in `load_files'
from /Library/Ruby/Gems/1.8/gems/rspec-1.1.12/lib/spec/runner/options.rb:94:in `run_examples'
from /Library/Ruby/Gems/1.8/gems/rspec-1.1.12/lib/spec/runner/command_line.rb:9:in `run'
from /Library/Ruby/Gems/1.8/gems/rspec-1.1.12/bin/spec:4
from /usr/bin/spec:19:in `load'

如果我手动操作,一切正常:

$ ruby -rrubygems  spec/parsers/parser_english_spec.rb 

这是我在spec_helper.rb

中的内容
require 'rubygems'
require 'spec'
require File.dirname(__FILE__) + "/../lib/recurring_events"

任何可能出错的想法?​​

1 个答案:

答案 0 :(得分:0)

我现在已修复它,但事实证明spec命令正在运行OS X附带的旧库存版本,因此无法找到gem。