Are there any differences in the save locations for the following commands?:
gem install some_gem
sudo gem install some_gem
bundle install
bundle install is for rails 3 project.
Will all of them save the installed gem in the same directory or in different directories?
Probably in different directories, because the “root” user has a different account and path than you do.
Root’s access via
sudowill allow the file to be written to the gem environment for a Ruby in the/usr/binor/usr/local/bindirectories. (Gem won’t put the files there, but they’ll be associated with a Ruby in one of those directories.)You don’t have access to write to those areas by default, so if you tried to run
gem install, and only had a System Ruby, you’d probably get permission errors and the attempt should fail.