ruby - heroku:命令未找到

这个问题已经发布了,但答案没有奏效 . 我应该在proberley中提到我对ruby来说是全新的 . 我在做教程时遇到了错误
这是步骤:

[first_app (master)]$ gem install heroku

我明白了

Successfully installed heroku-2.24.0

但是当我尝试

[first_app (master)]$ heroku keys:add

我明白了

-bash: heroku: command not found

然后我尝试了一堆卸载宝石更新包重新安装它,但这没有帮助

$ bundle exec heroku

/Users/vng/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/lib/bundler/rubygems_integration.rb:147:in ``block in replace_gem': heroku is not part of the bundle. Add it to Gemfile. (Gem::LoadError) from /Users/vng/.rbenv/versions/1.9.3-p125/bin/heroku:18:in'

echo $PATH

/Users/vng/.rbenv/shims:/Users/vng/.rbenv/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin

我的宝石环境

RubyGems环境: - RUBYGEMS版本:1.8.11 - RUBY版本:1.9.3(2012-02-16 patchlevel 125)[x86_64-darwin11.3.0] - 安装目录:/Users/vng/.rbenv/versions/1.9 . 3-p125 / lib / ruby / gems / 1.9.1 - RUBY EXECUTABLE:/Users/vng/.rbenv/versions/1.9.3-p125/bin/ruby - EXECUTABLE目录:/Users/vng/.rbenv/versions/ 1.9.3-p125 / bin - RUBYGEMS PLATFORMS: - ruby - x86_64-darwin-11 - GEM路径: - /Users/vng/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1 - /Users/vng/.gem/ruby/1.9.1 - GEM配置: - :update_sources => true - :verbose => true - :benchmark => false - :backtrace => false - :bulk_threshold => 1000 - REMOTE SOURCES : - http://rubygems.org/

非常感谢帮助

回答(1)

3 years ago

当您安装具有二进制文件(可执行文件)的gem时,您必须运行

rbenv rehash

将可执行文件添加到路径中 .