Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialDavid Axelrod
36,073 PointsRspec isn't working properly :(
when i run rspec i get this huge error message and im not sure how to go about fixing it
Davids-MacBook-Pro-3:odot davidaxelrod$ bin/rspec spec/models/user_spec.rb
/Users/davidaxelrod/.rvm/gems/ruby-2.2.0/gems/activesupport-4.0.1/lib/active_support/values/time_zone.rb:282: warning: circular argument reference - now
WARNING: Nokogiri was built against LibXML version 2.9.0, but has dynamically loaded 2.8.0
/Users/davidaxelrod/.rvm/gems/ruby-2.2.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in require': cannot load such file -- test/unit/assertions (LoadError)
from /Users/davidaxelrod/.rvm/gems/ruby-2.2.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in
block in require'
from /Users/davidaxelrod/.rvm/gems/ruby-2.2.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:214:in load_dependency'
from /Users/davidaxelrod/.rvm/gems/ruby-2.2.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in
require'
from /Users/davidaxelrod/.rvm/gems/ruby-2.2.0/gems/rspec-rails-2.14.0/lib/rspec/rails/adapters.rb:3:in <top (required)>'
from /Users/davidaxelrod/.rvm/gems/ruby-2.2.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in
require'
from /Users/davidaxelrod/.rvm/gems/ruby-2.2.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in block in require'
from /Users/davidaxelrod/.rvm/gems/ruby-2.2.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:214:in
load_dependency'
from /Users/davidaxelrod/.rvm/gems/ruby-2.2.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in require'
from /Users/davidaxelrod/.rvm/gems/ruby-2.2.0/gems/rspec-rails-2.14.0/lib/rspec/rails.rb:11:in
<top (required)>'
from /Users/davidaxelrod/.rvm/gems/ruby-2.2.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in require'
from /Users/davidaxelrod/.rvm/gems/ruby-2.2.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in
block in require'
from /Users/davidaxelrod/.rvm/gems/ruby-2.2.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:214:in load_dependency'
from /Users/davidaxelrod/.rvm/gems/ruby-2.2.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in
require'
from /Users/davidaxelrod/Documents/treehouse/projects/odot/spec/spec_helper.rb:4:in <top (required)>'
from /Users/davidaxelrod/Documents/treehouse/projects/odot/spec/models/user_spec.rb:1:in
require'
from /Users/davidaxelrod/Documents/treehouse/projects/odot/spec/models/user_spec.rb:1:in <top (required)>'
from /Users/davidaxelrod/.rvm/gems/ruby-2.2.0/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:896:in
load'
from /Users/davidaxelrod/.rvm/gems/ruby-2.2.0/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:896:in block in load_spec_files'
from /Users/davidaxelrod/.rvm/gems/ruby-2.2.0/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:896:in
each'
from /Users/davidaxelrod/.rvm/gems/ruby-2.2.0/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:896:in load_spec_files'
from /Users/davidaxelrod/.rvm/gems/ruby-2.2.0/gems/rspec-core-2.14.7/lib/rspec/core/command_line.rb:22:in
run'
from /Users/davidaxelrod/.rvm/gems/ruby-2.2.0/gems/rspec-core-2.14.7/lib/rspec/core/runner.rb:80:in run'
from /Users/davidaxelrod/.rvm/gems/ruby-2.2.0/gems/rspec-core-2.14.7/lib/rspec/core/runner.rb:17:in
block in autorun'
2 Answers
Salman Akram
Courses Plus Student 40,065 PointsHi David,
I think you can reinstall both Nokogiri and LibXML, probably you had LibXML2's older version, this might cause nokogiri to compile against LibXML's version 2.9.0, Nokogiri will work perfectly with a newer version of LibXML.
Let's follow this step below if you are using homebrew without bundler:
- gem uninstall nokogiri libxml-ruby
- brew update
- brew uninstall libxml2
- brew install libxml2 --with-xml2-config
- brew install libxslt
- gem install nokogiri
Please make sure if you have gem 'nokogiri' in your Gemfile (it should be at the top side).
Hope it will solve to get rid of these huge warning messages. :)
-Salman
Seth Reece
32,867 PointsYou might need to add gem 'test-unit' and or gem 'minitest' to your gem file and bundle. I think there are some issues with rspec 2.14.7 and Ruby 2.2.0 and newer. Upgrading rspec to 3.2 or better might also work, but I wouldn't do it mid project. It will greatly confuse you during Odot. Rspec 3 uses two spec helpers.
David Axelrod
36,073 Pointsthanks for the reply! added both test unit and minitest and bundled with no avail. I've been combing the interwebs for an answer but nothing has worked so far. Ill keep looking though.
Seth Reece
32,867 PointsI do remember having a similar issue during Odot. I don't remember the exact fix, but is was something like switching minitest/autorun to just minitest I think.
David Axelrod
36,073 PointsDavid Axelrod
36,073 Pointsdarn!! I followed your instructions to the letter and still got the same response
thank you so much for your reply though!
Salman Akram
Courses Plus Student 40,065 PointsSalman Akram
Courses Plus Student 40,065 PointsOkay, can you try other way either below?