预编译资产失败并且 rake 中止
Precompiling assets failed and rake aborted
您好,我尝试将 ruby 上的 rails 应用程序部署到 heroku,这是我的错误
remote: Tasks: TOP => assets:precompile
remote: (See full trace by running task with --trace)
remote: !
remote: ! Precompiling assets failed.
remote: !
remote:
remote: ! Push rejected, failed to compile Ruby app
remote:
remote: Verifying deploy....
remote:
remote: ! Push rejected to whispering-peak-4064.
remote:
To https://git.heroku.com/whispering-peak-4064.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/whispering-peak-4064.git'
我在这里看到了很多解决方案,我尝试 运行 这些命令:
RAILS_ENV=production bundle exec rake assets:precompile
rake asset:precompile
我的 rake 中止了!
我按照这里找到的一些答案添加到我的 config\application.rb
:
require 'sprockets/railtie'
config.assets.initialize_on_precompile = false
但是我仍然有同样的问题。
PS: 我正在使用 Rails 4.2.5
我认为这一行导致了你的错误:
.clearfix:before, .clearfix:after { content: : " "; display: table; }
应该是
.clearfix:before, .clearfix:after { content: " "; display: table; }
您好,我尝试将 ruby 上的 rails 应用程序部署到 heroku,这是我的错误
remote: Tasks: TOP => assets:precompile
remote: (See full trace by running task with --trace)
remote: !
remote: ! Precompiling assets failed.
remote: !
remote:
remote: ! Push rejected, failed to compile Ruby app
remote:
remote: Verifying deploy....
remote:
remote: ! Push rejected to whispering-peak-4064.
remote:
To https://git.heroku.com/whispering-peak-4064.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/whispering-peak-4064.git'
我在这里看到了很多解决方案,我尝试 运行 这些命令:
RAILS_ENV=production bundle exec rake assets:precompile
rake asset:precompile
我的 rake 中止了!
我按照这里找到的一些答案添加到我的 config\application.rb
:
require 'sprockets/railtie'
config.assets.initialize_on_precompile = false
但是我仍然有同样的问题。
PS: 我正在使用 Rails 4.2.5
我认为这一行导致了你的错误:
.clearfix:before, .clearfix:after { content: : " "; display: table; }
应该是
.clearfix:before, .clearfix:after { content: " "; display: table; }