Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"heroku run rake db:migrate" issue

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.

like image 536
user3221045 Avatar asked Jan 22 '14 20:01

user3221045


People also ask

How do I run a specific rail in migration?

To run a specific migration up or down, use db:migrate:up or db:migrate:down . The version number in the above commands is the numeric prefix in the migration's filename. For example, to migrate to the migration 20160515085959_add_name_to_users. rb , you would use 20160515085959 as the version number.


2 Answers

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.

like image 52
Mike Avatar answered Oct 18 '22 02:10

Mike


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

like image 29
Oluwayetty Avatar answered Oct 18 '22 03:10

Oluwayetty