【问题标题】:no implicit conversion of nil into String没有将 nil 隐式转换为 String
【发布时间】:2013-04-16 18:04:38
【问题描述】:

目前我正在尝试在 Ruby on Rails 中设置一个简单的应用程序。我已经迁移了数据库,为其播种,现在陷入以下错误。

no implicit conversion of nil into String

Extracted source (around line #4):

1: <!--[if lt IE 9]>
2: <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
3: <![endif]-->
4: <%= stylesheet_link_tag 'blueprint/screen', :media => 'screen' %>
5: <%= stylesheet_link_tag 'blueprint/print',  :media => 'print' %>
6: <%= stylesheet_link_tag 'custom', :media => 'screen' %>

资产标签助手似乎无法正常工作或返回 nil(如果可能的话)?

【问题讨论】:

    标签: css ruby-on-rails stylesheet-link-tag


    【解决方案1】:

    我通过将以下行添加到我的 application.rb 来修复此错误:

    ActionController::Base.config.relative_url_root = ''
    

    这个错误很可能是由于我的 rails 版本 3.0.12 中的一个错误。

    【讨论】:

    猜你喜欢
    • 2016-02-14
    • 2016-11-25
    • 1970-01-01
    • 1970-01-01
    • 2019-02-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多