views:

65

answers:

2

When I run Heroku db:migrate I get an error:

rake aborted!
no such file to load -- sqlite3
/disk1/home/slugs/313735_a606978_6916/mnt/Rakefile:4
(See full trace by running task with --trace)
(in /disk1/home/slugs/313735_a606978_6916/mnt)

When I do

heroku rake db:push

I succeed.

Do I need to install something on the Heroku server?

A: 

I'm not sure about the intricacies of the API, but the Heroku homepage shows them not using heroku db:migrate, but rather:

heroku rake db:migrate

Give that a go.

Matchu
sorry, that was a typo, should include rake of course
Per-Olof Hermansson
i.e a type here at StackOverflow, heroku rake db:migrate is what gave the error, but solution is to add gem "pg" in gemfile as the answer from Simon Carletti shows below.
Per-Olof Hermansson
heroku completely ignores your database.yml and uses postgresql. So you can put in source control and use sqlite3 locally. You do not need the "pg" gem at all, heroku provides it, so keep your Gemfile clean and remove it if not used.
Ole Morten Amundsen
@Ole: I'm not sure on that point. The Heroku docs [show including the pg gem](http://docs.heroku.com/bundler), and I'd really kinda prefer being explicit about that, anyway. Making it clear that I only want sqlite3 loaded in on development and that I only want pg on production is much better than depending on Heroku to make that happen magically.
Matchu
I know for a fact that you don't need it in the Gemfile,I wanted to make the clear, but whether or not to include it in your Gemfile anyway, is up to you. I wouldn't :)
Ole Morten Amundsen
+1  A: 

Heroku doesn't support SQLite databases. You need to use PostgreSQL on production.

group :production, :staging do
  gem "pg"
end

group :development, :test do
  gem "sqlite3-ruby", "~> 1.3.0", :require => "sqlite3"
end
Simone Carletti
WHere do I add these lines?
Per-Olof Hermansson
sorry, I realized that I should add them in the gemfile... Now it works!! Thanks!
Per-Olof Hermansson
If this answer solved the problem, you can accept it. ;)
Simone Carletti
@Per-Olof Hermansson: on StackOverflow, when an answer solves your problem, it's important to click the green check mark next to it so that the person gets credit, and so that people know that this question has already been taken care of :) Thanks!
Matchu