rubyrubygemsrspecchronic

Problems with RSpec and Chronic


I'm trying to use Chronic inside my non-rails project. When I try to get the specs with 'spec' I get the following error:

$ 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'

If I run it by hand everything works:

$ ruby -rrubygems  spec/parsers/parser_english_spec.rb 

This is what I have in my spec_helper.rb

require 'rubygems'
require 'spec'
require File.dirname(__FILE__) + "/../lib/recurring_events"

Any ideas of what might be going wrong?


Solution

  • I've fixed it now, it turns out that the spec command was running the old stock version that comes with OS X so it couldn't find the gem.