5

I am trying to play with the postgresql db on heroku which is used by my rails app, but heroku pg returns this error message:

 !    Please specify a version along with Heroku's API MIME type.
 For example, `Accept: application/vnd.heroku+json; version=3`.

What is Heroku's API MIME type? How can I specify the right value?

Taro Kiritani
  • 724
  • 6
  • 24

4 Answers4

3

This was due to the old version of heroku toolbelt used in cloud9. This error was gone after updating heroku cli with:

wget -qO- https://cli-assets.heroku.com/install-ubuntu.sh | sh

following the discussion in https://community.c9.io/t/how-to-update-heroku-cli/12074/10 .

Taro Kiritani
  • 724
  • 6
  • 24
  • 1
    I have the latest Heroku toolbelt and I still have this message when I run a rake task on Heroku, do you know what else it could be? – JPG Jul 20 '17 at 19:19
  • I use version 8.1.4. on Windows and c9. As far as I know I did not change anything other than the cli.. – Taro Kiritani Jul 24 '17 at 11:42
  • @JPG -- check out my answer below -- you might need to uninstall / remove the old version of heroku -- try 'which heroku' and see if it is using /usr/local/bin/heroku -- if not, it's not using the latest heroku toolbelt one. – Kem Mason Aug 06 '17 at 03:37
1

I had the same problem -- there were 2 things I needed to do. From: https://devcenter.heroku.com/articles/heroku-cli

I needed to install the new Toolbelt. Instructions are included on that link, and are platform dependent, so I won't include them here. The other thing I needed to do, which I didn't realize at first after installing the toolbelt, was to make sure the heroku binary that was running was the one installed by the toolbelt.

if you run which heroku, it is supposed to return

/usr/local/bin/heroku

If it doesn't, you will need to remove the other binary, or change your path. In my case, I needed to do a gem uninstall heroku in addition to installing the toolbelt, then everything worked.

Kem Mason
  • 1,548
  • 17
  • 26
1

I have encounter the same problem with yours.
And I have just use the command as follows:

wget -qO- https://cli-assets.heroku.com/install-ubuntu.sh | sh

It's also useless.
Finally I find I forgot configure gem 'pg' in group of production in Gerfile.Just like this.

group :production do
 gem 'pg'
end

and then run

bundle install

The problem will disappear. At this time,no matter what commands such as $heroku login, $heroku --version,$heroku create you input ,there will shows nothing about erorr.



刘东东
  • 11
  • 1
0

for cloud 9 ide:

The command wget -qO- https://cli-assets.heroku.com/install-ubuntu.sh | sh did not work for me to correct MIME type error. After running the command (without the q so I could see the full output) I noticed the following failure

Failed to fetch http://linux.dropbox.com/ubuntu/dists/precise/main/binary-amd64/Packages 404 Not Found

My solution

  1. from Heroku support site instruction (Other installation methods, Standalone installation), I ran curl https://cli-assets.heroku.com/install.sh | sh (as sudo). It installed into usr/local/lib/Heroku and the app disappeared from c9 !
  2. I copied the Heroku directory from usr/local/lib to usr/lib/ (cp -r usr/loca/lib/Heroku usr/lib ) and voila!
  3. Heroku version now gives heroku/7.19.4 linux-x64 node-v11.3.0. I think it was giving Heroku 3.23 before. Looks to be working but if I run into any problems I will update (using wget command above) from this point. Hope this is of help to someone!
Ricman R
  • 13
  • 3