繁体   English   中英

Ruby on Rails应用程序资产未加载HTTP 404

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM