Backstory:我和一些朋友正在開發一個應用程序,並希望選擇多個項目在另一個頁面上處理。在我們找到RailsCast #165之前,我創建了一個分支,併爲其上添加了三個複選框的表添加了腳手架,以查看生成的代碼的樣子。在RC165中找到了正確答案後,我刪除了所有代碼和遷移,並放棄了所有這些工作。未初始化的常量ActionController
唉,我似乎無法擺脫它作爲引用它阻止我在任何分支上做任何事情。當我「耙分貝:遷移」或「軌道的」什麼的,我得到...
uninitialized constant ActionController::MimeResponds::ChecksHelper (NameError)
...即使字符串「檢查」會出現在我的項目目錄中的任何地方。到目前爲止,我已經爲:
- 重命名的目錄,並從GitHub克隆一個新的項目(注:我的實驗從未 在本地文件系統級別甚至COMMITED,更推高了)。
- 吹走Postgress開發和測試數據庫
我完全茫然,瞭解如何以及在何處Rails的是「記住」我簡單的試驗和我的想法短吹走的Ruby,Rails的,並rbenv,即把機器刮到基岩 - 吸盤上。
我不能相信,僅僅從一些不適當的代碼中退出應該是很難的。
任何有關如何解決這個問題或在將來避免它的建議都是非常受歡迎的。
- 韋恩
堆棧跟蹤如下:
Verns-MacBook-Pro:Portfolio-Project-1-User-Stories vern$ git branch
* master
Verns-MacBook-Pro:Portfolio-Project-1-User-Stories vern$ rails s
=> Booting WEBrick
=> Rails 3.2.11 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/Users/vern/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/actionpack-3.2.11/lib/action_controller/metal/mime_responds.rb:11:in `<module:MimeResponds>': uninitialized constant ActionController::MimeResponds::ChecksHelper (NameError)
from /Users/vern/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/actionpack-3.2.11/lib/action_controller/metal/mime_responds.rb:6:in `<module:ActionController>'
from /Users/vern/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/actionpack-3.2.11/lib/action_controller/metal/mime_responds.rb:5:in `<top (required)>'
from /Users/vern/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/actionpack-3.2.11/lib/action_controller/base.rb:196:in `<class:Base>'
from /Users/vern/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/actionpack-3.2.11/lib/action_controller/base.rb:171:in `<module:ActionController>'
from /Users/vern/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/actionpack-3.2.11/lib/action_controller/base.rb:3:in `<top (required)>'
from /Users/vern/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/sorcery-0.8.1/lib/sorcery/engine.rb:11:in `block in <class:Engine>'
from /Users/vern/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/railties-3.2.11/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/vern/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/railties-3.2.11/lib/rails/initializable.rb:30:in `run'
from /Users/vern/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/railties-3.2.11/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/vern/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/railties-3.2.11/lib/rails/initializable.rb:54:in `each'
from /Users/vern/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/railties-3.2.11/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/vern/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/railties-3.2.11/lib/rails/application.rb:136:in `initialize!'
from /Users/vern/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/railties-3.2.11/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/vern/RoR/Portfolio-Project-1-User-Stories/config/environment.rb:5:in `<top (required)>'
from /Users/vern/RoR/Portfolio-Project-1-User-Stories/config.ru:3:in `block in <main>'
from /Users/vern/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
from /Users/vern/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
from /Users/vern/RoR/Portfolio-Project-1-User-Stories/config.ru:in `new'
from /Users/vern/RoR/Portfolio-Project-1-User-Stories/config.ru:in `<main>'
from /Users/vern/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:40:in `eval'
from /Users/vern/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:40:in `parse_file'
from /Users/vern/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/rack-1.4.5/lib/rack/server.rb:200:in `app'
from /Users/vern/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/railties-3.2.11/lib/rails/commands/server.rb:46:in `app'
from /Users/vern/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/rack-1.4.5/lib/rack/server.rb:304:in `wrapped_app'
from /Users/vern/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/rack-1.4.5/lib/rack/server.rb:254:in `start'
from /Users/vern/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/railties-3.2.11/lib/rails/commands/server.rb:70:in `start'
from /Users/vern/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/railties-3.2.11/lib/rails/commands.rb:55:in `block in <top (required)>'
from /Users/vern/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/railties-3.2.11/lib/rails/commands.rb:50:in `tap'
from /Users/vern/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/railties-3.2.11/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Verns-MacBook-Pro:Portfolio-Project-1-User-Stories vern$ rake db:migrate
rake aborted!
You have already activated rake 10.0.4, but your Gemfile requires rake 10.0.3. Using bundle exec may solve this.
/Users/vern/RoR/Portfolio-Project-1-User-Stories/config/boot.rb:6:in `<top (required)>'
/Users/vern/RoR/Portfolio-Project-1-User-Stories/config/application.rb:1:in `<top (required)>'
/Users/vern/RoR/Portfolio-Project-1-User-Stories/Rakefile:5:in `<top (required)>'
(See full trace by running task with --trace)
Verns-MacBook-Pro:Portfolio-Project-1-User-Stories vern$ bundle exec rake db:migrate
rake aborted!
uninitialized constant ActionController::MimeResponds::ChecksHelper
/Users/vern/RoR/Portfolio-Project-1-User-Stories/config/environment.rb:5:in `<top (required)>'
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)
它可以是被安裝使寶石問題?你能吹走寶石還是再捆一遍? – Phil 2013-04-27 18:39:24
你的控制器中有任何'respond_with'或'respond_to'調用嗎? – 2013-04-27 18:47:23
尋找......我確實有一些respond_to調用 - 它們都沒有在與控制器相關的模型之外進行任何引用 - 即沒有在任何地方「檢查」。配置/初始化/ mime_types.rb是更誘人(給出錯誤信息),但它是所有評論,我不記得曾編輯,然後恢復它,我想不出任何理由我會。我已經停止並嘗試多次啓動服務器。哪裏可能註冊垃圾持久? – vemcg 2013-04-27 20:27:54