簡體   English   中英

在Rails 3上安裝和運行Capybara(未初始化的常量Object :: Rack(NameError))

[英]Installing and running Capybara on Rails 3 (uninitialized constant Object::Rack (NameError))

我正在嘗試按照此處的說明安裝Capybara。 但是每次我嘗試運行集成測試時,都會得到:

/Users/rambo/.rvm/gems/ruby-1.9.2-p180/bundler/gems/capybara-6641fddcfc33/lib/capybara/rails.rb:4:in `<top (required)>': uninitialized constant Object::Rack (NameError)
    from /Users/rambo/Code/ror/witsvale_app/test/integration_test_helper.rb:1:in `require'
    from /Users/rambo/Code/ror/witsvale_app/test/integration_test_helper.rb:1:in `<top (required)>'
    from test/integration/capy_test.rb:1:in `require'
    from test/integration/capy_test.rb:1:in `<top (required)>'
    from /Users/rambo/.rvm/gems/ruby-1.9.2-p180@global/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `load'

引起問題的線是require capybara/rails

任何想法將不勝感激。

我覺得自己像個傻瓜。

無論如何,我已經解決了。 原來我在“測試”文件夾中缺少“ test_helper.rb”。 加入之后,它就可以工作了!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM