supermomonga
supermomonga

Reputation: 155

Some heroku commands couldn't find my application

I can find my apps in heroku apps command, and also do some command to read information from app like heroku addons --app appname.

But I couldn't find my apps in some command like heroku addons:add addon_name, heroku pg:reset.



Work commands

heroku apps:

=== My Apps
my_app_1
my_app_2

(Also I can see my apps in heroku web dashboard.)


heroku addons --app my_app_1(not in my_app_1 folder):

=== my_app_1 Configured Add-ons
shared-database:5mb


heroku addons(in my_app_1 folder):

=== my_app_1 Configured Add-ons
shared-database:5mb



Doesn't work commands

heroku addons:add sendgrid(in my_app_1 folder):

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


heroku pg:reset DATABASE --confirm my_app_1(in my_app_1 folder):

Resetting SHARED_DATABASE (DATABASE_URL)... failed
 !    Resource not found


Here is my environment.

Upvotes: 3

Views: 6964

Answers (3)

Gus
Gus

Reputation: 718

Adding the heroku's remote configuration to git did the trick for me. Validate if you have it configured with git remote -v on the terminal and you should get something like:

heroku  [email protected]:your-app.git (fetch)
heroku  [email protected]:your-app.git (push)

if you don't, add it with

git remote add heroku [email protected]:your-app.git

Upvotes: 1

campeterson
campeterson

Reputation: 3739

It looks like you have a conflict between the Heroku gem, and the Heroku Toolbelt. I'm guessing you have installed the Heroku Toolbelt, but still have the Heroku gem in your gem file.

  1. Remove the Heroku gem from your Gemfile and save.
  2. Run the bundle command to update your Gemfile.lock
  3. In Terminal, run gem uninstall heroku (NOTE: there may be multiple versions of the Heroku gem installed, and you'll need to uninstall all of them.)
  4. In Terminal, run heroku addons
  5. If you get heroku: command not found then you don't have the Heroku Toolbelt installed.
  6. Install the Heroku Toolbelt and run the command again.

NOTE: If you're not in the app's directory, you'll need to add --app myapp1 to the Heroku commands.

Hope this helps.

Upvotes: 0

DevL
DevL

Reputation: 136

It looks like the latest version fo the Heroku gem (2.26.5) is broken. A workaround is to downgrade to 2.26.3.

gem uninstall heroku -v 2.26.5 gem install heroku -v 2.26.3

Upvotes: 0

Related Questions