неопределенный метод `form_for 'для модуля` ActionView :: Helpers :: FormHelper' - PullRequest
2 голосов
/ 07 февраля 2010

Argh! Все было в порядке, но вдруг у меня появилась эта ошибка, когда я делал 'rake db: migrate' И я получаю то же самое, когда пытаюсь перезапустить сервер rails.

rake aborted!
undefined method 'form_for' for module `ActionView::Helpers::FormHelper'

Подтверждение того, что у меня запущена текущая версия: мм-MacBookPro: багажник мм $ рельсы -v Рельсы 2.3.5

Ни один из моих form_for не был добавлен недавно, и они работали нормально. Я перезагрузил и переустановил рельсы. Какого черта это может вызвать?

Вот - - трассировка

** Invoke db: migrate (first_time) ** Вызвать среду (first_time) ** Выполнение рейка отменено! неопределенный метод form_for' for module ActionView :: Helpers :: FormHelper ' /Users/mm/.gem/ruby/1.9.1/gems/haml-2.2.19/lib/haml/helpers/action_view_mods.rb:174:in alias_method' /Users/mm/.gem/ruby/1.9.1/gems/haml-2.2.19/lib/haml/helpers/action_view_mods.rb:174:in /Users/mm/.gem/ruby/1.9.1/gems/haml-2.2.19/lib/haml/helpers/action_view_mods.rb:159:in <module:Helpers>' /Users/mm/.gem/ruby/1.9.1/gems/haml-2.2.19/lib/haml/helpers/action_view_mods.rb:41:in /Users/mm/.gem/ruby/1.9.1/gems/haml-2.2.19/lib/haml/helpers/action_view_mods.rb:1:in <top (required)>' /Volumes/Development/tc/app/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in требуется» /Volumes/Development/tc/app/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in block in require' /Volumes/Development/tc/app/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in new_constants_in' /Volumes/Development/tc/app/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in require' /Users/mm/.gem/ruby/1.9.1/gems/haml-2.2.19/lib/haml/helpers.rb:2:in /Volumes/Development/tc/app/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in require' /Volumes/Development/tc/app/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in блок требует ' /Volumes/Development/tc/app/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in new_constants_in' /Volumes/Development/tc/app/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in требуется» /Users/mm/.gem/ruby/1.9.1/gems/haml-2.2.19/lib/haml/engine.rb:1:in <top (required)>' /Volumes/Development/tc/app/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in требуется» /Volumes/Development/tc/app/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in block in require' /Volumes/Development/tc/app/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in new_constants_in' /Volumes/Development/tc/app/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in require' /Users/mm/.gem/ruby/1.9.1/gems/haml-2.2.19/lib/haml.rb:40:in /Volumes/Development/tc/app/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in require' /Volumes/Development/tc/app/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in блок требует ' /Volumes/Development/tc/app/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in new_constants_in' /Volumes/Development/tc/app/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in требуется» /Volumes/Development/tc/app/trunk/vendor/plugins/haml/init.rb:5:in rescue in block in evaluate_init_rb' /Volumes/Development/tc/app/trunk/vendor/plugins/haml/init.rb:1:in блок вvalu_init_rb ' /Volumes/Development/tc/app/trunk/vendor/rails/railties/lib/rails/plugin.rb:146:in eval' /Volumes/Development/tc/app/trunk/vendor/rails/railties/lib/rails/plugin.rb:146:in блок вvalu_init_rb ' /Volumes/Development/tc/app/trunk/vendor/rails/activesupport/lib/active_support/core_ext/kernel/reporting.rb:11:in silence_warnings' /Volumes/Development/tc/app/trunk/vendor/rails/railties/lib/rails/plugin.rb:142:in evaluate_init_rb» /Volumes/Development/tc/app/trunk/vendor/rails/railties/lib/rails/plugin.rb:48:in load' /Volumes/Development/tc/app/trunk/vendor/rails/railties/lib/rails/plugin/loader.rb:38:in блок в load_plugins ' /Volumes/Development/tc/app/trunk/vendor/rails/railties/lib/rails/plugin/loader.rb:37:in each' /Volumes/Development/tc/app/trunk/vendor/rails/railties/lib/rails/plugin/loader.rb:37:in load_plugins' /Volumes/Development/tc/app/trunk/vendor/rails/railties/lib/initializer.rb:348:in load_plugins' /Volumes/Development/tc/app/trunk/vendor/rails/railties/lib/initializer.rb:163:in процесс /Volumes/Development/tc/app/trunk/vendor/rails/railties/lib/initializer.rb:113:in run' /Volumes/Development/tc/app/trunk/config/environment.rb:13:in /Volumes/Development/tc/app/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in require' /Volumes/Development/tc/app/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in блок требует ' /Volumes/Development/tc/app/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in new_constants_in' /Volumes/Development/tc/app/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in требуется» /Volumes/Development/tc/app/trunk/vendor/rails/railties/lib/tasks/misc.rake:4:in block in <top (required)>' /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:636:in вызов» /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:636:in block in execute' /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:631:in каждый ' /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:631:in execute' /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:597:in блок в invoke_with_call_chain ' /usr/local/lib/ruby/1.9.1/monitor.rb:190:in mon_synchronize' /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:590:in invoke_with_call_chain' /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:607:in block in invoke_prerequisites' /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:604:in каждый ' /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:604:in invoke_prerequisites' /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:596:in блок в invoke_with_call_chain ' /usr/local/lib/ruby/1.9.1/monitor.rb:190:in mon_synchronize' /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:590:in invoke_with_call_chain' /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:583:in invoke' /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2051:in invoke_task ' /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2029:in block (2 levels) in top_level' /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2029:in каждый»/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2029:in block in top_level' /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2068:in standard_exception_handling» /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2023:in top_level' /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2001:in блок в бегах ' /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2068:in standard_exception_handling' /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:1998:in беги» /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/bin/rake:31:in <top (required)>' /usr/local/bin/rake:19:in нагрузка» / usr / local / bin / rake: 19: in `'

1 Ответ

1 голос
/ 07 февраля 2010

Это странно. HAML борется с ActionView по некоторым причинам. Похоже, что HAML загружается до ActionView? Есть ли в вашем приложении какие-либо странные требования для использования HAML?

Вы пытались обновить свой гем HAML? Не могли бы вы также попытаться отключить плагин в config/environment.rb, а затем запустить задачу rake?

Если вы вообще не используете HAML, вы также можете удалить плагин из vendor/plugins.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...