我正在按照本教程开发一些 Ruby on Rails 应用程序。http://ruby.railstutorial.org/chapters/static-pages#sec-TDD
我已经创建了..._spec.rb
文件。
但是当我运行命令时-bundle exec rspec spec/requests/static_pages_spec.rb
有一个错误 -require: cannot load such file -- nokogiri (LoadError).
谁能帮我?
完整的错误信息:
/home/karlis/.rvm/gems/ruby-1.9.3-p286/gems/capybara-2.0.1/lib/capybara.rb:2:in `require': cannot load such file -- nokogiri (LoadError)
from /home/karlis/.rvm/gems/ruby-1.9.3-p286/gems/capybara-2.0.1/lib/capybara.rb:2:in `<top (required)>'
from /home/karlis/.rvm/gems/ruby-1.9.3-p286@global/gems/bundler-1.2.1/lib/bundler/runtime.rb:68:in `require'
from /home/karlis/.rvm/gems/ruby-1.9.3-p286@global/gems/bundler-1.2.1/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /home/karlis/.rvm/gems/ruby-1.9.3-p286@global/gems/bundler-1.2.1/lib/bundler/runtime.rb:66:in `each'
from /home/karlis/.rvm/gems/ruby-1.9.3-p286@global/gems/bundler-1.2.1/lib/bundler/runtime.rb:66:in `block in require'
from /home/karlis/.rvm/gems/ruby-1.9.3-p286@global/gems/bundler-1.2.1/lib/bundler/runtime.rb:55:in `each'
from /home/karlis/.rvm/gems/ruby-1.9.3-p286@global/gems/bundler-1.2.1/lib/bundler/runtime.rb:55:in `require'
from /home/karlis/.rvm/gems/ruby-1.9.3-p286@global/gems/bundler-1.2.1/lib/bundler.rb:128:in `require'
from /home/karlis/workspace/sample_app/config/application.rb:13:in `<top (required)>'
from /home/karlis/workspace/sample_app/config/environment.rb:2:in `require'
from /home/karlis/workspace/sample_app/config/environment.rb:2:in `<top (required)>'
from /home/karlis/workspace/sample_app/spec/spec_helper.rb:3:in `require'
from /home/karlis/workspace/sample_app/spec/spec_helper.rb:3:in `<top (required)>'
from /home/karlis/workspace/sample_app/spec/requests/static_pages_spec.rb:1:in `require'
from /home/karlis/workspace/sample_app/spec/requests/static_pages_spec.rb:1:in `<top (required)>'
from /home/karlis/.rvm/gems/ruby-1.9.3-p286/gems/rspec-core-2.12.0/lib/rspec/core/configuration.rb:784:in `load'
from /home/karlis/.rvm/gems/ruby-1.9.3-p286/gems/rspec-core-2.12.0/lib/rspec/core/configuration.rb:784:in `block in load_spec_files'
from /home/karlis/.rvm/gems/ruby-1.9.3-p286/gems/rspec-core-2.12.0/lib/rspec/core/configuration.rb:784:in `each'
from /home/karlis/.rvm/gems/ruby-1.9.3-p286/gems/rspec-core-2.12.0/lib/rspec/core/configuration.rb:784:in `load_spec_files'
from /home/karlis/.rvm/gems/ruby-1.9.3-p286/gems/rspec-core-2.12.0/lib/rspec/core/command_line.rb:22:in `run'
from /home/karlis/.rvm/gems/ruby-1.9.3-p286/gems/rspec-core-2.12.0/lib/rspec/core/runner.rb:69:in `run'
from /home/karlis/.rvm/gems/ruby-1.9.3-p286/gems/rspec-core-2.12.0/lib/rspec/core/runner.rb:8:in `block in autorun'