ruby-build: Something wrong with LDFLAGS

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]

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 30 (6 by maintainers)

Most upvoted comments

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

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.

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

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”.

thanks @eze, you saved me some time!

Try to (re)install openssl (brew install openssl), that did the trick for me.

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.