无法部署 - 预编译资产失败

时间:2015-04-27 14:51:33

标签: ruby-on-rails ruby git heroku

我尝试部署到heroku,但我在heroku资产预编译时收到错误。

这是我的heroku回复:

remote: Building source:
remote: 
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.0.0
remote: -----> Installing dependencies using 1.7.12
remote:        Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote:        Fetching source index from https://rubygems.org/
remote:        Installing CFPropertyList 2.3.1
remote:        Installing rake 10.4.2
remote:        Installing i18n 0.7.0
remote:        Installing minitest 5.6.0
remote:        Installing thread_safe 0.3.5
remote:        Installing builder 3.2.2
remote:        Installing erubis 2.7.0
remote:        Installing mini_portile 0.6.2
remote:        Installing mime-types 2.4.3
remote:        Installing rack 1.6.0
remote:        Installing arel 6.0.0
remote:        Installing addressable 2.3.8
remote:        Installing cancancan 1.10.1
remote:        Installing json 1.8.2
remote:        Installing coffee-script-source 1.9.1.1
remote:        Installing execjs 2.5.2
remote:        Installing thor 0.19.1
remote:        Installing extlib 0.9.16
remote:        Installing multi_json 1.11.0
remote:        Installing multipart-post 2.0.0
remote:        Installing retriable 1.4.1
remote:        Installing jwt 1.4.1
remote:        Installing hashie 3.4.1
remote:        Installing bcrypt 3.1.10
remote:        Using bundler 1.7.12
remote:        Installing mini_magick 4.1.0
remote:        Installing oauth 0.4.7
remote:        Installing tilt 1.4.1
remote:        Installing buftok 0.2.0
remote:        Installing sass 3.4.13
remote:        Installing equalizer 0.0.11
remote:        Installing naught 1.0.0
remote:        Installing simple_oauth 0.3.1
remote:        Installing excon 0.45.1
remote:        Installing formatador 0.2.5
remote:        Installing ipaddress 0.8.0
remote:        Installing net-ssh 2.9.2
remote:        Installing http_parser.rb 0.6.0
remote:        Installing inflecto 0.0.2
remote:        Installing fission 0.5.0
remote:        Installing faker 1.4.3
remote:        Installing tzinfo 1.2.2
remote:        Installing memoizable 0.4.2
remote:        Installing mail 2.6.3
remote:        Installing rack-test 0.6.3
remote:        Installing sprockets 3.0.2
remote:        Installing launchy 2.4.3
remote:        Installing rdoc 4.2.0
remote:        Installing coffee-script 2.4.1
remote:        Installing uglifier 2.7.1
remote:        Installing figaro 1.0.0
remote:        Installing autoparse 0.3.3
remote:        Installing faraday 0.9.1
remote:        Installing omniauth 1.2.2
remote:        Installing net-scp 1.2.1
remote:        Installing http 0.6.4
remote:        Installing activesupport 4.2.0
remote:        Installing sdoc 0.4.1
remote:        Installing signet 0.6.0
remote:        Installing faraday_middleware 0.9.1
remote:        Installing koala 1.10.1
remote:        Installing omniauth-oauth 1.1.0
remote:        Installing fog-core 1.30.0
remote:        Installing twitter 5.14.0
remote:        Installing rails-deprecated_sanitizer 1.0.3
remote:        Installing globalid 0.3.5
remote:        Installing activemodel 4.2.0
remote:        Installing jbuilder 2.2.12
remote:        Installing google-api-client 0.8.2
remote:        Installing instagram 1.1.3
remote:        Installing omniauth-twitter 1.1.0
remote:        Installing fog-json 1.0.1
remote:        Installing fog-local 0.2.1
remote:        Installing fog-vmfusion 0.1.0
remote:        Installing activejob 4.2.0
remote:        Installing pg 0.18.1
remote:        Installing nokogiri 1.6.6.2
remote:        Installing carrierwave 0.10.0
remote:        Installing activerecord 4.2.0
remote:        Installing fog-brightbox 0.7.1
remote:        Installing fog-serverlove 0.1.2
remote:        Installing fog-sakuracloud 1.0.1
remote:        Installing rails-dom-testing 1.0.6
remote:        Installing fog-storm_on_demand 0.1.1
remote:        Installing loofah 2.0.1
remote:        Installing fog-xml 0.1.2
remote:        Installing rails-html-sanitizer 1.0.2
remote:        Installing fog-atmos 0.1.0
remote:        Installing fog-ecloud 0.1.1
remote:        Installing fog-softlayer 0.4.3
remote:        Installing fog-powerdns 0.1.1
remote:        Installing fog-profitbricks 0.0.2
remote:        Installing fog-radosgw 0.0.4
remote:        Installing fog-terremark 0.1.0
remote:        Installing fog-riakcs 0.1.0
remote:        Installing fog-aws 0.1.2
remote:        Installing fog-voxel 0.1.0
remote:        Installing actionview 4.2.0
remote:        Installing actionpack 4.2.0
remote:        Installing actionmailer 4.2.0
remote:        Installing railties 4.2.0
remote:        Installing sprockets-rails 2.2.4
remote:        Installing coffee-rails 4.1.0
remote:        Installing font-awesome-rails 4.3.0.0
remote:        Installing jquery-rails 4.0.3
remote:        Installing jquery-ui-rails 5.0.3
remote:        Installing sass-rails 5.0.3
remote:        Installing turbolinks 2.5.3
remote:        Installing rails 4.2.0
remote:        Installing adminpanel 2.5.3
remote:        Installing fog 1.29.0
remote:        Your bundle is complete!
remote:        Gems in the groups development and test were not installed.
remote:        It was installed into ./vendor/bundle
remote:        Post-install message from rdoc:
remote:        Depending on your version of ruby, you may need to install ruby rdoc/ri data:
remote:        <= 1.8.6 : unsupported
remote:        = 1.8.7 : gem install rdoc-data; rdoc-data --install
remote:        = 1.9.1 : gem install rdoc-data; rdoc-data --install
remote:        >= 1.9.2 : nothing to do! Yay!
remote:        Post-install message from instagram:
remote:        ********************************************************************************
remote:        Instagram REST and Search APIs
remote:        ------------------------------
remote:        Our developer site documents all the Instagram REST and Search APIs.
remote:        (http://instagram.com/developer)
remote:        Blog
remote:        ----------------------------
remote:        The Developer Blog features news and important announcements about the Instagram Platform.
remote:        You will also find tutorials and best practices to help you build great platform integrations.
remote:        Make sure to subscribe to the RSS feed so you don't miss out on new posts:
remote:        (http://developers.instagram.com).
remote:        Community
remote:        ----------------------
remote:        The Stack Overflow community is a great place to ask API related questions or if you need help with your code.
remote:        Make sure to tag your questions with the Instagram tag to get fast answers from other fellow developers and members of the Instagram team.
remote:        (http://stackoverflow.com/questions/tagged/instagram/)
remote:        ********************************************************************************
remote:        Bundle completed (109.77s)
remote:        Cleaning up the bundler cache.
remote: -----> Preparing app for Rails asset pipeline
remote:        Running: rake assets:precompile
remote:        rake aborted!
remote:        Errno::ENOENT: No such file or directory - /tmp/build_7d3929292b517e061ef9a6c0570a0e8d/tmp/cache/
remote:        /tmp/build_7d3929292b517e061ef9a6c0570a0e8d/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.0/lib/active_support/cache/file_store.rb:30:in `open'
remote:        /tmp/build_7d3929292b517e061ef9a6c0570a0e8d/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.0/lib/active_support/cache/file_store.rb:30:in `entries'
remote:        /tmp/build_7d3929292b517e061ef9a6c0570a0e8d/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.0/lib/active_support/cache/file_store.rb:30:in `clear'
remote:        /tmp/build_7d3929292b517e061ef9a6c0570a0e8d/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.0/lib/active_support/cache/strategy/local_cache.rb:79:in `clear'
remote:        /tmp/build_7d3929292b517e061ef9a6c0570a0e8d/vendor/bundle/ruby/2.0.0/gems/adminpanel-2.5.3/config/initializers/adminpanel/clear_cache.rb:2:in `<top (required)>'
remote:        /tmp/build_7d3929292b517e061ef9a6c0570a0e8d/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:268:in `load'
remote:        /tmp/build_7d3929292b517e061ef9a6c0570a0e8d/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:268:in `block in load'
remote:        /tmp/build_7d3929292b517e061ef9a6c0570a0e8d/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `load_dependency'
remote:        /tmp/build_7d3929292b517e061ef9a6c0570a0e8d/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:268:in `load'
remote:        /tmp/build_7d3929292b517e061ef9a6c0570a0e8d/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0/lib/rails/engine.rb:652:in `block in load_config_initializer'
remote:        /tmp/build_7d3929292b517e061ef9a6c0570a0e8d/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.0/lib/active_support/notifications.rb:166:in `instrument'
remote:        /tmp/build_7d3929292b517e061ef9a6c0570a0e8d/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0/lib/rails/engine.rb:651:in `load_config_initializer'
remote:        /tmp/build_7d3929292b517e061ef9a6c0570a0e8d/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>'
remote:        /tmp/build_7d3929292b517e061ef9a6c0570a0e8d/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0/lib/rails/engine.rb:615:in `each'
remote:        /tmp/build_7d3929292b517e061ef9a6c0570a0e8d/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0/lib/rails/engine.rb:615:in `block in <class:Engine>'
remote:        /tmp/build_7d3929292b517e061ef9a6c0570a0e8d/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0/lib/rails/initializable.rb:30:in `instance_exec'
remote:        /tmp/build_7d3929292b517e061ef9a6c0570a0e8d/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0/lib/rails/initializable.rb:30:in `run'
remote:        /tmp/build_7d3929292b517e061ef9a6c0570a0e8d/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0/lib/rails/initializable.rb:55:in `block in run_initializers'
remote:        /tmp/build_7d3929292b517e061ef9a6c0570a0e8d/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0/lib/rails/initializable.rb:44:in `each'
remote:        /tmp/build_7d3929292b517e061ef9a6c0570a0e8d/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0/lib/rails/initializable.rb:44:in `tsort_each_child'
remote:        /tmp/build_7d3929292b517e061ef9a6c0570a0e8d/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0/lib/rails/initializable.rb:54:in `run_initializers'
remote:        /tmp/build_7d3929292b517e061ef9a6c0570a0e8d/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0/lib/rails/application.rb:352:in `initialize!'
remote:        /tmp/build_7d3929292b517e061ef9a6c0570a0e8d/config/environment.rb:5:in `<top (required)>'
remote:        /tmp/build_7d3929292b517e061ef9a6c0570a0e8d/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
remote:        /tmp/build_7d3929292b517e061ef9a6c0570a0e8d/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `block in require'
remote:        /tmp/build_7d3929292b517e061ef9a6c0570a0e8d/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `load_dependency'
remote:        /tmp/build_7d3929292b517e061ef9a6c0570a0e8d/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
remote:        /tmp/build_7d3929292b517e061ef9a6c0570a0e8d/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0/lib/rails/application.rb:328:in `require_environment!'
remote:        /tmp/build_7d3929292b517e061ef9a6c0570a0e8d/vendor/bundle/ruby/2.0.0/gems/railties-4.2.0/lib/rails/application.rb:443:in `block in run_tasks_blocks'
remote:        /tmp/build_7d3929292b517e061ef9a6c0570a0e8d/vendor/bundle/ruby/2.0.0/gems/sprockets-rails-2.2.4/lib/sprockets/rails/task.rb:64:in `block (2 levels) in define'
remote:        Tasks: TOP => environment
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 empaquesnova.
remote: 

我也尝试在本地预编译,然后推送到heroku,但我得到相同的响应。

提前致谢。

2 个答案:

答案 0 :(得分:0)

您是否已将'rails_12factor'gem添加到您的gemfile中?如果没有添加以下内容:

gem 'rails_12factor', group: :production

参考:Rails 4 Asset Pipeline on Heroku

答案 1 :(得分:0)

我终于找到了解决方案,它是有线的。我在.keep创建了一个/tmp/cache/文件,并将以下代码添加到我的.gitignore文件中,它神奇地工作了。

/tmp/*
!/tmp/cache/
/tmp/cache/*
!/tmp/cache/.keep