I have recently moved from RVM to Rbenv and when attempting to execute rails I am getting an error like the one below
Pauls-Air:~ $ rails rbenv: rails: command not found The `rails' command exists in these Ruby versions: 2.1.2
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.
If rbenv is run as the root user then it will be installed to /usr/local/rbenv, otherwise it will be installed to the users ~/. rbenv directory. To make rbenv available in the shell you may need to add the rbenv/shims and rbenv/bin directories to the users PATH.
rbenv is included in all installations of Bitnami Ruby stack that use system packages. It is a command-line tool which allows you to easily install, manage, and work with multiple Ruby environments. Every installed Ruby interpreter using rbenv is isolated in its own directory with its libraries and gems.
rbenv is a tool that lets you install and run multiple versions of Ruby side-by-side. It's a simple, lightweight alternative to RVM that focuses solely on managing multiple Ruby environments. Each version of Ruby is installed in the ~/. rbenv/versions directory.
After installing a gem via the command line in a ruby version you have to execute rbenv rehash
as described in the docs here and here
For example:
$ rbenv install 2.2.0 $ gem install bundler $ rbenv rehash $ gem install rails $ 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