title: How can I run rails console in Heroku? Rails 5.1 and postgresql
body: <p>I've been following along with a tutorial for a Rails app. The tutorial is based on Rails 5 and I am using Rails 5.1.2. Everything works great locally and pushed to heroku with no problems. However, when I went to create an admin user on the production database by running:</p>
  
  <pre><code>$ heroku run rails c
  </code></pre>
  
  <p>it returns the following error:</p>
  
  <blockquote>
    <p>/app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.3/lib/active_support/dependencies.rb:292:in <code>require': cannot load such file -- rack/handler/c (LoadError)   from
    /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.3/lib/active_support/dependencies.rb:292:in</code>block in require'   from
    /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.3/lib/active_support/dependencies.rb:258:in <code>load_dependency'    from
    /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.3/lib/active_support/dependencies.rb:292:in</code>require'    from
    /app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/handler.rb:74:in
    <code>try_require'     from
    /app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/handler.rb:16:in
    </code>get'     from
    /app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/server.rb:301:in
    <code>server'  from
    /app/vendor/bundle/ruby/2.4.0/gems/railties-5.1.3/lib/rails/commands/server/server_command.rb:68:in
    </code>print_boot_information'  from
    /app/vendor/bundle/ruby/2.4.0/gems/railties-5.1.3/lib/rails/commands/server/server_command.rb:38:in
    <code>start'   from
    /app/vendor/bundle/ruby/2.4.0/gems/railties-5.1.3/lib/rails/commands/server/server_command.rb:131:in
    </code>block in perform'    from
    /app/vendor/bundle/ruby/2.4.0/gems/railties-5.1.3/lib/rails/commands/server/server_command.rb:126:in
    <code>tap'     from
    /app/vendor/bundle/ruby/2.4.0/gems/railties-5.1.3/lib/rails/commands/server/server_command.rb:126:in
    </code>perform'     from
    /app/vendor/bundle/ruby/2.4.0/gems/thor-0.20.0/lib/thor/command.rb:27:in
    <code>run'     from
    /app/vendor/bundle/ruby/2.4.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in
    </code>invoke_command'  from
    /app/vendor/bundle/ruby/2.4.0/gems/thor-0.20.0/lib/thor.rb:387:in
    <code>dispatch'    from
    /app/vendor/bundle/ruby/2.4.0/gems/railties-5.1.3/lib/rails/command/base.rb:63:in
    </code>perform'     from
    /app/vendor/bundle/ruby/2.4.0/gems/railties-5.1.3/lib/rails/command.rb:44:in
    <code>invoke'  from
    /app/vendor/bundle/ruby/2.4.0/gems/railties-5.1.3/lib/rails/commands.rb:16:in
    </code>'    from bin/rails:9:in <code>require'   from bin/rails:9:in
    </code>'`</p>
  </blockquote>
  
  <p>To get around this I can run:</p>
  
  <pre><code>$ heroku run bash
  $ rails c
  </code></pre>
  
  <p>and this allows me to update the production database. While this works and gets me what I need. I want to know why the original command doesn't work. I have searched everywhere for an answer and can't come up with anything that applies to me. I am trying to improve my developing skills and would like to understand why the original problem won't work. </p>
  
  <p>I can add any files anyone needs to see, but I don't even know which ones would be relevant to this problem.</p>