Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I keep getting an error while trying to deploy my app to a Digital Ocean Droplet using Capistrano's cap production deploy. The error message I get says:

rake aborted!
Gem::LoadError: Specified 'postgresql' for database adapter, but the gem is not loaded.
Add `gem 'pg'` to your Gemfile

but my Gemfile does include pg in production:

...
group :production do 
  gem 'rails_12factor'
  gem 'pg'  
end
...

What can be causing this?

New Development:

I tried resetting the db adapter back to sqlite3, just to see whether the deployment would go through, and got the same error:

Gem::LoadError: Specified 'sqlite3' for database adapter, but the gem is not loaded. Add `gem 'sqlite3'` to your Gemfile
share|improve this question
    
Has you run bundle install and committed the changes in Gemfile and Gemfile.lock? –  Prakash Murthy Mar 31 at 22:57
    
I can only run it locally. I tried creating a Gemfile locally, and installing it. I also tried installing the pg gem by itself. The gem gets installed without a problem, but I still get the error message. –  Dimitry_N Apr 1 at 1:07
    
What about the second part of my question - committing the changes to Gemfile & Gemfile.lock? If the code being deployed doesn't have the updated Gemfile.lock, it is likely to throw this error. –  Prakash Murthy Apr 1 at 1:31
    
@PrakashMurthy you mean running the bundle locally? –  Dimitry_N Apr 1 at 1:36
    
Yes. If you are using capistrano, these steps are to be done locally. –  Prakash Murthy Apr 1 at 1:37

1 Answer 1

It turned out to be a known bug for Win users. In your Gemfile.lock, change

sqlite3 (1.3.10-x86-mingw32)

to

sqlite3 (1.3.10-x64-mingw32)

I did it directly in my repo because each time I made this change locally and ran bundle install, the x64 flag kept getting switched back.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.