2016-01-13 85 views
0

我對此進行了廣泛搜索,並看到上述錯誤的許多實例。Git推送到heroku錯誤:推送被拒絕,未能編譯Ruby應用程序

這可能是由任何/許多事情引起的,我所看到的是最有可能在追蹤中找到的原因。

但是,我不知道什麼可能導致我自己的錯誤,即使從跟蹤。

我注意到的事情,然而,這是行:

SocketError: getaddrinfo: Name or service not known 

這在我的理解有連接到資源聯機失敗的事情。在這種情況下,這個資源是什麼,我不知道。

PS: this has been working on previous pushes. (Previous pushes to this repo has been with no glitch)

下面是顯示錯誤的日誌跟蹤部分。

remote:  Bundle completed (61.86s) 
remote:  Cleaning up the bundler cache. 
remote: -----> Preparing app for Rails asset pipeline 
remote:  Running: rake assets:precompile 
remote:  rake aborted! 
remote:  SocketError: getaddrinfo: Name or service not known 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/redis-3.2.1/lib/redis/connection/ruby.rb:152:in `getaddrinfo' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/redis-3.2.1/lib/redis/connection/ruby.rb:152:in `connect' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/redis-3.2.1/lib/redis/connection/ruby.rb:211:in `connect' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/redis-3.2.1/lib/redis/client.rb:322:in `establish_connection' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/redis-3.2.1/lib/redis/client.rb:94:in `block in connect' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/redis-3.2.1/lib/redis/client.rb:279:in `with_reconnect' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/redis-3.2.1/lib/redis/client.rb:93:in `connect' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/redis-3.2.1/lib/redis/client.rb:350:in `ensure_connected' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/redis-3.2.1/lib/redis/client.rb:207:in `block in process' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/redis-3.2.1/lib/redis/client.rb:292:in `logging' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/redis-3.2.1/lib/redis/client.rb:206:in `process' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/redis-3.2.1/lib/redis/client.rb:112:in `call' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/redis-3.2.1/lib/redis.rb:1320:in `block in smembers' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/redis-3.2.1/lib/redis.rb:37:in `block in synchronize' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/redis-3.2.1/lib/redis.rb:37:in `synchronize' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/redis-3.2.1/lib/redis.rb:1319:in `smembers' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/flipper-redis-0.7.0/lib/flipper/adapters/redis.rb:26:in `features' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/flipper-0.7.0/lib/flipper/adapters/instrumented.rb:36:in `block in features' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/flipper-0.7.0/lib/flipper/instrumenters/noop.rb:5:in `instrument' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/flipper-0.7.0/lib/flipper/adapters/instrumented.rb:35:in `features' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/flipper-0.7.0/lib/flipper/adapters/memoizable.rb:28:in `features' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/flipper-0.7.0/lib/flipper/dsl.rb:230:in `features 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/config/initializers/flipper.rb:10:in `<top (required)>' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:268:in `load' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:268:in `block in load' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:240:in `load_dependency' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:268:in `load' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/railties-4.2.2/lib/rails/engine.rb:652:in `block in load_config_initializer' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.2/lib/active_support/notifications.rb:166:in `instrument' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/railties-4.2.2/lib/rails/engine.rb:651:in `load_config_initializer' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/railties-4.2.2/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/railties-4.2.2/lib/rails/engine.rb:615:in `each' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/railties-4.2.2/lib/rails/engine.rb:615:in `block in <class:Engine>' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/railties-4.2.2/lib/rails/initializable.rb:30:in `instance_exec' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/railties-4.2.2/lib/rails/initializable.rb:30:in `run' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/railties-4.2.2/lib/rails/initializable.rb:55:in `block in run_initializers' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/railties-4.2.2/lib/rails/initializable.rb:44:in `each' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/railties-4.2.2/lib/rails/initializable.rb:44:in `tsort_each_child' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/railties-4.2.2/lib/rails/initializable.rb:54:in `run_initializers' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/railties-4.2.2/lib/rails/application.rb:352:in `initialize!' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/config/environment.rb:5:in `<top (required)>' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:274:in `require' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:274:in `block in require' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:240:in `load_dependency' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:274:in `require' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/railties-4.2.2/lib/rails/application.rb:328:in `require_environment!' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/railties-4.2.2/lib/rails/application.rb:457:in `block in run_tasks_blocks' 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/sprockets-rails-2.3.1/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 oge-resilience-staging. 
remote: 
To [email protected]:*****' 
! [remote rejected] dev -> master (pre-receive hook declined) 
error: failed to push some refs to '[email protected]:*****' 

flipper.rb

require 'flipper/adapters/redis' 

flipper_redis_options = {} 
flipper_redis_options[:url] = ENV['BOXEN_REDIS_URL'] || ENV['REDISCLOUD_URL'] 
flipper_redis_client = Redis.new(flipper_redis_options) 
flipper_adapter = Flipper::Adapters::Redis.new(flipper_redis_client) 

FLIPPER = Flipper.new(flipper_adapter) 

unless FLIPPER.features.to_a.detect{|feature| feature.name == "resilience_enabled" } 
    FLIPPER[:resilience_enabled].disable 
end 

我會想明白的問題是在這裏什麼,以及如何去做。謝謝。

+0

你在config/initializers/flipper.rb中有什麼代碼?特別是第10行。 – Arjan

+0

用我的'config/initializers/flipper.rb?'文件更新了問題。 –

回答

2
remote:  SocketError: getaddrinfo: Name or service not known 
remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/vendor/bundle/ruby/2.0.0/gems/redis-3.2.1/lib/redis/connection/ruby.rb:152:in `getaddrinfo' 

它看起來像您的應用程序試圖連接到Redis的在下面的初始化

remote:  /tmp/build_96c4b997594af6741a41839fe335a90a/config/initializers/flipper.rb:10:in `<top (required)>' 

但Redis的服務器不可用(或無效)。

+0

好的,謝謝。所以在這種情況下,前進的道路是什麼? –

+1

您需要修復連接配置並確保您使用的是有效的Redis實例。 –

+0

配置中的問題很可能是您的heroku服務器上沒有設置環境變量:ENV ['BOXEN_REDIS_URL']'或'ENV ['REDISCLOUD_URL']'。 – Arjan

相關問題