Rbenv Mavericks

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.

I am also having trouble installing Ruby 2.0.0 with the following error:
rbenv install 2.0.0-p247
Downloading openssl-1.0.1e.tar.gz…
http://dqw8nmjcqpjn7.cloudfront.net/66bf6f10f060d561929de96f9dfe5b8c
Installing openssl-1.0.1e…
Installed openssl-1.0.1e to /Users/jcollins/.rbenv/versions/2.0.0-p247

Downloading ruby-2.0.0-p247.tar.gz…
http://dqw8nmjcqpjn7.cloudfront.net/c351450a0bed670e0f5ca07da3458a5b
Installing ruby-2.0.0-p247…

BUILD FAILED

Inspect or clean up the working tree at
/var/folders/1d/009d5p1513v3xt7qyhmltwd05m015m/T/ruby-build.20131116181728.95523
Results logged to
/var/folders/1d/009d5p1513v3xt7qyhmltwd05m015m/T/ruby-build.20131116181728.95523.log

Last 10 log lines:
configure: WARNING: unrecognized options: --with-openssl-dir
checking build system type… x86_64-apple-darwin13.0.2
checking host system type… x86_64-apple-darwin13.0.2
checking target system type… x86_64-apple-darwin13.0.2
checking for gcc-4.2… gcc-4.2
checking for gcc… (cached) gcc-4.2
checking whether the C compiler works… no
configure: error: in
/var/folders/1d/009d5p1513v3xt7qyhmltwd05m015m/T/ruby-build.20131116181728.95523/ruby-2.0.0-p247': configure: error: C compiler cannot create executables See config.log’ for more details

BUILD FAILED

Inspect or clean up the working tree at
/var/folders/1d/009d5p1513v3xt7qyhmltwd05m015m/T/ruby-build.20131116181728.95523
Results logged to
/var/folders/1d/009d5p1513v3xt7qyhmltwd05m015m/T/ruby-build.20131116181728.95523.log

Last 10 log lines:
checking build system type… x86_64-apple-darwin13.0.2
checking host system type… x86_64-apple-darwin13.0.2
checking target system type… x86_64-apple-darwin13.0.2
checking for gcc-4.2… gcc-4.2
checking for gcc… (cached) gcc-4.2
checking whether the C compiler works… no
configure: error: in
/var/folders/1d/009d5p1513v3xt7qyhmltwd05m015m/T/ruby-build.20131116181728.95523/ruby-2.0.0-p247': configure: error: C compiler cannot create executables See config.log’ for more details
make: *** No targets specified and no makefile found. Stop.

Thanks.

On Nov 16, 2013, at 7:40 PM, Justin C. [email protected] wrote:

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

Mike S. [email protected]
http://www.stok.ca/~mike/

The “`Stok’ disclaimers” apply.