Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ruby-on-rails-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 轨道3:x27;文件类型yml未知';尝试访问basic _form.html.erb时_Ruby On Rails_Ruby On Rails 3_Yaml - Fatal编程技术网

Ruby on rails 轨道3:x27;文件类型yml未知';尝试访问basic _form.html.erb时

Ruby on rails 轨道3:x27;文件类型yml未知';尝试访问basic _form.html.erb时,ruby-on-rails,ruby-on-rails-3,yaml,Ruby On Rails,Ruby On Rails 3,Yaml,我正在尝试编写一个非常基本的rails应用程序,但每当我编写最简单的表单时,都会出现以下错误: I18n::UnknownFileType in Posts#add Showing /home/john/Websites/sandbox/rails-messing/app/views/posts/_form.html.erb where line #14 raised: can not load translations from /usr/local/rvm/gems/ruby-head

我正在尝试编写一个非常基本的rails应用程序,但每当我编写最简单的表单时,都会出现以下错误:

 I18n::UnknownFileType in Posts#add

Showing /home/john/Websites/sandbox/rails-messing/app/views/posts/_form.html.erb where line #14 raised:

can not load translations from /usr/local/rvm/gems/ruby-head/gems/activesupport-3.0.0.beta4/lib/active_support/locale/en.yml, the file type yml is not known

Extracted source (around line #14):

11:     <% end %>
12: 
13:     <div class='field'>
14:         <%= f.label :title %><br />
15:         <%= f.text_field :title %>
16:     </div>
17: <% end %>

Trace of template inclusion: app/views/posts/add.html.erb

Rails.root: /home/john/Websites/sandbox/rails-messing
Application Trace | Framework Trace | Full Trace

app/views/posts/_form.html.erb:14:in `block in _render_template__2621936652101774794_37048540__1740943893204605353'
app/views/posts/_form.html.erb:1
app/views/posts/add.html.erb:1
app/controllers/posts_controller.rb:27:in `add'
I18n::帖子中的未知文件类型#添加
显示/home/john/Websites/sandbox/rails messing/app/views/posts/_form.html.erb,其中第14行出现:
无法从/usr/local/rvm/gems/ruby head/gems/activesupport-3.0.0.beta4/lib/active\u support/locale/en.yml加载翻译,文件类型yml未知
提取的源(第14行附近):
11:     
12: 
13:     
14:
15: 16: 17: 模板包含跟踪:app/views/posts/add.html.erb root:/home/john/Websites/sandbox/Rails-messing 应用程序跟踪|框架跟踪|完整跟踪 app/views/posts/_form.html.erb:14:in'block in_render_template__2621936652101774794_37048540_1740943893204605353' app/views/posts/_form.html.erb:1 app/views/posts/add.html.erb:1 app/controllers/posts_controller.rb:27:in'add'
知道发生了什么事吗?locale/en.yml文件在那里&未触及。安装的其余部分似乎工作正常。表单只是脚手架生成的基本内容。具体而言:

<%= form_for(@post) do |f| %>
    <% if @post.errors.any? %>
        <div id='error_messages'>
            <h2><%= pluralize(@post.errors.count, "error") %> prevented this form from being saved:</h2>
            <ul>
                <% @post.errors.full_messages.each do |msg| %>
                    <li><%= msg %></li>
                <% end %>
            </ul>
        </div>
    <% end %>

    <div class='field'>
        <%= f.label :title %><br />
        <%= f.text_field :title %>
    </div>
<% end %>

已阻止保存此表单:


任何值得赞赏的想法-我完全被难住了。

以防有人有同样的问题:


我忘了我在RVM中运行ruby pre,而最新的1.9.3 pre似乎与YAML解释器有问题。我将项目恢复到1.9.2版本候选版本(它本来应该在这里),所有问题都解决了。希望这有帮助。;-)

谢谢你回来贴这个:)没有什么比谷歌搜索错误和找到答案更好的了!