Note that there are some explanatory texts on larger screens.

plurals
  1. POHeroku won't recognize 'pg' gem in my Rails app Gemfile
    primarykey
    data
    text
    <p>I'm still a relative newbie to Ruby on Rails, and I'm a complete newbie with Heroku.</p> <p>I've set up my Rails app to use postgres instead of sqlite3, both in development and in production, and I've put "gem 'pg'" in my Gemfile. And locally, my app is working just fine.</p> <p>Making it work on Heroku is a different story. After I've pushed my app to Heroku, when I type in "heroku run rake db:migrate", it tells me, "rake aborted! Specified 'postgresql' for database adapter, but the gem is not loaded. Add <code>gem 'pg'</code> to your Gemfile."</p> <p>Yes, <code>gem 'pg'</code> is in my Gemfile, but I'm still getting this error.</p> <p>What gives?</p> <p>Here's what my Gemfile looks like right now:</p> <pre><code>source 'https://rubygems.org' ruby '2.0.0' gem 'rails', '4.0.1' gem 'pg' group :assets do end gem 'bcrypt-ruby', '~&gt; 3.1.2' gem 'haml' gem 'devise', '3.0.0.rc' gem 'protected_attributes' gem 'sass-rails', '4.0.1' gem 'uglifier', '2.1.1' gem 'coffee-rails', '4.0.1' gem 'jquery-rails', '3.0.4' gem 'turbolinks', '1.1.1' gem 'jbuilder', '1.0.2' gem 'knockout-rails' # To use ActiveModel has_secure_password # gem 'bcrypt-ruby', '~&gt; 3.0.0' # To use Jbuilder templates for JSON # gem 'jbuilder' # Use unicorn as the app server # gem 'unicorn' # Deploy with Capistrano # gem 'capistrano' # To use debugger # gem 'debugger' group :doc do gem 'sdoc', '0.3.20', require: false end group :production do gem 'unicorn' gem 'rails_12factor', '0.0.2' end </code></pre> <p>Here's what my database.yml is like:</p> <pre><code>development: adapter: postgresql encoding: unicode database: financemeter pool: 5 password: test: adapter: postgresql encoding: unicode database: financemeter pool: 5 timeout: 5000 production: adapter: postgresql database: dbe67fgdnnqg88 pool: 5 timeout: 5000 user: njatxlpjjrzfoe password: HULxOtPALAk4FnzZe-_737TvPc </code></pre> <p>And here are the full error logs when I try to migrate on heroku. (Again, locally I'm fine. I'm working locally on a MacBook if that matters.)</p> <pre><code>/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/connection_adapters/connection_specification.rb:58:in `rescue in resolve_hash_connection' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/connection_adapters/connection_specification.rb:55:in `resolve_hash_connection' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/connection_adapters/connection_specification.rb:46:in `resolve_string_connection' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/connection_adapters/connection_specification.rb:32:in `spec' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/connection_handling.rb:39:in `establish_connection' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/railtie.rb:176:in `block (2 levels) in &lt;class:Railtie&gt;' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/lazy_load_hooks.rb:28:in `block in on_load' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/lazy_load_hooks.rb:27:in `each' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/lazy_load_hooks.rb:27:in `on_load' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/railtie.rb:174:in `block in &lt;class:Railtie&gt;' /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.1/lib/rails/initializable.rb:30:in `instance_exec' /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.1/lib/rails/initializable.rb:30:in `run' /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.1/lib/rails/initializable.rb:55:in `block in run_initializers' /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.1/lib/rails/initializable.rb:54:in `run_initializers' /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.1/lib/rails/application.rb:215:in `initialize!' /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.1/lib/rails/railtie/configurable.rb:30:in `method_missing' /app/config/environment.rb:5:in `&lt;top (required)&gt;' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `require' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `block in require' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:214:in `load_dependency' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `require' /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.1/lib/rails/application.rb:189:in `require_environment!' /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.1/lib/rails/application.rb:250:in `block in run_tasks_blocks' </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload