Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/64.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 Heroku Rails 4资源未加载 部署后,我得到以下错误消息_Ruby On Rails_Ruby On Rails 4_Heroku_Deployment_Asset Pipeline - Fatal编程技术网

Ruby on rails Heroku Rails 4资源未加载 部署后,我得到以下错误消息

Ruby on rails Heroku Rails 4资源未加载 部署后,我得到以下错误消息,ruby-on-rails,ruby-on-rails-4,heroku,deployment,asset-pipeline,Ruby On Rails,Ruby On Rails 4,Heroku,Deployment,Asset Pipeline,这是我的目录 我的应用程序.rb 这里,我怎么称呼他们 <%= stylesheet_link_tag "home" %> <%= javascript_include_tag "home" %> <img class="client" src="<%= asset_path('b.png') %>"> 解决了的 错误在scss.erb文件中。他们不能正确调用帮助程序,如image\u-tag或asset\u-path 在我的应用程序中有很

这是我的目录

我的应用程序.rb

这里,我怎么称呼他们

<%= stylesheet_link_tag "home" %>
<%= javascript_include_tag "home" %>

<img class="client" src="<%= asset_path('b.png') %>">
解决了的 错误在
scss.erb
文件中。他们不能正确调用帮助程序,如
image\u-tag
asset\u-path

在我的应用程序中有很多scss.erb文件,比如bellow

错误

background: url(<%= image_path 'fake_slider.png' %>) no-repeat 0 0;

您必须在生产配置文件中添加此配置:
config.serve\u static\u assets=true
并检查您是否已将gem rails\u 12factor添加到gemfile是的,我有gem rails\u 12factor和config.serve\u static\u assets=true。heroru运行rake assets:precompile是否有效?你能检查一下你的公用文件夹是否已提交吗?阿尔瓦罗,我解决了。答案是贝娄。谢谢你的关注。
background: url(<%= image_path 'fake_slider.png' %>) no-repeat 0 0;
background: url("<%= image_path 'fake_slider.png' %>") no-repeat 0 0;