2016-11-25 113 views
0

我做了一个rails web应用程序,当我将它部署到heroku时,一切工作正常,但在线我有这些错误:ActionController :: RoutingError(没有路线匹配[GET]“/assets/star-off.png”):在rails4中,heroku

ActionController::RoutingError (No route matches [GET] "/assets/star-off.png"): 

我看着在回答类似的问题,在这里和我在production.rb改变了这个:

config.serve_static_files = true 

和我做了一个耙资产:预编译RAILS_ENV =生产

但徒劳无功。我该怎么办才能解决这个问题?

+0

请按照此步骤参考:https://devcenter.heroku.com/articles/getting-started-with-rails4 –

回答

1

试试这个

添加rails_12factor宝石到你的Gemfile github link of gem

gem 'rails_12factor', group: :production 

在终端

bundle install 

阶段安装包的更改到GitHub的

git add . 

提交更改到GitHub的

git commit -a -m "your commit message" 
git push 

推,这会更改的Heroku

git push heroku 

和你做!

干杯!

+1

谢谢你,但我已经做了所有这些说明,我仍然有问题 – nour

+0

请出示你的代码其中你正试图加载这个图片'star-off.png'。 –

相关问题