耙子流产了!写admin.css后没有这样的文件或目录

时间:2014-03-06 11:02:23

标签: css ruby-on-rails amazon-ec2 sprockets precompile

我使用Capistrano

将rails代码部署到EC2

但我在跑步时遇到了同样的问题

cd -- /home/stage_deployer/urbox/releases/20140306102215 && RAILS_ENV=staging RAILS_GROUPS=assets bundle exec rake assets:precompile 

以下是我在EC2调试的命令

stage_deployer@ip-172-31-5-59:~/urbox/releases/test$ RAILS_ENV=staging RAILS_GROUPS=assets 

以下是日志

bundle exec rake assets:precompile --trace
** Invoke assets:precompile (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
I, [2014-03-06T10:33:54.388029 #11702]  INFO -- : ** [Raven] Raven 0.6.0 ready to catch errors
AssetSync: using /home/stage_deployer/test/releases/test/config/initializers/asset_sync.rb
** Execute assets:precompile
...
...
I, [2014-03-06T10:34:04.551896 #11702]  INFO -- : Writing /home/stage_deployer/urbox/releases/test/public/assets/admin.js
I, [2014-03-06T10:34:04.553847 #11702]  INFO -- : Writing /home/stage_deployer/urbox/releases/test/public/assets/application.js
I, [2014-03-06T10:34:04.554514 #11702]  INFO -- : Writing /home/stage_deployer/urbox/releases/test/public/assets/ckeditor/config.js
I, [2014-03-06T10:34:04.554819 #11702]  INFO -- : Writing /home/stage_deployer/urbox/releases/test/public/assets/admin.css
rake aborted!
No such file or directory - /home/stage_deployer/urbox/releases/test/public/assets/admin-c503a9b1f76de48a2717d7ff8581fe74.css
/usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/fileutils.rb:1551:in `stat'
/usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/fileutils.rb:1551:in `block in fu_each_src_dest'
/usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/fileutils.rb:1567:in `fu_each_src_dest0'
/usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/fileutils.rb:1549:in `fu_each_src_dest'
/usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/fileutils.rb:393:in `cp'
/home/stage_deployer/urbox/shared/bundle/ruby/2.0.0/gems/non-stupid-digest-assets-1.0.0/lib/non-stupid-digest-assets.rb:10:in `block in compile_with_non_digest'
/home/stage_deployer/urbox/shared/bundle/ruby/2.0.0/gems/non-stupid-digest-assets-1.0.0/lib/non-stupid-digest-assets.rb:6:in `each'
/home/stage_deployer/urbox/shared/bundle/ruby/2.0.0/gems/non-stupid-digest-assets-1.0.0/lib/non-stupid-digest-assets.rb:6:in `compile_with_non_digest'
/home/stage_deployer/urbox/shared/bundle/ruby/2.0.0/gems/sprockets-rails-2.0.1/lib/sprockets/rails/task.rb:60:in `block (3 levels) in define'
/home/stage_deployer/urbox/shared/bundle/ruby/2.0.0/gems/sprockets-2.10.1/lib/rake/sprocketstask.rb:146:in `with_logger'
/home/stage_deployer/urbox/shared/bundle/ruby/2.0.0/gems/sprockets-rails-2.0.1/lib/sprockets/rails/task.rb:59:in `block (2 levels) in define'
/home/stage_deployer/urbox/shared/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/task.rb:236:in `call'
/home/stage_deployer/urbox/shared/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/task.rb:236:in `block in execute'
/home/stage_deployer/urbox/shared/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/task.rb:231:in `each'
/home/stage_deployer/urbox/shared/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/task.rb:231:in `execute'
/home/stage_deployer/urbox/shared/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/task.rb:175:in `block in invoke_with_call_chain'
/usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/home/stage_deployer/urbox/shared/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/task.rb:168:in `invoke_with_call_chain'
/home/stage_deployer/urbox/shared/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/task.rb:161:in `invoke'
/home/stage_deployer/urbox/shared/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:149:in `invoke_task'
/home/stage_deployer/urbox/shared/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/home/stage_deployer/urbox/shared/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:106:in `each'
/home/stage_deployer/urbox/shared/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:106:in `block in top_level'
/home/stage_deployer/urbox/shared/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:115:in `run_with_threads'
/home/stage_deployer/urbox/shared/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:100:in `top_level'
/home/stage_deployer/urbox/shared/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:78:in `block in run'
/home/stage_deployer/urbox/shared/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
/home/stage_deployer/urbox/shared/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:75:in `run'
/home/stage_deployer/urbox/shared/bundle/ruby/2.0.0/gems/rake-10.1.0/bin/rake:33:in `<top (required)>'
/home/stage_deployer/urbox/shared/bundle/ruby/2.0.0/bin/rake:23:in `load'
/home/stage_deployer/urbox/shared/bundle/ruby/2.0.0/bin/rake:23:in `<main>'
Tasks: TOP => assets:precompile

我尝试在 vender / stylesheets / crumble / grumble.min.css vender / stylesheets / crumble / crumble.css下添加一些crumble.js资源后发生此问题

grumble.min.css https://github.com/tommoor/crumble/blob/master/css/grumble.min.css crumble.css https://github.com/tommoor/crumble/blob/master/css/crumble.css

请帮帮我~~

我尝试运行

rake assets:precompile 

在本地机器上,但没有出现任何问题

这是我的admin.css

/*
 *= require twitter/bootstrap
 *= require select2
 *= require bootstrap-editable
 *= require unicorn.main
 *= require unicorn.grey
 *= require jquery.ui.datepicker
 *= require_self
*/

.sortable-item {
  background: white;
  border-radius: 5px;
  border: 1px solid #b5b5b5;
  border-bottom-width: 2px;
  background-image: none;
  margin: 0 0 3px 0;
  padding: 0;
  cursor: pointer;
  padding: 8px 8px 8px 30px;
  list-style: none;
}

td.center { text-align: center; }

1 个答案:

答案 0 :(得分:1)

您应该更新non-stupid-asset-digest宝石。

现在版本为1.0.4,并且在丢失文件的情况下有更好的错误处理。这样您就可以上网了。

一旦您启动并运行,您就可以查看日志/文件系统并调查为什么没有生成某些摘要。

让我知道这是否有帮助。