RVM can't find installed new Ruby version (previously installed using Homebrew)
I'm a beginner, please excuse me if I'm saying or doing things you perceive as utterly stupid. I'm not doing it on purpose.
How this started: I wanted to install gems, but got the following error message:
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory
Somehow, my system is apparently still using the Ruby version that came with MacOS, which gives this permission error. It should be using the newly installed version, 2.6.1., which I installed using Homebrew.
So, upon internet research, I installed rvm, and tried to make Ruby 2.6.1 the default:
~rvm --default use 2.6.1
Required ruby-2.6.1 is not installed.
So rvm tells me Ruby 2.6.1 is not installed.
But homebrew insists it is installed:
~brew upgrade ruby
Error: ruby 2.6.1 already installed
Should I uninstall the homebrew Ruby and install Ruby again via rvm?
command-line ruby homebrew version-control rvm
add a comment |
I'm a beginner, please excuse me if I'm saying or doing things you perceive as utterly stupid. I'm not doing it on purpose.
How this started: I wanted to install gems, but got the following error message:
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory
Somehow, my system is apparently still using the Ruby version that came with MacOS, which gives this permission error. It should be using the newly installed version, 2.6.1., which I installed using Homebrew.
So, upon internet research, I installed rvm, and tried to make Ruby 2.6.1 the default:
~rvm --default use 2.6.1
Required ruby-2.6.1 is not installed.
So rvm tells me Ruby 2.6.1 is not installed.
But homebrew insists it is installed:
~brew upgrade ruby
Error: ruby 2.6.1 already installed
Should I uninstall the homebrew Ruby and install Ruby again via rvm?
command-line ruby homebrew version-control rvm
add a comment |
I'm a beginner, please excuse me if I'm saying or doing things you perceive as utterly stupid. I'm not doing it on purpose.
How this started: I wanted to install gems, but got the following error message:
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory
Somehow, my system is apparently still using the Ruby version that came with MacOS, which gives this permission error. It should be using the newly installed version, 2.6.1., which I installed using Homebrew.
So, upon internet research, I installed rvm, and tried to make Ruby 2.6.1 the default:
~rvm --default use 2.6.1
Required ruby-2.6.1 is not installed.
So rvm tells me Ruby 2.6.1 is not installed.
But homebrew insists it is installed:
~brew upgrade ruby
Error: ruby 2.6.1 already installed
Should I uninstall the homebrew Ruby and install Ruby again via rvm?
command-line ruby homebrew version-control rvm
I'm a beginner, please excuse me if I'm saying or doing things you perceive as utterly stupid. I'm not doing it on purpose.
How this started: I wanted to install gems, but got the following error message:
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory
Somehow, my system is apparently still using the Ruby version that came with MacOS, which gives this permission error. It should be using the newly installed version, 2.6.1., which I installed using Homebrew.
So, upon internet research, I installed rvm, and tried to make Ruby 2.6.1 the default:
~rvm --default use 2.6.1
Required ruby-2.6.1 is not installed.
So rvm tells me Ruby 2.6.1 is not installed.
But homebrew insists it is installed:
~brew upgrade ruby
Error: ruby 2.6.1 already installed
Should I uninstall the homebrew Ruby and install Ruby again via rvm?
command-line ruby homebrew version-control rvm
command-line ruby homebrew version-control rvm
asked Feb 1 at 11:47
Hanneke LHanneke L
12
12
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
I uninstalled Ruby using Homebrew. brew uninstall ruby
Then tried installing Ruby using RVM. rvm install ruby
It gave
Already installed ruby-2.6.0.
To reinstall use:
rvm reinstall ruby-2.6.0
So I chose to reinstall it with RVM. This finally fixed the issue, I was able to install gems. However I am still not sure why there was an issue with the Homebrew installation of Ruby.
add a comment |
First of all, nothing you say or do is going to sound stupid. We've all been beginners at some point.
The reason why your Mac didn't automatically recognize the Ruby version installed by Homebrew is because by default, the computer only looks for executable programs in certain directories. The list of directories, and the order in which the computer looks them up is called the PATH
. If you type echo $PATH
in Terminal, you will see the list of directories, separated by a colon. By default, on a brand new macOS installation, I believe
the list looks like this:
/usr/bin:/bin:/usr/sbin:/sbin
During the Homebrew installation, a new directory /usr/local/bin
gets created and added to the beginning of the PATH
. However, when you install Ruby with Homebrew, Ruby is installed in /usr/local/opt/ruby/bin
, which doesn't get added to the PATH
automatically. I know this because it's mentioned by Homebrew at the end of the Ruby installation. Admittedly, the message might not mean much to a beginner:
If you need to have ruby first in your PATH run:
echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile
Since the Homebrew version of Ruby wasn't in your PATH
, when you typed gem install [some gem]
, the computer looked for the program called gem
in /usr/local/bin
first and didn't find it, then it looked for it in /usr/bin
and found it because that's where the system gem
(the version of gem
that comes with macOS) is installed.
If you want to know which version of a particular program is in use in the current Terminal session, you can use the which
command. For example:
which ruby
which gem
This will tell you the location of the program where the computer first found it.
Another command you can use to see if you're using the right Ruby version is:
ruby -v
If you had run this command:
echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile
and then opened a new Terminal window or tab (or ran source ~/.bash_profile
) for the changes to take effect, the Homebrew Ruby directory would have been first in your PATH
, which means your computer would have looked for gem
there first, and it would have used the Homebrew version of Ruby.
To explain the command above, it takes everything between the single quotes and adds it (>>
) to a file called .bash_profile
in your user's root directory (~/
). Every time you open a new Terminal window or tab, .bash_profile
is read, and anything defined there is used.
Similarly, the reason why RVM couldn't recognize that Ruby 2.6.1 had been installed by Homebrew is because RVM and Homebrew install Ruby in two separate places that don't know about each other. When you first installed RVM, it installed version 2.6.0. I'm not sure why it didn't install 2.6.1, but I do recall in the past when I used RVM that it wouldn't always install the latest version. I personally prefer chruby
and ruby-install
to manage Ruby versions.
The nice thing about tools like RVM, chruby, and rbenv is that they allow you to install multiple versions of Ruby on the same computer, and you can switch from one to the other easily. Homebrew, on the other hand, can only manage one version of Ruby at a time.
New contributor
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1400963%2frvm-cant-find-installed-new-ruby-version-previously-installed-using-homebrew%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
I uninstalled Ruby using Homebrew. brew uninstall ruby
Then tried installing Ruby using RVM. rvm install ruby
It gave
Already installed ruby-2.6.0.
To reinstall use:
rvm reinstall ruby-2.6.0
So I chose to reinstall it with RVM. This finally fixed the issue, I was able to install gems. However I am still not sure why there was an issue with the Homebrew installation of Ruby.
add a comment |
I uninstalled Ruby using Homebrew. brew uninstall ruby
Then tried installing Ruby using RVM. rvm install ruby
It gave
Already installed ruby-2.6.0.
To reinstall use:
rvm reinstall ruby-2.6.0
So I chose to reinstall it with RVM. This finally fixed the issue, I was able to install gems. However I am still not sure why there was an issue with the Homebrew installation of Ruby.
add a comment |
I uninstalled Ruby using Homebrew. brew uninstall ruby
Then tried installing Ruby using RVM. rvm install ruby
It gave
Already installed ruby-2.6.0.
To reinstall use:
rvm reinstall ruby-2.6.0
So I chose to reinstall it with RVM. This finally fixed the issue, I was able to install gems. However I am still not sure why there was an issue with the Homebrew installation of Ruby.
I uninstalled Ruby using Homebrew. brew uninstall ruby
Then tried installing Ruby using RVM. rvm install ruby
It gave
Already installed ruby-2.6.0.
To reinstall use:
rvm reinstall ruby-2.6.0
So I chose to reinstall it with RVM. This finally fixed the issue, I was able to install gems. However I am still not sure why there was an issue with the Homebrew installation of Ruby.
answered Feb 1 at 12:31
Hanneke LHanneke L
12
12
add a comment |
add a comment |
First of all, nothing you say or do is going to sound stupid. We've all been beginners at some point.
The reason why your Mac didn't automatically recognize the Ruby version installed by Homebrew is because by default, the computer only looks for executable programs in certain directories. The list of directories, and the order in which the computer looks them up is called the PATH
. If you type echo $PATH
in Terminal, you will see the list of directories, separated by a colon. By default, on a brand new macOS installation, I believe
the list looks like this:
/usr/bin:/bin:/usr/sbin:/sbin
During the Homebrew installation, a new directory /usr/local/bin
gets created and added to the beginning of the PATH
. However, when you install Ruby with Homebrew, Ruby is installed in /usr/local/opt/ruby/bin
, which doesn't get added to the PATH
automatically. I know this because it's mentioned by Homebrew at the end of the Ruby installation. Admittedly, the message might not mean much to a beginner:
If you need to have ruby first in your PATH run:
echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile
Since the Homebrew version of Ruby wasn't in your PATH
, when you typed gem install [some gem]
, the computer looked for the program called gem
in /usr/local/bin
first and didn't find it, then it looked for it in /usr/bin
and found it because that's where the system gem
(the version of gem
that comes with macOS) is installed.
If you want to know which version of a particular program is in use in the current Terminal session, you can use the which
command. For example:
which ruby
which gem
This will tell you the location of the program where the computer first found it.
Another command you can use to see if you're using the right Ruby version is:
ruby -v
If you had run this command:
echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile
and then opened a new Terminal window or tab (or ran source ~/.bash_profile
) for the changes to take effect, the Homebrew Ruby directory would have been first in your PATH
, which means your computer would have looked for gem
there first, and it would have used the Homebrew version of Ruby.
To explain the command above, it takes everything between the single quotes and adds it (>>
) to a file called .bash_profile
in your user's root directory (~/
). Every time you open a new Terminal window or tab, .bash_profile
is read, and anything defined there is used.
Similarly, the reason why RVM couldn't recognize that Ruby 2.6.1 had been installed by Homebrew is because RVM and Homebrew install Ruby in two separate places that don't know about each other. When you first installed RVM, it installed version 2.6.0. I'm not sure why it didn't install 2.6.1, but I do recall in the past when I used RVM that it wouldn't always install the latest version. I personally prefer chruby
and ruby-install
to manage Ruby versions.
The nice thing about tools like RVM, chruby, and rbenv is that they allow you to install multiple versions of Ruby on the same computer, and you can switch from one to the other easily. Homebrew, on the other hand, can only manage one version of Ruby at a time.
New contributor
add a comment |
First of all, nothing you say or do is going to sound stupid. We've all been beginners at some point.
The reason why your Mac didn't automatically recognize the Ruby version installed by Homebrew is because by default, the computer only looks for executable programs in certain directories. The list of directories, and the order in which the computer looks them up is called the PATH
. If you type echo $PATH
in Terminal, you will see the list of directories, separated by a colon. By default, on a brand new macOS installation, I believe
the list looks like this:
/usr/bin:/bin:/usr/sbin:/sbin
During the Homebrew installation, a new directory /usr/local/bin
gets created and added to the beginning of the PATH
. However, when you install Ruby with Homebrew, Ruby is installed in /usr/local/opt/ruby/bin
, which doesn't get added to the PATH
automatically. I know this because it's mentioned by Homebrew at the end of the Ruby installation. Admittedly, the message might not mean much to a beginner:
If you need to have ruby first in your PATH run:
echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile
Since the Homebrew version of Ruby wasn't in your PATH
, when you typed gem install [some gem]
, the computer looked for the program called gem
in /usr/local/bin
first and didn't find it, then it looked for it in /usr/bin
and found it because that's where the system gem
(the version of gem
that comes with macOS) is installed.
If you want to know which version of a particular program is in use in the current Terminal session, you can use the which
command. For example:
which ruby
which gem
This will tell you the location of the program where the computer first found it.
Another command you can use to see if you're using the right Ruby version is:
ruby -v
If you had run this command:
echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile
and then opened a new Terminal window or tab (or ran source ~/.bash_profile
) for the changes to take effect, the Homebrew Ruby directory would have been first in your PATH
, which means your computer would have looked for gem
there first, and it would have used the Homebrew version of Ruby.
To explain the command above, it takes everything between the single quotes and adds it (>>
) to a file called .bash_profile
in your user's root directory (~/
). Every time you open a new Terminal window or tab, .bash_profile
is read, and anything defined there is used.
Similarly, the reason why RVM couldn't recognize that Ruby 2.6.1 had been installed by Homebrew is because RVM and Homebrew install Ruby in two separate places that don't know about each other. When you first installed RVM, it installed version 2.6.0. I'm not sure why it didn't install 2.6.1, but I do recall in the past when I used RVM that it wouldn't always install the latest version. I personally prefer chruby
and ruby-install
to manage Ruby versions.
The nice thing about tools like RVM, chruby, and rbenv is that they allow you to install multiple versions of Ruby on the same computer, and you can switch from one to the other easily. Homebrew, on the other hand, can only manage one version of Ruby at a time.
New contributor
add a comment |
First of all, nothing you say or do is going to sound stupid. We've all been beginners at some point.
The reason why your Mac didn't automatically recognize the Ruby version installed by Homebrew is because by default, the computer only looks for executable programs in certain directories. The list of directories, and the order in which the computer looks them up is called the PATH
. If you type echo $PATH
in Terminal, you will see the list of directories, separated by a colon. By default, on a brand new macOS installation, I believe
the list looks like this:
/usr/bin:/bin:/usr/sbin:/sbin
During the Homebrew installation, a new directory /usr/local/bin
gets created and added to the beginning of the PATH
. However, when you install Ruby with Homebrew, Ruby is installed in /usr/local/opt/ruby/bin
, which doesn't get added to the PATH
automatically. I know this because it's mentioned by Homebrew at the end of the Ruby installation. Admittedly, the message might not mean much to a beginner:
If you need to have ruby first in your PATH run:
echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile
Since the Homebrew version of Ruby wasn't in your PATH
, when you typed gem install [some gem]
, the computer looked for the program called gem
in /usr/local/bin
first and didn't find it, then it looked for it in /usr/bin
and found it because that's where the system gem
(the version of gem
that comes with macOS) is installed.
If you want to know which version of a particular program is in use in the current Terminal session, you can use the which
command. For example:
which ruby
which gem
This will tell you the location of the program where the computer first found it.
Another command you can use to see if you're using the right Ruby version is:
ruby -v
If you had run this command:
echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile
and then opened a new Terminal window or tab (or ran source ~/.bash_profile
) for the changes to take effect, the Homebrew Ruby directory would have been first in your PATH
, which means your computer would have looked for gem
there first, and it would have used the Homebrew version of Ruby.
To explain the command above, it takes everything between the single quotes and adds it (>>
) to a file called .bash_profile
in your user's root directory (~/
). Every time you open a new Terminal window or tab, .bash_profile
is read, and anything defined there is used.
Similarly, the reason why RVM couldn't recognize that Ruby 2.6.1 had been installed by Homebrew is because RVM and Homebrew install Ruby in two separate places that don't know about each other. When you first installed RVM, it installed version 2.6.0. I'm not sure why it didn't install 2.6.1, but I do recall in the past when I used RVM that it wouldn't always install the latest version. I personally prefer chruby
and ruby-install
to manage Ruby versions.
The nice thing about tools like RVM, chruby, and rbenv is that they allow you to install multiple versions of Ruby on the same computer, and you can switch from one to the other easily. Homebrew, on the other hand, can only manage one version of Ruby at a time.
New contributor
First of all, nothing you say or do is going to sound stupid. We've all been beginners at some point.
The reason why your Mac didn't automatically recognize the Ruby version installed by Homebrew is because by default, the computer only looks for executable programs in certain directories. The list of directories, and the order in which the computer looks them up is called the PATH
. If you type echo $PATH
in Terminal, you will see the list of directories, separated by a colon. By default, on a brand new macOS installation, I believe
the list looks like this:
/usr/bin:/bin:/usr/sbin:/sbin
During the Homebrew installation, a new directory /usr/local/bin
gets created and added to the beginning of the PATH
. However, when you install Ruby with Homebrew, Ruby is installed in /usr/local/opt/ruby/bin
, which doesn't get added to the PATH
automatically. I know this because it's mentioned by Homebrew at the end of the Ruby installation. Admittedly, the message might not mean much to a beginner:
If you need to have ruby first in your PATH run:
echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile
Since the Homebrew version of Ruby wasn't in your PATH
, when you typed gem install [some gem]
, the computer looked for the program called gem
in /usr/local/bin
first and didn't find it, then it looked for it in /usr/bin
and found it because that's where the system gem
(the version of gem
that comes with macOS) is installed.
If you want to know which version of a particular program is in use in the current Terminal session, you can use the which
command. For example:
which ruby
which gem
This will tell you the location of the program where the computer first found it.
Another command you can use to see if you're using the right Ruby version is:
ruby -v
If you had run this command:
echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile
and then opened a new Terminal window or tab (or ran source ~/.bash_profile
) for the changes to take effect, the Homebrew Ruby directory would have been first in your PATH
, which means your computer would have looked for gem
there first, and it would have used the Homebrew version of Ruby.
To explain the command above, it takes everything between the single quotes and adds it (>>
) to a file called .bash_profile
in your user's root directory (~/
). Every time you open a new Terminal window or tab, .bash_profile
is read, and anything defined there is used.
Similarly, the reason why RVM couldn't recognize that Ruby 2.6.1 had been installed by Homebrew is because RVM and Homebrew install Ruby in two separate places that don't know about each other. When you first installed RVM, it installed version 2.6.0. I'm not sure why it didn't install 2.6.1, but I do recall in the past when I used RVM that it wouldn't always install the latest version. I personally prefer chruby
and ruby-install
to manage Ruby versions.
The nice thing about tools like RVM, chruby, and rbenv is that they allow you to install multiple versions of Ruby on the same computer, and you can switch from one to the other easily. Homebrew, on the other hand, can only manage one version of Ruby at a time.
New contributor
New contributor
answered 2 days ago
monfreshmonfresh
1011
1011
New contributor
New contributor
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1400963%2frvm-cant-find-installed-new-ruby-version-previously-installed-using-homebrew%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown