Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using rbenv install throws an error

I'm using Homebrew rbenv. brew doctor comes out fine. rbenv install 2.0.0-p451 gives the following error message:

user$ rbenv install 2.0.0-p451 
Downloading ruby-2.0.0-p451.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/9227787a9636551f1749ee8394b5ffe5
Installing ruby-2.0.0-p451...

BUILD FAILED

Inspect or clean up the working tree at /var/folders/4h/ty8nj6c144b5cmhcrt0hd3cw0000gn/T/ruby-build.20140501101240.6245
Results logged to /var/folders/4h/ty8nj6c144b5cmhcrt0hd3cw0000gn/T/ruby-build.20140501101240.6245.log

Last 10 log lines:
ld: warning: directory not found for option '-L/usr/local/var/rbenv/versions/2.0.0-p451/lib'
installing default openssl libraries
1 warning generated.
linking shared-object date_core.bundle
ld: warning: directory not found for option '-L/usr/local/var/rbenv/versions/2.0.0-p451/lib'
linking shared-object openssl.bundle
ld: warning: directory not found for option '-L/usr/local/var/rbenv/versions/2.0.0-p451/lib'
linking shared-object ripper.bundle
ld: warning: directory not found for option '-L/usr/local/var/rbenv/versions/2.0.0-p451/lib'
make: *** [build-ext] Error 2

I tried googling it but not luck. Any tips?

p.s. I tried other ruby versions but same issue (although the last 10 lines of the log are slightly different).

Edit: installing version 1.9.3-p545 works fine.

like image 544
gdiazc Avatar asked May 01 '14 09:05

gdiazc


People also ask

How do I know if Rbenv is installed?

You can see if it is using rbenv by typing which ruby and it should print something out with . rbenv/ whatever. If not you need to set rbenv as your current ruby. You can do that like rbenv global 2.1.

Is Rbenv better than RVM?

Rbenv pros over RVM: Rbenv is lightweight, RVM is heavier, Rbenv is more developer-friendly than RVM, Rbenv has a dedicated plugin for Ruby installation mechanism, RVM has it built-in.


1 Answers

brew cleanup and remove this /var/folders/4h/ty8nj6c144b5cmhcrt0hd3cw0000gn/T/ruby-build.20140501101240.6245 file.

I remember i removed all /var/folders/4h folder (wasn't exactly such name, but then i removed all folders in /var/folders/ and there wasn't no problem).

like image 56
zishe Avatar answered Oct 08 '22 10:10

zishe