Reputation:
I cant install rails with the usual commannd it gets ignored on my mac. However it seems to be installed according to the terminal output.
Upvotes: 0
Views: 42
Reputation: 901
Answer can be found by typing
sudo gem environment
then
gem environment
and comparing the results. (gem env is a short version of the command)
Ruby gems are installed locally in directory under specific ruby version, which is also installed in user specific folder (not sure bout MAC situation, but that's the case on my Ubuntu).
Please see the difference on my machine (I am using rvm - ruby version manager):
with sudo - INSTALLATION DIRECTORY: /var/lib/gems/2.7.0
without sudo - INSTALLATION DIRECTORY: /home/le-hu/.rvm/gems/ruby-2.7.2
Using sudo in this case causes the gem to install under root user, not your regular user profile, this leads into gem missing while trying to invoke the gem script being logged in as not-root user.
Upvotes: 0