2

I have an application on Heroku. However, whenever I change my database locally and then push the changes to the application, the database doesn't not change.

I realized that I need to run a rake on the Heroku database. However when I try heroku rake db:migrate I get the following error.

rake aborted! uninitialized constant Rake::DSL`

How do I solve this problem?

I've been improvising with heroku db:push, but that will not be able to hold because it deletes the current database.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Vasseurth
  • 6,354
  • 12
  • 53
  • 81

4 Answers4

2

If you are using the new Cedar Stack, you should use

heroku run rake db:migrate
Juanda
  • 1,648
  • 1
  • 20
  • 29
  • How do you move from default stack to cedar? – Vasseurth Jul 15 '11 at 20:09
  • I don't know if that's possible, as far as I know you should create a new application with something like: heroku create --stack cedar and then push your git repo to it. I also had some problems with my Gemfile. This one https://gist.github.com/040c2e18ef8708a30bf4 worked so far for me on the Cedar stack. – Juanda Jul 21 '11 at 19:19
1

Use:

heroku rake db:version

Source:

http://devcenter.heroku.com/articles/rake

Swift
  • 13,118
  • 5
  • 56
  • 80
0

Append w/ "heroku" or just type "heroku" in your terminal for instructions

heroku rake db:migrate 
eggie5
  • 1,920
  • 18
  • 25
0

Your error for rake aborted! Uninitialized constant Rake::DSL is probably down to rake versions - see Stack Overflow question Ruby on Rails and Rake problems: uninitialized constant Rake::DSL for a fix.

Community
  • 1
  • 1
John Beynon
  • 37,398
  • 8
  • 88
  • 97