I'm on Linux Mint 17.2.
I recently removed ruby with apt-get purge ruby
.
I then installed rbenv
and then did rbenv install 2.3.0
so now, ~/.rbenv/versions/2.3.0/bin/ruby
exists.
But now, I can't do gem install rubocop
. I get this:
$ gem install rubocop
rbenv: gem: command not found
The `gem' command exists in these Ruby versions:
2.3.0
But I can do ~/.rbenv/versions/2.3.0/bin/gem install rubocop
.
However, once I'm done, I can't use it:
$ rubocop --auto-correct
-bash: /usr/local/bin/rubocop: /usr/bin/ruby1.9.1: bad interpreter: No such file or directory
I also can't find out where this ruby came from:
$ dpkg -S /usr/bin/ruby1.9.1
dpkg-query: no path found matching pattern /usr/bin/ruby1.9.1
It's possible it was installed via RVM a long time ago.
Any idea how I can fix my Ruby?
You can see if it is using rbenv by typing which ruby and it should print something out with . rbenv/ whatever. If not you need to set rbenv as your current ruby. You can do that like rbenv global 2.1.
rbenv is a tool that lets you install and run multiple versions of Ruby side-by-side.
rbenv (Simple Ruby Version Management) lets you easily switch between multiple versions of Ruby. It is simple, unobtrusive, and follows the UNIX tradition of single-purpose tools that do one thing well. Another tool to be used for the same purpose is RVM.
try run rbenv global 2.3.0 && rbenv rehash
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With