The `heroku' command exists in these Ruby versions:

不羁岁月 提交于 2019-12-07 11:49:38

问题


I'm having major issues with the heroku toolbelt. I'm using the cedar 14 stack and when I am trying to use a ruby version that isn't ruby 2.0.0-dev I get this error.

rbenv: heroku: command not found

The `heroku' command exists in these Ruby versions:
  2.0.0-dev

I need heroku to be working with ruby 1.9.3 and I don't think cedar 14 supports that version of ruby. Can someone explain first, why I am only allowed to use heroku with ruby 2.0.0-dev and also how I can install a older stack that supports ruby 1.9.3?


回答1:


The problem is that there are two heroku executables on your system: one in system paths such as /usr/local/bin/heroku (provided by Toolbelt), and one in rbenv's shims because Ruby 2.0.0-dev had "heroku" gem installed.

Because rbenv's shims directory usually have higher precedence, it will block invocation from ever executing the heroku executable provided by Toolbelt.

The solution is to uninstall any instance of "heroku" gem and relying solely on Toolbelt for all heroku usage on the command line:

for v in `rbenv whence heroku`; do RBENV_VERSION=$v gem uni heroku -ax; done
rbenv rehash
which heroku



回答2:


You can use 1.9.3 on the cedar stack according to this. The heroku toolbelt is installed as a executable not a ruby gem. How are you trying to execute the command? You should be able to use it from the terminal such as heroku run rake db:migrate etc.



来源:https://stackoverflow.com/questions/34093044/the-heroku-command-exists-in-these-ruby-versions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!