【问题标题】:l18n::InvalidLocaleData Railsl18n::InvalidLocaleData Rails
【发布时间】:2015-01-19 17:04:43
【问题描述】:

点击网址http://localhost:3000/articles/new/时发生错误。

显示第 8 行出现的 c:/Sites/blog/app/views/articles/new.html.erb:

无法从 C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.1.8/lib/active_support/locale/en.yml 加载翻译:期望它返回一个哈希,但没有

文件 blog.html.erp

 <h1>New article</h1> 


<%= form_for :article do |f| %>
  <p>
    <%= f.label :title%><br>
    <%= f.text_field :title %>
  </p>

  <p>
    <%= f.label :text%><br>
    <%= f.text_area :text %>
  </p>

  <p>
    <%= f.submit %>
  </p>
<% end %>

控制器文章动作新。

class ArticlesController < ApplicationController
  def new
  end
end

文件配置/routes.rb

Rails.application.routes.draw do
  resource :articles
  get 'welcome/index'

导轨 4.1.8 红宝石 2.1.5 窗口 7

【问题讨论】:

    标签: ruby ruby-on-rails-4


    【解决方案1】:

    删除所有文件 C:\RailsInstaller\Ruby2.1.0\lib\ruby\gems\2.1.0\gems\activesupport-4.1.8\lib\active_support\locale\en.yml put - en:

    【讨论】:

      猜你喜欢
      • 2015-09-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-10-07
      • 1970-01-01
      相关资源
      最近更新 更多