2012-11-06 46 views
0

我試圖將我的rails應用程序從ubuntu遷移到osx。當運行rspec時,我得到以下隱藏錯誤:從ubuntu遷移到osx時未初始化的常量

/Users/josh/dev/myproject/spec/support/devise.rb:3:in `block in <top (required)>': uninitialized constant RequestHelpers (NameError) 
    from /Users/josh/.rvm/gems/[email protected]/gems/rspec-core-2.11.1/lib/rspec/core.rb:92:in `configure' 
    from /Users/josh/dev/myproject/spec/support/devise.rb:1:in `<top (required)>' 
    from /Users/josh/dev/myproject/spec/spec_helper.rb:21:in `block (2 levels) in <top (required)>' 
    from /Users/josh/dev/myproject/spec/spec_helper.rb:21:in `each' 
    from /Users/josh/dev/myproject/spec/spec_helper.rb:21:in `block in <top (required)>' 
    from /Users/josh/.rvm/gems/[email protected]/gems/spork-0.9.2/lib/spork.rb:24:in `prefork' 
    from /Users/josh/dev/myproject/spec/spec_helper.rb:4:in `<top (required)>' 
    from /Users/josh/dev/myproject/spec/controllers/comments_controller_spec.rb:1:in `require' 
    from /Users/josh/dev/myproject/spec/controllers/comments_controller_spec.rb:1:in `<top (required)>' 
    from /Users/josh/.rvm/gems/[email protected]/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in `load' 
    from /Users/josh/.rvm/gems/[email protected]/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in `block in load_spec_files' 
    from /Users/josh/.rvm/gems/[email protected]/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in `map' 
    from /Users/josh/.rvm/gems/[email protected]/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in `load_spec_files' 
    from /Users/josh/.rvm/gems/[email protected]/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:22:in `run' 
    from /Users/josh/.rvm/gems/[email protected]/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:66:in `rescue in run' 
    from /Users/josh/.rvm/gems/[email protected]/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:62:in `run' 
    from /Users/josh/.rvm/gems/[email protected]/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:8:in `block in autorun' 

在Ubuntu中一切都很好,所以我想它一定是環境。任何想法從哪裏開始挖掘?

感謝 - 喬希

編輯:不知道爲什麼,但文件request_helpers.rb不能用耙找到。將它移到別處解決了這個問題。

+0

你是否已經將數據庫遷移到適合當前的方案? –

+0

嘗試我的其他建議在SO上:http://stackoverflow.com/a/13302121/1343134 – TheMadKoder

回答

1

這似乎不是一個操作系統問題,更重要的是配置問題。確保您的environemnt相同的方面:使用RVM

  • 安裝使用捆綁使用同一版本的執行rspec的
  • 其在Gemfile中
  • 所有需要的寶石同樣的方式
  • 一切。

通過TE的方式,這不是一個不起眼的消息,這其實很清楚:

uninitialized constant RequestHelpers (NameError)

所以spec/support/devise.rb文件無法找到所需的類。

你寫過那個文件嗎?如果不是,你是如何產生它的?重複該過程以生成它(可能是rake somethingrails generate something)並且它會正常。

相關問題