1

I have installed ruby 2.2.2 through RVM, and have also installed Heroku. I installed Heroku by downloading the most recent release from Github, installing the needed gems, and then symlinking it into /usr/bin/ so that it could be found when I needed to use the command. It worked initially, but after a while (this may have happened on restart), any heroku commands now have a ruby error.

The symlinked binary still works correctly if I explicitly specify a path.

Output:

user@BEN-PC-LINUX:~$ heroku login
/home/user/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/dependency.rb:315:in `to_specs': Could not find 'heroku' (>= 0) among 96 total gem(s) (Gem::LoadError)
Checked in 'GEM_PATH=/home/user/.rvm/gems/ruby-2.2.2:/home/user/.rvm/gems/ruby-2.2.2@global', execute `gem env` for more information
        from /home/user/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/dependency.rb:324:in `to_spec'
        from /home/user/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_gem.rb:64:in `gem'
        from /home/user/.rvm/gems/ruby-2.2.2/bin/heroku:22:in `<main>'
        from /home/user/.rvm/gems/ruby-2.2.2/bin/ruby_executable_hooks:15:in `eval'
        from /home/user/.rvm/gems/ruby-2.2.2/bin/ruby_executable_hooks:15:in `<main>'
user@BEN-PC-LINUX:~$ /usr/bin/heroku login
Enter your Heroku credentials.
Email: 

The only place that the heroku command actually works as supposed to is in /usr/local/heroku, I'm guessing because /usr/local/heroku/bin/ is searched before using the path. Even in /usr/bin/, the error occurs.

4
  • The Heroku toolbelt has an install script, running wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh might be a better way to install it. Commented May 31, 2015 at 14:45
  • @Exupery I tried that, but I don't want to install the heroku package itself (which is what that does) because it installs the system ruby packages as dependencies, which I would like to avoid. Commented May 31, 2015 at 14:47
  • 1
    You can create a alias for heroku command put below code in .bash_profile file alias heroku="/usr/bin/heroku" Commented May 31, 2015 at 14:55
  • @AnantKolvankar that works for me, post it as an answe and I will accept. Commented May 31, 2015 at 14:58

1 Answer 1

1

You can create a alias for heroku command put below code in .bash_profile file

alias heroku="/usr/bin/heroku"

.bash_profile so that it's loaded each time you open a terminal.

note:- You will have to reload your current terminal to have it working simply use

$. .bash_profile
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.