Rails3 dynamic_form插件无法识别? [英] Rails3 dynamic_form plugin not recognized?

查看:102
本文介绍了Rails3 dynamic_form插件无法识别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Ruby 1.9.2和Rails 3-

尝试使用<%= error_messages_for 'story' %>时出现此错误:

DEPRECATION WARNING: error_messages_for was removed from Rails and is now available as a plugin. Please install it with `rails plugin install git://github.com/rails/dynamic_form.git`. (called from _app_views_stories_new_html_erb__1042605186_33967248__100840187 at C:/Ruby192/shovell/app/views/stories/new.html.erb:1) 

所以我按照它说的做了,然后运行了插件安装.但是,现在我在vendor/plugins处有一个空的dynamic_form文件夹.我没有运气就尝试使用http而不是git.我还在网址末尾添加了/,该名称可用于其他在线用户,但没有运气.

我将gem dynamic_form添加到Gemfile,将require "dynamic_form"添加到application.rb,然后重新运行bundle install.它表明dynamic_form-1.1.3已安装到`lib/ruby​​/gems/1.9.1/gems/',但我仍然遇到相同的错误.

解决方案

解决方案正如Jeremy指出的那样,只需在github上下载rails/dynamic_form并将其解压缩到vendor/plugins并重命名文件夹"dynamic_form"即可.之前它对我不起作用的原因是,因为我使用的是动态格式的其他人的修改版,当然也没有指定它.

Using Ruby 1.9.2 and Rails 3 -

When attempting to use <%= error_messages_for 'story' %> I get this error:

DEPRECATION WARNING: error_messages_for was removed from Rails and is now available as a plugin. Please install it with `rails plugin install git://github.com/rails/dynamic_form.git`. (called from _app_views_stories_new_html_erb__1042605186_33967248__100840187 at C:/Ruby192/shovell/app/views/stories/new.html.erb:1) 

So I did what it said and ran the plugin install. However now I have an empty dynamic_form folder at vendor/plugins. I tried using http instead of git with no luck. I also added a / at the end of the URL which worked for someone else online, but with no luck.

I added gem dynamic_form to the Gemfile and require "dynamic_form" to the application.rb as well as rerun bundle install. It shows that dynamic_form-1.1.3 is installed to `lib/ruby/gems/1.9.1/gems/' but I am still getting the same error.

解决方案

The solution was as Jeremy pointed out, to simply download rails/dynamic_form on github and extract it to vendor/plugins and rename the folder "dynamic_form". The reason it didn't work for me before was because I was using someone else's modified version of dynamic form and of course not specifying it.

这篇关于Rails3 dynamic_form插件无法识别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆