无法部署。 Heroku仪表板显示"最新版本失败"

时间:2016-02-16 23:33:35

标签: ruby-on-rails heroku github web-deployment github-for-windows

Screenshot of error message on Heroku dashboard.

这里是日志(我对此非常陌生,所以我在下半部分修改了一些看似私密的内容):

-----> Using set buildpack heroku/ruby
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.1.5
###### WARNING:
       Removing `Gemfile.lock` because it was generated on Windows.
       Bundler will do a full resolve so native gems are handled properly.
       This may result in unexpected gem versions being used in your app.
       In rare occasions Bundler may not be able to resolve your dependencies at all.
       https://devcenter.heroku.com/articles/bundler-windows-gemfile
-----> Installing dependencies using bundler 1.9.7
       Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4
       Your Gemfile lists the gem rest-client (>= 0) more than once.
       You should probably keep only one of them.
       While it's not a problem now, it could cause errors if you change the version of just one of them later.
       Fetching gem metadata from http://rubygems.org/...........
       Fetching version metadata from http://rubygems.org/...
       Fetching dependency metadata from http://rubygems.org/..
       Resolving dependencies.....
       Using rake 10.5.0
       Using i18n 0.7.0
       Using json 1.8.3
       Using minitest 5.8.4
       Using thread_safe 0.3.5
       Using builder 3.2.2
       Using erubis 2.7.0
       Using mini_portile2 2.0.0
       Using rack 1.6.4
       Using mime-types 2.99
       Using arel 6.0.3
       Using acts_as_follower 0.2.1
       Using acts_as_votable 0.10.0
       Using httpclient 2.7.1
       Using aws_cf_signer 0.1.3
       Using unf_ext 0.0.7.2
       Using netrc 0.11.0
       Using bundler 1.9.7
       Using thor 0.19.1
       Using concurrent-ruby 1.0.0
       Using bcrypt 3.1.10
       Using coffee-script-source 1.10.0
       Using execjs 2.6.0
       Using orm_adapter 0.5.0
       Using elo 0.1.0
       Using exception_handler 0.4.7
       Using geocoder 1.3.0
       Using gmaps4rails 2.1.2
       Using gravtastic 3.2.6
       Using tilt 2.0.2
       Using hashie 3.4.3
       Using high_voltage 2.2.1
       Using imgkit 1.6.1
       Using multi_json 1.11.2
       Using kgio 2.10.0
       Using libv8 3.16.14.13
       Using newrelic_rpm 3.14.3.313
       Using pg 0.18.4
       Using pusher-signature 0.1.8
       Using rack-cors 0.4.0
       Using rails_serve_static_assets 0.0.5
       Using rails_stdout_logging 0.0.4
       Using raindrops 0.15.0
       Using rdiscount 2.1.8
       Using redcarpet 3.3.4
       Using ref 2.0.0
       Using sass 3.4.21
       Using rack-test 0.6.3
       Using warden 1.2.6
       Using mail 2.6.3
       Using nokogiri 1.6.7.2
       Using algoliasearch 1.7.0
       Using unf 0.1.4
       Using tzinfo 1.2.2
       Using coffee-script 2.4.1
       Using uglifier 2.7.2
       Using haml 4.0.7
       Using omniauth 1.3.1
       Using sprockets 3.5.2
       Using rollbar 1.4.5
       Using pusher 0.16.0
       Using rails_12factor 0.0.3
       Using unicorn 5.0.1
       Using therubyracer 0.12.2
       Using loofah 2.0.3
       Using impressionist 1.5.1
       Using algoliasearch-rails 1.14.1
       Using domain_name 0.5.20160128
       Using activesupport 4.2.1
       Using rails-html-sanitizer 1.0.3
       Using http-cookie 1.0.2
       Using rails-deprecated_sanitizer 1.0.3
       Using globalid 0.3.6
       Using activemodel 4.2.1
       Using carmen 1.0.2
       Using jbuilder 2.4.1
       Using rest-client 1.8.0
       Using activejob 4.2.1
       Using activerecord 4.2.1
       Using rails-dom-testing 1.0.7
       Using cloudinary 1.1.2
       Using friendly_id 5.1.0
       Using actionview 4.2.1
       Using actionpack 4.2.1
       Using actionmailer 4.2.1
       Using railties 4.2.1
       Using sprockets-rails 3.0.1
       Using simple_form 3.2.1
       Using rails 4.2.1
       Using momentjs-rails 2.11.0
       Using coffee-rails 4.1.1
       Using jquery-rails 4.1.0
       Using responders 2.1.1
       Using public_activity 1.4.2
       Using sass-rails 5.0.4
       Using attachinary 1.3.1
       Using carmen-rails 1.0.1
       Using rails_autolink 1.1.6
       Using bootstrap3-datetimepicker-rails 4.7.14
       Using turbolinks 2.5.3
       Using commontator 4.10.5
       Using devise 3.5.6
       Using devise_token_auth 0.1.37
       Installing dalli 2.7.6
       Bundle complete! 53 Gemfile dependencies, 104 gems now installed.
       Gems in the groups development and test were not installed.
       Bundled gems are installed into ./vendor/bundle.
       Bundle completed (6.84s)
       Cleaning up the bundler cache.
       Your Gemfile lists the gem rest-client (>= 0) more than once.
       You should probably keep only one of them.
       While it's not a problem now, it could cause errors if you change the version of just one of them later.
       Removing dalli (2.7.5)
-----> Preparing app for Rails asset pipeline
       Running: rake assets:precompile
       rake aborted!
       NoMethodError: undefined method `setup' for ExceptionHandler:Module

   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/config/initializers/exception_handler.rb:6:in `<top (required)>'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `load'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `block in load'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_dependency'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `load'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:652:in `block in load_config_initializer'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_support/notifications.rb:166:in `instrument'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:651:in `load_config_initializer'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:615:in `each'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:615:in `block in <class:Engine>'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `instance_exec'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `run'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:55:in `block in run_initializers'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:44:in `each'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:44:in `tsort_each_child'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:54:in `run_initializers'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/application.rb:352:in `initialize!'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/config/environment.rb:5:in `<top (required)>'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `block in require'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_dependency'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/application.rb:328:in `require_environment!'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/application.rb:457:in `block in run_tasks_blocks'
   /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/sprockets-rails-3.0.1/lib/sprockets/rails/task.rb:62:in `block (2 levels) in define'

       Tasks: TOP => environment
       (See full trace by running task with --trace)
 !
 !     Precompiling assets failed.
 !
 !     Push rejected, failed to compile Ruby app

感谢所有帮助

编辑:

这是新的构建日志:

-----> Using set buildpack heroku/ruby
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.1.5
###### WARNING:
       Removing `Gemfile.lock` because it was generated on Windows.
       Bundler will do a full resolve so native gems are handled properly.
       This may result in unexpected gem versions being used in your app.
       In rare occasions Bundler may not be able to resolve your dependencies at all.
       https://devcenter.heroku.com/articles/bundler-windows-gemfile
-----> Installing dependencies using bundler 1.9.7
       Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4
       Your Gemfile lists the gem rest-client (>= 0) more than once.
       You should probably keep only one of them.
       While it's not a problem now, it could cause errors if you change the version of just one of them later.
       Fetching gem metadata from http://rubygems.org/...........
       Fetching version metadata from http://rubygems.org/...
       Fetching dependency metadata from http://rubygems.org/..
       Resolving dependencies.....
       Using rake 10.5.0
       Using i18n 0.7.0
       Using json 1.8.3
       Using minitest 5.8.4
       Using thread_safe 0.3.5
       Using builder 3.2.2
       Using erubis 2.7.0
       Using mini_portile2 2.0.0
       Using rack 1.6.4
       Using arel 6.0.3
       Using acts_as_follower 0.2.1
       Using acts_as_votable 0.10.0
       Using httpclient 2.7.1
       Using aws_cf_signer 0.1.3
       Using unf_ext 0.0.7.2
       Using netrc 0.11.0
       Using bundler 1.9.7
       Using thor 0.19.1
       Using concurrent-ruby 1.0.0
       Using bcrypt 3.1.10
       Using coffee-script-source 1.10.0
       Using execjs 2.6.0
       Using orm_adapter 0.5.0
       Using elo 0.1.0
       Using exception_handler 0.4.7
       Installing mime-types 2.99.1
       Using gmaps4rails 2.1.2
       Using gravtastic 3.2.6
       Using tilt 2.0.2
       Using hashie 3.4.3
       Using high_voltage 2.2.1
       Using imgkit 1.6.1
       Using multi_json 1.11.2
       Using kgio 2.10.0
       Using libv8 3.16.14.13
       Installing dalli 2.7.6
       Using pg 0.18.4
       Using pusher-signature 0.1.8
       Using rack-cors 0.4.0
       Using rails_serve_static_assets 0.0.5
       Using rails_stdout_logging 0.0.4
       Using raindrops 0.15.0
       Using rdiscount 2.1.8
       Using redcarpet 3.3.4
       Using ref 2.0.0
       Using sass 3.4.21
       Using tzinfo 1.2.2
       Using nokogiri 1.6.7.2
       Using rack-test 0.6.3
       Using warden 1.2.6
       Using algoliasearch 1.7.0
       Using unf 0.1.4
       Using sprockets 3.5.2
       Using coffee-script 2.4.1
       Using uglifier 2.7.2
       Using mail 2.6.3
       Using haml 4.0.7
       Using omniauth 1.3.1
       Using rollbar 1.4.5
       Installing geocoder 1.3.1
       Using rails_12factor 0.0.3
       Using unicorn 5.0.1
       Using therubyracer 0.12.2
       Using activesupport 4.2.1
       Using loofah 2.0.3
       Using impressionist 1.5.1
       Using algoliasearch-rails 1.14.1
       Installing domain_name 0.5.20160216
       Using rails-deprecated_sanitizer 1.0.3
       Using globalid 0.3.6
       Using activemodel 4.2.1
       Using carmen 1.0.2
       Using jbuilder 2.4.1
       Using rails-html-sanitizer 1.0.3
       Using http-cookie 1.0.2
       Using rails-dom-testing 1.0.7
       Using activejob 4.2.1
       Using activerecord 4.2.1
       Using rest-client 1.8.0
       Using actionview 4.2.1
       Using friendly_id 5.1.0
       Using cloudinary 1.1.2
       Using actionpack 4.2.1
       Using actionmailer 4.2.1
       Using railties 4.2.1
       Installing pusher 0.17.0
       Using simple_form 3.2.1
       Using momentjs-rails 2.11.0
       Using coffee-rails 4.1.1
       Using jquery-rails 4.1.0
       Using responders 2.1.1
       Installing sprockets-rails 3.0.2
       Using bootstrap3-datetimepicker-rails 4.7.14
       Using turbolinks 2.5.3
       Using devise 3.5.6
       Using rails 4.2.1
       Using sass-rails 5.0.4
       Using attachinary 1.3.1
       Using carmen-rails 1.0.1
       Using commontator 4.10.5
       Using devise_token_auth 0.1.37
       Using rails_autolink 1.1.6
       Installing public_activity 1.4.3
       Installing newrelic_rpm 3.15.0.314
       Bundle complete! 53 Gemfile dependencies, 104 gems now installed.
       Gems in the groups development and test were not installed.
       Bundled gems are installed into ./vendor/bundle.
       Bundle completed (7.39s)
       Cleaning up the bundler cache.
       Your Gemfile lists the gem rest-client (>= 0) more than once.
       You should probably keep only one of them.
       While it's not a problem now, it could cause errors if you change the version of just one of them later.
       Removing public_activity (1.4.2)
       Removing domain_name (0.5.20160128)
       Removing pusher (0.16.0)
       Removing mime-types (2.99)
       Removing dalli (2.7.5)
       Removing newrelic_rpm (3.14.3.313)
       Removing sprockets-rails (3.0.1)
       Removing geocoder (1.3.0)
-----> Preparing app for Rails asset pipeline
       Running: rake assets:precompile
       rake aborted!
       NoMethodError: undefined method `setup' for ExceptionHandler:Module
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/config/initializers/exception_handler.rb:6:in `<top (required)>'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `load'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `block in load'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_dependency'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `load'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:652:in `block in load_config_initializer'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_support/notifications.rb:166:in `instrument'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:651:in `load_config_initializer'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:615:in `each'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:615:in `block in <class:Engine>'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `instance_exec'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `run'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:55:in `block in run_initializers'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:44:in `each'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:44:in `tsort_each_child'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:54:in `run_initializers'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/application.rb:352:in `initialize!'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/config/environment.rb:5:in `<top (required)>'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `block in require'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_dependency'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/application.rb:328:in `require_environment!'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/railties-4.2.1/lib/rails/application.rb:457:in `block in run_tasks_blocks'
       /tmp/build_(REDACTED IN CASE IT IS PRIVATE)/vendor/bundle/ruby/2.1.0/gems/sprockets-rails-3.0.2/lib/sprockets/rails/task.rb:62:in `block (2 levels) in define'
       Tasks: TOP => environment
       (See full trace by running task with --trace)
 !
 !     Precompiling assets failed.
 !
 !     Push rejected, failed to compile Ruby app

2 个答案:

答案 0 :(得分:1)

来自Heroku docs

  

这意味着您的应用程序正在尝试作为rake资产的一部分连接到数据库:预编译。由于环境中不存在配置变量,因此我们使用占位符DATABASE_URL来满足Rails。

要解决此问题,请确保config/application.rb中显示以下行:

# config/application.rb
config.assets.initialize_on_precompile = false

添加后,提交您的更改并重新部署到Heroku - 您的资产应该在没有您的应用程序尝试连接到数据库的情况下编译,这应该可以解决您目睹的错误。

<强>更新

your stacktrace的第46行包含以下消息:Devise.secret_key was not set.

According致Devise的作者José Valim,可以通过以下方式解决此问题:

  

请将以下内容添加到您的Devise初始化程序中:

     

config.secret_key =&#39; - 密钥 - &#39;

the following solution似乎适用于多个用户:

  

我去了我的routes.rb文件并注释掉了devise_for:installs

这一行      

然后我回去并重新设计了rails generate:install。如果这不起作用,请使用以前版本的设计,编辑Gemfile对Devise的引用,如下所示:gem&#39; devise&#39;,&#39; 3.0.3&#39;然后按照我上面提到的步骤操作。

请查看https://stackoverflow.com/a/19650687/1380867并谢谢 zeantsoi获得此答案

答案 1 :(得分:1)

我做了ExceptionHandler,这似乎导致了问题......

  

NoMethodError:ExceptionHandler:Module

的未定义方法`setup'

ExceptionHandler > 0.4.5中,initializer已被config方法取代:

enter image description here

来自docs

  

重要

     

如果您要升级到0.4.6,则需要删除exception_handler初始化程序。

     

我们已将加载过程更改为使用Rails应用配置 - 您不再需要exception_handler初始值设定项

您需要exception_handler复制config/initializers/exception_handler.rb设置并将其放入config/production.rb

您需要删除 config/initializers/exception_handler.rb

-

如果您发表评论等我可以聊天