将部署Rails应用程序部署到Heroku的麻烦

时间:2016-05-02 22:33:25

标签: ruby ruby-on-rails-4 heroku

更具体地说,我在提取Heroku日志时遇到H10错误,“在Heroku上运行rails控制台时没有这样的文件加载 - 撬(LoadError)”。

Rails应用在localhost上正常运行。我已经浏览了我的所有应用程序文件,删除了对"要求''"以及任何对" binding.pry&#34的调用的引用;。 Heroku不应该在生产中运行pry-railspry-nav宝石。我重新运行bundle install,在本地和Heroku上重置我的数据库,确保我的代码在这些调整后被推高,并重置了Heroku上的dynos。

是什么给出了?

heroku日志

2016-05-02T21:45:04.892586+00:00 heroku[router]: at=error code=H10 
desc="App crashed" method=GET path="/" host=chess-workout-andrew-smith.herokuapp.com request_id=f05db461-e4ef-48e4-b920-6b5163fa0ea2 fwd="69.156.77.15" dyno= connect= service= status=503 bytes=

2016-05-02T21:45:05.175027+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=chess-workout-andrew-smith.herokuapp.com request_id=fdbd387c-63fa-49e7-8d2c-e94f36558356 fwd="69.156.77.15" dyno= connect= service= status=503 bytes=

heroku run rails c

/app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.0.1/lib/active_support/values/time_zone.rb:282: warning: circular argument reference - now
/app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `require': No such file to load -- pry (LoadError)
/app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.0.1/lib/active_support/values/time_zone.rb:282: warning: circular argument reference - now
/app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `require': No such file to load -- pry (LoadError)
    from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `block in require'
    from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:214:in `load_dependency'
    from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `require'
    from /app/app/controllers/pieces_controller.rb:1:in `<top (required)>'
    from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `require'
    from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `block in require'
    from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:214:in `load_dependency'
    from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `require'
    from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:330:in `require_or_load'
    from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:289:in `depend_on'
    from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:207:in `require_dependency'
    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.0.1/lib/rails/engine.rb:465:in `block (2 levels) in eager_load!'
    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.0.1/lib/rails/engine.rb:464:in `each'
    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.0.1/lib/rails/engine.rb:464:in `block in eager_load!'
    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.0.1/lib/rails/engine.rb:462:in `each'
    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.0.1/lib/rails/engine.rb:462:in `eager_load!'
    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.0.1/lib/rails/engine.rb:347:in `eager_load!'
    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.0.1/lib/rails/application/finisher.rb:56:in `each'
    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.0.1/lib/rails/application/finisher.rb:56:in `block in <module:Finisher>'
    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.0.1/lib/rails/initializable.rb:30:in `instance_exec'
    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.0.1/lib/rails/initializable.rb:30:in `run'
    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.0.1/lib/rails/initializable.rb:55:in `block in run_initializers'
    from /app/vendor/ruby-2.2.4/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
    from /app/vendor/ruby-2.2.4/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
    from /app/vendor/ruby-2.2.4/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
    from /app/vendor/ruby-2.2.4/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
    from /app/vendor/ruby-2.2.4/lib/ruby/2.2.0/tsort.rb:345:in `each'
    from /app/vendor/ruby-2.2.4/lib/ruby/2.2.0/tsort.rb:345:in `call'
    from /app/vendor/ruby-2.2.4/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
    from /app/vendor/ruby-2.2.4/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
    from /app/vendor/ruby-2.2.4/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.0.1/lib/rails/initializable.rb:54:in `run_initializers'
    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.0.1/lib/rails/application.rb:215:in `initialize!'
    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.0.1/lib/rails/railtie/configurable.rb:30:in `method_missing'
    from /app/config/environment.rb:5:in `<top (required)>'
    from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `require'
    from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `block in require'
    from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:214:in `load_dependency'
    from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `require'
    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.0.1/lib/rails/application.rb:189:in `require_environment!'
    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.0.1/lib/rails/commands.rb:61:in `<top (required)>'
    from /app/bin/rails:4:in `require'
    from /app/bin/rails:4:in `<main>'

的Gemfile:

source 'https://rubygems.org'

gem 'simple_form'

gem 'rails', '4.0.1'

gem 'pg'

gem 'sass-rails', '~> 4.0.0'

gem 'uglifier', '>= 1.3.0'

gem 'coffee-rails', '~> 4.0.0'

gem 'rails_12factor', group: :production

gem 'jquery-rails'

gem 'turbolinks'

gem 'jbuilder', '~> 1.2'

gem 'pry-rails', :group => :development

gem 'pry-nav', :group => :development

gem 'awesome_print', :group => :development

group :development, :test do
gem 'rspec-rails', '~> 3.0'
end

group :doc do
  gem 'sdoc', require: false
end

gem 'bootstrap-sass', '~> 3.3.4.1'

gem 'sprockets', '<= 2.11.0'

gem "devise"

gem "factory_girl_rails", "~> 4.0"

的database.yml

development:  
  adapter: postgresql  
  encoding: unicode  
  database: chess_workout_development  
  pool: 5  
  username: postgres  
  password: password  
  host: localhost  


test:  
  adapter: postgresql  
  encoding: unicode  
  database: chess_workout_test  
  pool: 5  
  username: postgres  
  password: password  
  host: localhost  

production:  
  adapter: postgresql  
  encoding: unicode  
  database: chess_workout_production  
  pool: 5  
  username: postgres  
  password: password  
  host: localhost  

1 个答案:

答案 0 :(得分:0)

来自heroku run rails console的错误日志表示没有pry。在Gemfile中,pry仅用于开发环境,即使我非常确定需要“撬开”。在控制器文件中设置,以便heroku混淆。

您可以在Gemfile中删除:group => :development中的撬,并且不要忘记heroku run bundle install