Praveen Praveen - 3 months ago 28
Linux Question

heroku --version returns error

After installing Heroku CLI for RHEL, I am getting below error after running

herolu --version
command. What is the reason, how to solve this problem?

[xxxxx@oc3651178580 ~]$ heroku --version
/usr/local/heroku/lib/heroku/updater.rb:3:in `require': /usr/local/heroku/lib/heroku/helpers.rb:303: syntax error, unexpected ':', expecting ')' (SyntaxError)
...de('utf-8', 'binary', invalid: :replace, undef: :replace).sp...
^
from /usr/local/heroku/lib/heroku/updater.rb:3
from /usr/local/heroku/bin/heroku:18:in `require'
from /usr/local/heroku/bin/heroku:18

Xav Xav
Answer

I had the same issue due to a 'old' version of ruby (1.8) set by default. I've uninstall it and reinstall the latest one, and now it is working

$ which ruby
/usr/bin/ruby

Use this to find out what it actually is:

$ readlink -f /usr/bin/ruby
/usr/bin/ruby1.8

Use this to find out what package it belongs to:

$ dpkg -S /usr/bin/ruby1.8
ruby1.8: /usr/bin/ruby1.8

Use this to uninstall that:

$ apt-get purge ruby1.8

Reisntall the lastest one

$ apt-get install ruby