How to get rspec running?

I'm quite new to RoR and recently worked through Michael Hartl's Rail Tutorial. Now that I had started my first own project and began with the implementation of a first model and it's controller. The tests I wanted to implement just after that. However, I run into some error messages when I want to start rspec (see below). The Gemfile is the same as in the Tutorial example and 'rspec spec' works perfectly in the other subdirectoy (U:\railsprojects\sample_app) without any problems. Can anybody help?

Thanks and kind regards,

Markus

Error messages:

U:\railsprojects\rim2011>bundle install Fetching source index for http://rubygems.org/ Using rake (0.8.7) Using abstract (1.0.0) Using activesupport (3.0.1) Using builder (2.1.2) Using i18n (0.4.2) Using activemodel (3.0.1) Using erubis (2.6.6) Using rack (1.2.1) Using rack-mount (0.6.13) Using rack-test (0.5.6) Using tzinfo (0.3.23) Using actionpack (3.0.1) Using mime-types (1.16) Using polyglot (0.3.1) Using treetop (1.4.9) Using mail (2.2.9.1) Using actionmailer (3.0.1) Using arel (1.0.1) Using activerecord (3.0.1) Using activeresource (3.0.1) Using annotate-models (1.0.4) Using bundler (1.0.3) Using diff-lcs (1.1.2) Using factory_girl (1.3.2) Using thor (0.14.4) Using railties (3.0.1) Using rails (3.0.1) Using factory_girl_rails (1.0) Using faker (0.3.1) Installing nokogiri (1.4.4) Using rspec-core (2.0.1) Using rspec-expectations (2.0.1) Using rspec-mocks (2.0.1) Using rspec (2.0.1) Using rspec-rails (2.0.1) Using sqlite3-ruby (1.3.2) Using webrat (0.7.1) Using will_paginate (3.0.pre2) Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

U:\railsprojects\rim2011>rspec spec/ C:/Ruby192/lib/ruby/gems/1.9.1/gems/nokogiri-1.4.4-x86-mingw32/lib/nokogiri/nokogiri.rb:1:in `require': 127: Die angegebene Prozedur wurde nicht gefunden. - Init_nokogiri (LoadError) C:/Ruby192/lib/ruby/gems/1.9.1/gems/nokogiri-1.4.4-x86-mingw32/lib/nokogiri/1.9/nokogiri.so         from C:/Ruby192/lib/ruby/gems/1.9.1/gems/nokogiri-1.4.4-x86-mingw32/lib/nokogiri/nokogiri.rb:1:in `<top (required)>'         from C:/Ruby192/lib/ruby/gems/1.9.1/gems/nokogiri-1.4.4-x86-mingw32/lib/nokogiri.rb:13:in `require'         from C:/Ruby192/lib/ruby/gems/1.9.1/gems/nokogiri-1.4.4-x86-mingw32/lib/nokogiri.rb:13:in `<top (required)>'         from C:/Ruby192/lib/ruby/gems/1.9.1/gems/webrat-0.7.1/lib/webrat.rb:2:in `require'         from C:/Ruby192/lib/ruby/gems/1.9.1/gems/webrat-0.7.1/lib/webrat.rb:2:in `<top (required)>'         from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/runtime.rb:64:in `require'         from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/runtime.rb:64:in `block (2 levels) in require'         from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/runtime.rb:62:in `each'         from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/runtime.rb:62:in `block in require'         from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/runtime.rb:51:in `each'         from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/runtime.rb:51:in `require'         from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler.rb:112:in `require'         from U://railsprojects/rim2011/config/application.rb:7:in `<top (required)>'         from <internal:lib/rubygems/custom_require>:29:in `require'         from <internal:lib/rubygems/custom_require>:29:in `require'         from U://railsprojects/rim2011/config/environment.rb:2:in `<top (required)>'         from <internal:lib/rubygems/custom_require>:29:in `require'         from <internal:lib/rubygems/custom_require>:29:in `require'         from U://railsprojects/rim2011/spec/spec_helper.rb:3:in `<top (required)>'         from <internal:lib/rubygems/custom_require>:29:in `require'         from <internal:lib/rubygems/custom_require>:29:in `require'         from U://railsprojects/rim2011/spec/models/user_spec.rb:1:in `<top (required)>'         from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.0.1/lib/rspec/core/configuration.rb:306:in `load'         from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.0.1/lib/rspec/core/configuration.rb:306:in `block in load_spec_files'         from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.0.1/lib/rspec/core/configuration.rb:306:in `map'         from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.0.1/lib/rspec/core/configuration.rb:306:in `load_spec_files'         from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.0.1/lib/rspec/core/command_line.rb:18:in `run'         from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.0.1/lib/rspec/core/runner.rb:55:in `run_in_process'         from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.0.1/lib/rspec/core/runner.rb:46:in `run'         from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.0.1/lib/rspec/core/runner.rb:10:in `block in autorun'

I'm still looking for a solution. I have uninstalled 'nokogiri', 'webrat', 'rspec' and 'rspec-rails' several time. But after each successful 'bundle install', I will get the same error messages again when trying 'rspec spec/'.

Has anybody an idea in which direction I should search?

Gave up for today, still not working. I would really appreciate if somebody could give me a hint what I should try or check.

Thanks!

Hello,

I'm absolutely not sure about it yet, but I'll try to help you work it out.

So please write me whichoperating system is Windows right? Which one (I really suggest to change to Unix based)? Ruby1.91+Gem1.7+Rails3.0.1? Do you use RVM? Doesn't seem, I think it will make your problem easier.

It seemed errors that nokogiri is not installed, I had the same problem. Installing Nokogiri - Nokogiri gem install nokogiri (as admin) I had problem with xslt also, which was requirement for Nokogiri, so let me know if another problem popups.

Maybe use: gem cleanup, then reinstall the rspec gem, then gem update. (To be honest I do not have any trust in your OS.)

Please reply if others has the same problem later, good if they know the solution. Cheers, Zoltán

Thanks for you reply!

Actually I haven't solved the problem, meaning I still don't know why it happened and why it seems to work now.

But I had recognized that rspec was working in the other (tutorial) application. So I just created a new rails application and copied my created/edit files into the newly generated rails project. It took me some time to be ready to go for this pragmatic approach, but as a result it seems to work. However, I would be happy to understand, why it didn't work in the first run. BTW: Nokogiri was also available and working in another Ruby (no Rails) application without any problems.

Regards, Markus