Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"heroku run rails db:migrate" fails on Windows 10 #621

Open
ciarancumiskey opened this issue Jun 5, 2017 · 4 comments
Open

"heroku run rails db:migrate" fails on Windows 10 #621

ciarancumiskey opened this issue Jun 5, 2017 · 4 comments

Comments

@ciarancumiskey
Copy link

ciarancumiskey commented Jun 5, 2017

Hi, I'm following your Installfest guide and I'm trying to deploy my first Ruby on Rails app to Heroku. However, I've hit a wall when it comes to migrating the database, and this seems to be the issue:
Gem::LoadError: Specified 'sqlite3' for database adapter, but the gem is not loaded. Add gem 'sqlite3' to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).

The Gemfiles are apparently disregarded because they were edited on Windows. What can I do?

@jnicho02
Copy link

jnicho02 commented Jul 5, 2017

Heroku won't do sqlite, only (mainly) postgres. Set the production environment to pg in your Gemfile

group :development, :test do
  # Use sqlite3 as the database for Active Record
  gem 'sqlite3'
end
group :production do
  gem 'pg'
  gem 'rails_12factor'
end

@jnicho02
Copy link

jnicho02 commented Jul 5, 2017

It does actually say this is the tutorial now https://shielded-mesa-4358.herokuapp.com/intro-to-rails/deploying_to_heroku in Step 2, so issue could be closed

@mjibrower
Copy link

I got the same error message, and tried this solution. Unfortunately, it didn't work for me, and the tutorial here: http://docs.railsbridge.org/installfest/deploy_a_rails_app hasn't been changed yet, so I'm adding the solution that did work for me to this thread.

Following this Stack Overflow post: https://stackoverflow.com/questions/48201361/rails-application-using-postgres-adapter-cant-activate-pg, I added the minimum version of the pg gem to the Gemfile, like this:

group :production do
  gem 'pg', '~> 0.18'
  
end

And that worked. :-)

@jeanettehead
Copy link

Fixed in this pull request: #632

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants