Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Andrew Smith
Andrew Smith
14,330 Points

Trouble with Deployment of a Rails App to Heroku

More specifically, I am getting an H10 error when pulling up heroku logs, “No such file to load — pry (LoadError)” when running the rails console on Heroku.

The Rails app runs fine on localhost. I've scoured all of my application's files to remove references to "require 'pry'", and any calls to "binding.pry". The 'pry-rails' and 'pry-nav' gems should not be running in production on Heroku. I've rerun "bundle install", reset my databases both locally and on Heroku, ensured my code was pushed up after these adjustments, and have reset the dynos on Heroku.

What gives?

heroku logs

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)

    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 ru%

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
Andrew Rady
Andrew Rady
20,880 Points

I'm not sure if this is the issue but are you still using the sqlite database rails uses by default? I know Heroku doesn't support sqlite

Andrew Smith
Andrew Smith
14,330 Points

I am using postgres in development (locally), and from the above settings in database.yml, postgres should be running in production on Heroku.

1 Answer

Andrew Smith
Andrew Smith
14,330 Points

Upgrading from Rails 4.0.1 to Rails 4.0.9 seemed to clear up the problem.