rbenv install of any ruby version fails on OS X 10.10.4 using latest rbenv and ruby-build, installed from homebrew.
Log:
Downloading ruby-2.2.2.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/5ffc0f317e429e6b29d4a98ac521c3ce65481bfd22a8cf845fa02a7b113d9b44
Installing ruby-2.2.2...
BUILD FAILED (OS X 10.10.4 using ruby-build 20150719-13-g86919c8)
Inspect or clean up the working tree at /var/folders/0d/9yn1_3mj42dbydgkrxq3p9pm0000gn/T/ruby-build.20150802155225.16233
Results logged to /var/folders/0d/9yn1_3mj42dbydgkrxq3p9pm0000gn/T/ruby-build.20150802155225.16233.log
Last 10 log lines:
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for cd using physical directory... cd -P
checking whether CFLAGS is valid... yes
checking whether LDFLAGS is valid... no
configure: error: something wrong with LDFLAGS="-L/Users/doppioslash/.rbenv/versions/2.2.2/lib "
$ ruby -v
ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin14]
Try to (re)install openssl (brew install openssl), that did the trick for me.
Thanks for reporting. Sounds like https://github.com/sstephenson/rbenv/issues/590, but it seems you already discovered that one.
This was supposed to be fixed with 50bf60f9c2510fbee7f111046e97fe8bf9e66472 years ago. You have a very recent version of ruby-build, so that doesn't seem the problem. I was able to replicate your problem if I removed ldflags_dirs directive from Ruby 2.2.2 build definition, but as soon as I put it back, the problem was solved. So it got me thinking whether it's possible that you have a custom build definition for Ruby 2.2.2 somewhere?
Do you have RUBY_BUILD_DEFINITIONS or RUBY_BUILD_ROOT set by any chance in your environment?
I had the same error with ruby 2.1.1. After I uninstalled whilst trying to fix openssl problems I couldn't reinstall it again even after sorting later versions.
Steps I found on here resolved the issue for me:
http://diary-satoryu.rhcloud.com/20150617.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+SatoryusDiaryopenshift+(Satoryu%27s+Diary(OpenShift%E6%94%AF%E5%BA%97))
Paths were different in my environment, the steps I followed:
rbenv install -k 2.1.0 (-k keeps keeps the source)
cd /Users/_username_/.rbenv/sources/2.1.1/ruby-2.1.1/
/configure --prefix=/Users/_username_/.rbenv/versions/2.1.1
Make
Make test
Make install
rbenv install 2.1.1
@peterjroberts Please try the latest Ruby 2.1.x version instead of 2.1.1. The Ruby core team solved various cross-platform build problems since Ruby 2.1.1, some of which were on OS X.
@mislav I first encountered this trying to install 2.1.7, then later realized it still happens for other versions (i.e. 2.2.3) as well:
2.1.7:
rbenv install 2.1.7
Downloading ruby-2.1.7.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/f59c1596ac39cc7e60126e7d3698c19f482f04060674fdfe0124e1752ba6dd81
Installing ruby-2.1.7...
BUILD FAILED (OS X 10.10.5 using ruby-build 20150818-2-g6350988)
Inspect or clean up the working tree at /var/folders/t0/rpqnxrlx1fjfyxvwn8qtzgmr0000gp/T/ruby-build.20150827133914.8085
Results logged to /var/folders/t0/rpqnxrlx1fjfyxvwn8qtzgmr0000gp/T/ruby-build.20150827133914.8085.log
Last 10 log lines:
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for cd using physical directory... cd -P
checking whether CFLAGS is valid... yes
checking whether LDFLAGS is valid... no
configure: error: something wrong with LDFLAGS="-L/Users/jordaniel/.rbenv/versions/2.1.7/lib "
2.2.3:
rbenv install 2.2.3
Downloading ruby-2.2.3.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/df795f2f99860745a416092a4004b016ccf77e8b82dec956b120f18bdc71edce
Installing ruby-2.2.3...
BUILD FAILED (OS X 10.10.5 using ruby-build 20150818-2-g6350988)
Inspect or clean up the working tree at /var/folders/t0/rpqnxrlx1fjfyxvwn8qtzgmr0000gp/T/ruby-build.20150827134024.8907
Results logged to /var/folders/t0/rpqnxrlx1fjfyxvwn8qtzgmr0000gp/T/ruby-build.20150827134024.8907.log
Last 10 log lines:
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for cd using physical directory... cd -P
checking whether CFLAGS is valid... yes
checking whether LDFLAGS is valid... no
configure: error: something wrong with LDFLAGS="-L/Users/jordaniel/.rbenv/versions/2.2.3/lib "
I tried the steps @peterjroberts used above -- tried brew reinstall openssl beforehand but then got stuck on the configure step:
./configure --prefix=/Users/jordaniel/.rbenv/versions/2.1.7
...
configure: error: something wrong with LDFLAGS=""
same thing with LDFLAGS suggested by brew reinstall openssl:
LDFLAGS="-L/usr/local/opt/openssl/lib" ./configure --prefix=/Users/jordaniel/.rbenv/versions/2.1.7
...
configure: error: something wrong with LDFLAGS="-L/usr/local/opt/openssl/lib "
OS X version 10.10.5. Same error occurs w/ rbenvand ruby-build installed via homebrew and directly from github
I am having the same issue with 2.1.1 but with no other versions. I have reinstalled openssl without success.
Experienced the same thing on OSX 10.11, however 2.1.7 does install successfully.
I'm having the same issue with the latest ruby-build trying to install 2.1.1. I uninstalled ruby-build and installed an older version brew install https://raw.githubusercontent.com/Homebrew/homebrew/316f55d6dd77da663ad6854345a7e773db88cc3b/Library/Formula/ruby-build.rb, and then install 2.1.1 and it worked fine. So obviously, the latest release of ruby-build is not backward compatible for 2.1.1.
Hey everyone who was having problems with "something wrong with LDFLAGS". Can you update to latest release v20151028 and try again?
@gmhawash: specifically, I think this Ruby 2.1.1 problem should be fixed now.
Looks like the fix works. Thanks
I have ruby-build v20151028 and I still get the same error installing Ruby 2.2.3. I also tried brew reinstall openssl without success.
@renatomoya Your failure is not at all related to above reports, and more related to https://github.com/rbenv/ruby-build/issues/832#issuecomment-160906530. Please add your findings there. Thanks!
I shoot, I did post in the wrong issue. Thanks @mislav !
I think I have similar issues with ruby-build 20160111:
$ rbenv install 2.2.3
Downloading ruby-2.2.3.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.3.tar.bz2
Installing ruby-2.2.3...
BUILD FAILED (OS X 10.11.2 using ruby-build 20160111)
Inspect or clean up the working tree at /var/folders/00/125vrccj0sv075zhjdhff04h0000gn/T/ruby-build.20160114004451.14581
Results logged to /var/folders/00/125vrccj0sv075zhjdhff04h0000gn/T/ruby-build.20160114004451.14581.log
Last 10 log lines:
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for cd using physical directory... cd -P
checking whether CFLAGS is valid... yes
checking whether LDFLAGS is valid... no
configure: error: something wrong with LDFLAGS="-L/usr/local/var/rbenv/versions/2.2.3/lib "
make: *** No targets specified and no makefile found. Stop.
Update: I finally got rbenv install to work after commenting out an export LIBRARY_PATH line in my bash_profile. This solution was inspired by this: https://github.com/rvm/rvm/issues/3318
Hence, it might be that ruby, not rbenv/ruby-build, is to blame.
@tcfuji Thanks for sharing your finding! This could explain other people's mysterious failures as well. Perhaps Ruby's error message about LDFLAGS (and not mentioning LIBRARY_PATH) is misleading?
I am having issues installin 2.2.4 on 10.10.5, keep getting:
BUILD FAILED (OS X 10.10.5 using ruby-build 20160330)
Inspect or clean up the working tree at /var/folders/nz/cwp6snk10_s6xgdxb5rly5mm0000gn/T/ruby-build.20160403003341.51083
Results logged to /var/folders/nz/cwp6snk10_s6xgdxb5rly5mm0000gn/T/ruby-build.20160403003341.51083.log
Last 10 log lines:
from /private/var/folders/nz/cwp6snk10_s6xgdxb5rly5mm0000gn/T/ruby-build.20160403003341.51083/ruby-2.2.4/lib/rubygems/dependency_installer.rb:373:in install'
from /private/var/folders/nz/cwp6snk10_s6xgdxb5rly5mm0000gn/T/ruby-build.20160403003341.51083/ruby-2.2.4/lib/rubygems.rb:558:ininstall'
from ./tool/rbinstall.rb:722:in block (2 levels) in <main>'
from ./tool/rbinstall.rb:721:ineach'
from ./tool/rbinstall.rb:721:in block in <main>'
from ./tool/rbinstall.rb:757:incall'
from ./tool/rbinstall.rb:757:in block in <main>'
from ./tool/rbinstall.rb:754:ineach'
from ./tool/rbinstall.rb:754:in `
make: *** [do-install-all] Error 1
Hi all,
I'm having this issue when installing on a brand new installation of macOS 10.14
Last 10 log lines:
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for cd using physical directory... cd -P
checking whether CFLAGS is valid... yes
checking whether LDFLAGS is valid... no
configure: error: something wrong with LDFLAGS="-L/Users/ezekielelin/.rbenv/versions/2.5.1/lib "
make: *** No targets specified and no makefile found. Stop.
rbenv 1.1.1 and ruby-build 20180601
I've tried making the folder listed (it wasn't present) to no avail
Update: I've resolved this issue by selecting Command Line Tools in Xcode > Preferences > Locations
thanks @eze, you saved me some time!
I made it work by updating the xcode to it latest version.
brew doctor was complaining about outdated version of xcode.
Update: I've resolved this issue by selecting Command Line Tools in Xcode > Preferences > Locations
Still happens on macOS 10.14 Beta, for me it's an Xcode issue. The method above solved my problem.
On 10.14 final I had the same thing as @tyrng - in Xcode > Preferences > Locations I just had to select the only option under "Command Line Tools".
Had absolutely the same issue on new MacOS Mojave.
Fixed problem with installing Xcode.
After helped this instruction: http://railsapps.github.io/installrubyonrails-mac.html
In my case, it was because I was using Xcode-beta . After I re-installed Xcode (to a stable version), things worked for me.
I also followed the Xcode > Preferences > Locations advices mentioned in the comments above, which might have helped!
Can confirm that the popular solution above worked for me too. Initially had the LFLAGS error, and I ran mkdir -p /Users/user/.rbenv/versions/2.6.3/lib, then I changed command line tools from 9.4.1 (9F2000) to 10.2 (10E125) so I could install ruby 2.6.3. I don't totally understand why this solution worked, but maybe it will help someone else.
I've resolved: https://github.com/rbenv/ruby-build/issues/1080#issuecomment-522453263
Most helpful comment
Hi all,
I'm having this issue when installing on a brand new installation of macOS 10.14rbenv 1.1.1andruby-build 20180601I've tried making the folder listed (it wasn't present) to no avail
Update: I've resolved this issue by selecting Command Line Tools in Xcode > Preferences > Locations