ruby-on-rails - 预编译 Assets 失败且 rake 中止

标签 ruby-on-rails ruby-on-rails-4 heroku ruby-on-rails-3.2 rubygems

您好,我尝试将 ruby​​ on 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=生产包执行 rake Assets :预编译
  • 提取 Assets :预编译

我的 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-on-rails - 预编译 Assets 失败且 rake 中止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34456318/

相关文章:

html - 电子邮件标记-Gmail 修改 <script> 标签以添加额外的字符串 "3D"

ruby-on-rails - 安装 Ruby 时出错

ruby-on-rails - Rails 4 View 渲染非常慢

sql - PostgreSQL 查询在本地有效,但在 Heroku 上无效(相同数据)

django - 是否可以在部署在 heroku 上的应用程序上重置 django 迁移?

ruby-on-rails - 相当于 Maven 原型(prototype)的 Ruby on Rails

ruby-on-rails - DatabaseCleaner + RSpec : what is the correct configuration?

javascript - Rails 嵌套属性 form_for for has_many 使用 javascript 无限嵌套模型

ruby - 无法加载此类文件 -- smarter_csv (LoadError)

python - 无法在 Heroku 上上传我的 Flask 应用程序