轨道3:试图访问基本_form.html.erb当“文件类型阳明不知道”(Rails 3: '

2019-11-04 00:39发布

我试着写了一个非常基本的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'

任何想法是怎么回事? 区域设置/ 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 %>

任何想法非常赞赏 - 我完全难倒。

Answer 1:

万一有人有同样的问题:

我忘了我在RVM运行红宝石前,似乎最新的1.9.3预曾与YAML解释的问题。 我恢复了该项目1.9.2发布候选版本(如果它应该已经摆在首位),一切都解决了。 希望这可以帮助。 ;-)



文章来源: Rails 3: 'The file type yml is not known' when trying to access basic _form.html.erb