"heroku run rake db:migrate" issue
Asked Answered
P

2

16

Folks, I am following Ruby on Rails Tutorial and working on the DemoApp in Chapter 2. My env is :

Win 7
Ruby 1.9.3
Rails 4.0.2

I have deployed the demo app (under directory demo_app) locally and have tested it out locally as well. I did push it to Heroku using

c:\rails_projects\demo_app heroku create --stack cedar
c:\rails_projects\demo_app git push heroku master

the app gets deployed to heroku.

When I run: heroku run rake db:migrate I get the error:

No app specified. Run this command from an app folder or specify which app to use with --app APP.

I have run it with heroku run rake db:migrate --app demo_app but get the same error. Not sure what to do.

Porch answered 22/1, 2014 at 20:15 Comment(2)
I was able to migrate the DB fine. C:\rails_projects\demo_app>heroku run rake db:migrate --app sheltered-crag-4306 Running rake db:migrate attached to terminal... up, run.5397 == CreateUsers: migrating ......... When I try "heroku open --app sheltered-crag-4306" I get the following error on the browser "The page you were looking for doesn't exist. You may have mistyped the address or the page may have moved. If you are the application owner check the logs for more information." pardon me folks, if I am doing something silly. Please help.Porch
By the way, I have also tried "sheltered-crag-4306.herokuapp.com", I get the same resultPorch
S
28

Heroku will have given your app a random name when you created the app. Run heroku apps from the terminal to get the name of your app, then heroku run rake db:migrate --app your_app_name.

Selfoperating answered 22/1, 2014 at 20:43 Comment(0)
G
7

Assuming the name of your app is robot. On your terminal, heroku run rake db:migrate --app=robot

Garwin answered 29/7, 2015 at 14:24 Comment(2)
Does this push the current version of the database from my computer to Heroku? Or just the structure of the database?Shedevil
Nope, doesn't push any changes from your computer but migrate any pending migrations from your schema(assuming you integrated a version control tool to your App) to your Heroku app.Garwin

© 2022 - 2024 — McMap. All rights reserved.