3
votes

this question has been posted befour, but the answers haven't worked. I should proberley mention that i am completely new to ruby. i incountered the error while doing a tutorial
here are the steps:

[first_app (master)]$ gem install heroku

I get

Successfully installed heroku-2.24.0

but when i try

[first_app (master)]$ heroku keys:add

I get

-bash: heroku: command not found

i then tried a bunch uninstalling the gem updating bundle reinstalling it but that hasn't helped

$ 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

my gem environment

RubyGems Environment:
- RUBYGEMS VERSION: 1.8.11
- RUBY VERSION: 1.9.3 (2012-02-16 patchlevel 125) [x86_64-darwin11.3.0]
- INSTALLATION DIRECTORY: /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 DIRECTORY: /Users/vng/.rbenv/versions/1.9.3-p125/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-11
- GEM PATHS:
- /Users/vng/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1
- /Users/vng/.gem/ruby/1.9.1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/

help is greatly appreciated

1
This doesn't answer your question, but have you tried the recommended approach of installing the Heroku Toolbelt - toolbelt.herokuapp.com If you do, I'd uninstall that gem (which has always worked for me as well).Jon Mountjoy

1 Answers

9
votes

When you install gems that have binaries (executables) you must run

rbenv rehash

to add the executables to your path.