在部署heroku应用程序时,我得到推送拒绝错误(预编译资产失败) [英] When deploying heroku app I get push rejected error (Precompiling assets failed)
本文介绍了在部署heroku应用程序时,我得到推送拒绝错误(预编译资产失败)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我尝试推向heroku的应用程序: https://github.com/kunokdev/flightmap 但是我得到预编译资产失败
错误,拒绝推送... ...
log。
remote:/tmp/build_b9c70fb95f66f6b57f7d5868507a42de/vendor/bundle/ruby/2.2.0/gems/sprockets- rails-3.0.4 / lib / sprockets / rails / task.rb:67:在'block(2 levels)in define'
remote:Tasks:TOP =>资产:预编译
remote:(通过使用--trace运行任务查看完整跟踪)
remote:!
remote:!预编译资产失败。
remote:!
remote:
remote:!推送被拒绝,未能编译Ruby应用程序
remote:
remote:正在验证部署...
remote:
remote:!拒绝推送到飞行地图。
remote:
至ssh://git@heroku.com/flightmap.git
! [remote rejected] master - > master(pre-receive hook refused)
错误:未能将一些文件推送到'ssh://git@heroku.com/flightmap.git'
kunok @ Kunok:〜/ dev / flightmap $
这是我的gemfile:
source'https://rubygems.org'
gem'rails','4.2.2'
#在样式表中使用SCSS
gem'sass-rails','〜> 5.0'
#使用Uglifier作为JavaScript资源的压缩器
gem'uglifier','> = 1.3.0'
#使用jquery作为JavaScript库
gem'jquery- rails'
#Turbolinks可以更快地在您的Web应用程序中创建以下链接。阅读更多:https://github.com/rails/turbolinks
gem'turbolinks'
#轻松构建JSON API。阅读更多:https://github.com/rails/jbuilder
gem'jbuilder','〜> 2.0'
#bundle exec rake doc:rails在doc / api下生成API。
gem'sdoc','〜> 0.4.0',group::doc
#rake
gem'rake','11.1.2'
#csv reader
gem'smarter_csv'
#bower导轨
gem'bower-rails'
#角模板
gem'角钢轨模板'
#角材料
gem'rails-angular-material'
#ionicons
gem'ionicons-rails'
#获取用户位置信息
gem'geocoder'
group:development,:test do
#在代码的任何地方调用'byebug'来停止执行并获得一个调试器控制台
gem'byebug'
#使用sqlite3作为Active Record的数据库
gem'sqlite3'
结束
#Spring通过让应用程序在后台运行来加快开发速度。阅读更多:https://github.com/rails/spring
gem'spring'
group:development do
#在例外页面访问IRB控制台或使用< ;%= console%>在视图中
gem'web-console','〜> 2.0'
end
group:test do
gem'minitest-reporter','1.0.5'
gem'mini_backtrace','0.1.3'
gem'guard-minitest','2.3.1'
end
group:production do
gem'pg'
gem'rails_12factor'
end
ruby2.2.1
解决方案作为@ 7urkm3n建议的终端命令
RAILS_ENV =生产捆绑包exec rake assets:precompile
修复了这个问题。 This is app that I am trying to push on heroku: https://github.com/kunokdev/flightmap however I get Precompiling assets failed
error and Push rejected to ...
log. What might cause this?
remote: /tmp/build_b9c70fb95f66f6b57f7d5868507a42de/vendor/bundle/ruby/2.2.0/gems/sprockets-rails-3.0.4/lib/sprockets/rails/task.rb:67:in `block (2 levels) in define'
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 flightmap.
remote:
To ssh://git@heroku.com/flightmap.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'ssh://git@heroku.com/flightmap.git'
kunok@Kunok:~/dev/flightmap$
This is my gemfile:
source 'https://rubygems.org'
gem 'rails', '4.2.2'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# rake
gem 'rake', '11.1.2'
# csv reader
gem 'smarter_csv'
# bower rails
gem 'bower-rails'
# angular templates
gem 'angular-rails-templates'
# angular material
gem 'rails-angular-material'
# ionicons
gem 'ionicons-rails'
# Get user location info
gem 'geocoder'
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
end
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
group :development do
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
end
group :test do
gem 'minitest-reporters', '1.0.5'
gem 'mini_backtrace', '0.1.3'
gem 'guard-minitest', '2.3.1'
end
group :production do
gem 'pg'
gem 'rails_12factor'
end
ruby "2.2.1"
解决方案
As @7urkm3n suggested terminal command RAILS_ENV=production bundle exec rake assets:precompile
fixes the problem.
这篇关于在部署heroku应用程序时,我得到推送拒绝错误(预编译资产失败)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文