I just upgraded my MacbookPro to a fresh install of Mavericks. After
the install I started trying to get my development environment setup.
In this I installed Homebrew, rbenv, ruby-build, and attempted some
rubies. One issue I am running into is that in Mavericks, with rbenv,
when I try to run 'gem install bundler' I am given a permission error
and asking me to use sudo. I am hesitant to do this because I don't
know how this will affect the gems in rbenv. Will it be ok to use sudo?
I want to be able to use the gems globally in all my versions of rubies
if that is possible. I apologize for the beginner question, but I am
new to Ruby, rbenv, and gems and I'm not sure how it will affect my
computer. Thanks.
Usually if you are asked to use sudo it indicates that you are doing something to the system ruby.
I generally try to leave the system ruby and its libraries and gems alone, so that system updates will not have surprising effects for me.
Before trying to install a gem you might want to start using one of the rubies you have installed. You can see the available versions using rbenv versions:
ratdog:~ mike$ rbenv versions
system
1.8.7-p374
1.9.2-p290
* 2.0.0-p247 (set by /Users/mike/.rbenv/version)
rbx-2.1.1
If you pick one of your installed rubies (maybe using rbenv shell) then you should be able to install gems without using sudo.
The gems are installed per version of ruby, so you'll have to install them for each ruby. There is a default-gems plugin for rbenv which lets you specify some gems to install each time you install a new ruby version.
Hope this helps,
Mike
···
On Nov 16, 2013, at 7:40 PM, Justin C. <lists@ruby-forum.com> wrote:
I just upgraded my MacbookPro to a fresh install of Mavericks. After
the install I started trying to get my development environment setup.
In this I installed Homebrew, rbenv, ruby-build, and attempted some
rubies. One issue I am running into is that in Mavericks, with rbenv,
when I try to run 'gem install bundler' I am given a permission error
and asking me to use sudo. I am hesitant to do this because I don't
know how this will affect the gems in rbenv. Will it be ok to use sudo?
I want to be able to use the gems globally in all my versions of rubies
if that is possible. I apologize for the beginner question, but I am
new to Ruby, rbenv, and gems and I'm not sure how it will affect my
computer. Thanks.