addicted2unix
addicted2unix

Reputation: 517

Rake spec not running with upgraded ruby

I'm fairly new to ruby, and the company I work for has us do local spec tests for our code before checking it in. Up until a few days ago, my spec tests were running completely fine, but I recently upgraded from the default OS X ruby version (1.8.7) to 2.0.0, and 'rake spec' now fails with the output below, I've abbreviated to the relevant information:

/Users/Jordan/.rvm/gems/ruby-2.0.0-p247/gems/rspec-puppet-0.1.5/lib/rspec-puppet.rb:1:in `require': cannot load such file -- puppet (LoadError)
from /Users/Jordan/.rvm/gems/ruby-2.0.0-p247/gems/rspec-puppet-0.1.5/lib/rspec-puppet.rb:1:in `<top (required)>'
from /Users/Jordan/edmunds_dev/spec/spec_helper.rb:1:in `require'
from /Users/Jordan/edmunds_dev/spec/spec_helper.rb:1:in `<top (required)>'
from /Users/Jordan/edmunds_dev/modules/apache/spec/classes/apache_spec.rb:1:in `require'
from /Users/Jordan/edmunds_dev/modules/apache/spec/classes/apache_spec.rb:1:in `<top (required)>'
from /Users/Jordan/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in `load'
from /Users/Jordan/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in `block in load_spec_files'
from /Users/Jordan/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in `map'
from /Users/Jordan/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core- 2.11.1/lib/rspec/core/configuration.rb:780:in `load_spec_files'
from /Users/Jordan/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-  2.11.1/lib/rspec/core/command_line.rb:22:in `run'
from /Users/Jordan/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:69:in `run'
from /Users/Jordan/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:8:in `block in autorun'
rake aborted!
/Users/Jordan/.rvm/rubies/ruby-2.0.0-p247/bin/ruby -S rspec 

What I tried:

reinstalling ruby, and all relevant gems

Updating rubygems, then reinstalling relevant gems

Looking at the Rakefile

What I'm about to do:

Reinstall my OS or just go ballistic deleting everything that has ruby in the name and reinstall it.

Upvotes: 0

Views: 1678

Answers (1)

Matt Dressel
Matt Dressel

Reputation: 2194

It appears that puppet is not installed for ruby 2.0.x yet. You probably had it installed for 1.8.7. All gems need to be installed against the latest ruby version.

If using Bundler, ensure that puppet is in your Gemfile:

source 'https://rubygems.org'

gem 'puppet'

# Once the issue is ironed out, place this and other spec-related
# gems in the test group
gem 'rspec-puppet'

Then, ensure bundler loads the environment via bundle exec rake spec.

Or install it manually, using:

gem install puppet

Check out the rspec-puppet documentation for additional details.

Upvotes: 1

Related Questions