[英]Ruby on Rails App assets not loading HTTP 404
Estimatemyproject.com在紅寶石上運行已超過2年,沒有任何問題。 但是就在今天,它停止加載資產。 我在網上搜索並嘗試
rake assets:precompile --trace RAILS_ENV=production
但是失敗了:
root@emp:/home/emp/current# rake assets:precompile --trace RAILS_ENV=production
rake aborted!
/home/emp/emp/releases/20160127092918/config/application.rb:7: syntax error, unexpected ':', expecting ')'
Bundler.require(*Rails.groups(assets: %w(development test)))
^
/home/emp/emp/releases/20160127092918/config/application.rb:7: syntax error, unexpected ')', expecting kEND
Bundler.require(*Rails.groups(assets: %w(development test)))
^
/home/emp/emp/releases/20160127092918/config/application.rb:60: syntax error, unexpected $end, expecting kEND
/home/emp/emp/releases/20160127092918/Rakefile:5:in `require'
/home/emp/emp/releases/20160127092918/Rakefile:5
/usr/lib/ruby/vendor_ruby/rake/rake_module.rb:25:in `load'
/usr/lib/ruby/vendor_ruby/rake/rake_module.rb:25:in `load_rakefile'
/usr/lib/ruby/vendor_ruby/rake/application.rb:501:in `raw_load_rakefile'
/usr/lib/ruby/vendor_ruby/rake/application.rb:82:in `load_rakefile'
/usr/lib/ruby/vendor_ruby/rake/application.rb:133:in `standard_exception_handling'
/usr/lib/ruby/vendor_ruby/rake/application.rb:81:in `load_rakefile'
/usr/lib/ruby/vendor_ruby/rake/application.rb:65:in `run'
/usr/lib/ruby/vendor_ruby/rake/application.rb:133:in `standard_exception_handling'
/usr/lib/ruby/vendor_ruby/rake/application.rb:63:in `run'
/usr/bin/rake:27
請幫我調試一下! 需要資產以某種方式重新加載或刷新緩存。
謝謝!
我嘗試使用建議的更改游戲:
現在給我一個不同的錯誤。
耙子流產了!
no such file to load -- rubygems
/home/emp/emp/releases/20160127092918/config/boot.rb:1:in `require'
/home/emp/emp/releases/20160127092918/config/boot.rb:1
/home/emp/emp/releases/20160127092918/config/application.rb:1:in `require'
/home/emp/emp/releases/20160127092918/config/application.rb:1
/home/emp/emp/releases/20160127092918/Rakefile:5:in `require'
/home/emp/emp/releases/20160127092918/Rakefile:5
/usr/lib/ruby/vendor_ruby/rake/rake_module.rb:25:in `load'
/usr/lib/ruby/vendor_ruby/rake/rake_module.rb:25:in `load_rakefile'
/usr/lib/ruby/vendor_ruby/rake/application.rb:501:in `raw_load_rakefile'
/usr/lib/ruby/vendor_ruby/rake/application.rb:82:in `load_rakefile'
/usr/lib/ruby/vendor_ruby/rake/application.rb:133:in `standard_exception_handling'
/usr/lib/ruby/vendor_ruby/rake/application.rb:81:in `load_rakefile'
/usr/lib/ruby/vendor_ruby/rake/application.rb:65:in `run'
/usr/lib/ruby/vendor_ruby/rake/application.rb:133:in `standard_exception_handling'
/usr/lib/ruby/vendor_ruby/rake/application.rb:63:在`run'中/ usr / bin / rake:27
您在config/application.rb
第7行中遇到語法錯誤。
似乎您使用的是不支持冒號哈希語法的舊版Ruby。 更改此:
Bundler.require(*Rails.groups(assets: %w(development test)))
至:
Bundler.require(*Rails.groups(:assets => %w(development test)))
修復該問題並重新部署您的應用程序,然后重新運行rake命令。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.