Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruby 2.1.1 build fails on OS X (LDFLAGS error) #590

Closed
eriknomitch opened this issue May 21, 2014 · 24 comments
Closed

Ruby 2.1.1 build fails on OS X (LDFLAGS error) #590

eriknomitch opened this issue May 21, 2014 · 24 comments

Comments

@eriknomitch
Copy link

I'm having Ruby 2.1.1 build failures on rbenv 0.4.0-97-gfe0b243 with OS X 10.9.3. Excerpt:

checking whether LDFLAGS is valid... no
configure: error: something wrong with
LDFLAGS="-L/Users/erik/.rbenv/versions/2.1.1/lib "
make: *** No targets specified and no makefile found.  Stop.

Shell output in this Gist or:

Downloading ruby-2.1.1.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/e57fdbb8ed56e70c43f39c79da1654b2
Installing ruby-2.1.1...

BUILD FAILED

Inspect or clean up the working tree at
/var/folders/gt/p9gcc3mx36104jplq02qcrwh0000gn/T/ruby-build.20140521110828.13171
Results logged to
/var/folders/gt/p9gcc3mx36104jplq02qcrwh0000gn/T/ruby-build.20140521110828.13171.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/erik/.rbenv/versions/2.1.1/lib "

BUILD FAILED

Inspect or clean up the working tree at
/var/folders/gt/p9gcc3mx36104jplq02qcrwh0000gn/T/ruby-build.20140521110828.13171
Results logged to
/var/folders/gt/p9gcc3mx36104jplq02qcrwh0000gn/T/ruby-build.20140521110828.13171.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/Users/erik/.rbenv/versions/2.1.1/lib "
make: *** No targets specified and no makefile found.  Stop.

Log output in this Gist.

@mislav
Copy link
Member

mislav commented May 22, 2014

This issue belongs to ruby-build, where the rbenv install command comes from. Please see https://github.com/sstephenson/ruby-build/wiki for instructions how to upgrade, then try again. If it's still failing after the upgrade, please open this issue in ruby-build project. Thanks

@mislav
Copy link
Member

mislav commented Oct 12, 2014

It's pretty bizarre that you had this failure, when the LDFLAGS issue was supposed to be fixed in 50bf60f. I'm going to presume that this sorted itself out in the meantime and close this. If anyone has more information and failures with latest ruby-build, please report to ruby-build project. Thanks!

@mislav mislav closed this as completed Oct 12, 2014
@Chun-Yang
Copy link

I have this same problem

@dafstone
Copy link

I'm also having this same problem - building fine on >= ruby-2.1.2 but failing on 2.1.1.

This is on a brand new machine (7 days old) with a fresh Xcode, homebrew, etc). OSX 10.10.3.

Here's the output from the build log.

...

checking build system type... x86_64-apple-darwin14.3.0
checking host system type... x86_64-apple-darwin14.3.0
checking target system type... x86_64-apple-darwin14.3.0
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether clang accepts -g... yes
checking for clang option to accept ISO C89... none needed
checking whether we are using the GNU C++ compiler... yes
checking whether clang++ accepts -g... yes
checking how to run the C preprocessor... clang -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking whether clang needs -traditional... no
checking for ld... ld
checking whether the linker is GNU ld... no
checking whether clang -E accepts -o... yes
checking for real target cpu... x86_64
checking for ranlib... ranlib
checking for ar... ar
checking for as... as
checking for objdump... no
checking for gobjdump... no
checking for objcopy... no
checking for gobjcopy... no
checking for nm... nm
checking whether ln -s works... yes
checking whether make sets $(MAKE)... yes
checking for a BSD-compatible install... /usr/local/bin/ginstall -c
checking for a thread-safe mkdir -p... /usr/local/bin/gmkdir -p
checking for dtrace... dtrace
checking for dot... no
checking for doxygen... no
checking for pkg-config... pkg-config
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
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/stone/.rbenv/versions/2.1.1/lib "
make: *** No targets specified and no makefile found.  Stop.

@mislav
Copy link
Member

mislav commented Jun 26, 2015

@dafstone It's probably a build bug with Ruby 2.1.1. Please upgrade to latest Ruby 2.1.x to fix it, as you already discovered. There should be nothing that prevents you from upgrading a project from Ruby 2.1.1 to latest patch version. There should be no functional changes.

@doppioslash
Copy link

Having the same problem with OS X 10.10.4 using ruby-build 20150719-13-g86919c8 installing any ruby version.
The ruby I have is the system version, ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin14].

@janusznowakowski
Copy link

Try to create directory pointed by LDFLAGS, in example:

mkdir -p /Users/stone/.rbenv/versions/2.1.1/lib

For me - it worked!

@mislav
Copy link
Member

mislav commented Sep 26, 2015

@janusznowakowski That's what's confusing about this failure. Ruby-build automatically creates the directories referenced by LDFLAGS since rbenv/ruby-build@50bf60f years ago. I'm glad that you found a workaround, but it's puzzling to me why it's failing in the first place.

@footnoise
Copy link

@mislav Yes, workaround by @janusznowakowski worked for me. Thanks.

@hiromipaw
Copy link

Hi,
Although I have update ruby-build and rbenv to the latest version I am experiencing this issue.

$ rbenv install 2.2.0
Downloading ruby-2.2.0.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/7671e394abfb5d262fbcd3b27a71bf78737c7e9347fa21c39e58b0bb9c4840fc
Installing ruby-2.2.0...

BUILD FAILED (OS X 10.10.5 using ruby-build 20151028-8-g25371c6)

Inspect or clean up the working tree at /var/folders/pt/1bt8d33d6f560gnyc9jy9rpr0000gn/T/ruby-build.20151113145051.19198
Results logged to /var/folders/pt/1bt8d33d6f560gnyc9jy9rpr0000gn/T/ruby-build.20151113145051.19198.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/Users/hiro/.rbenv/versions/2.2.0/lib "
make: *** No targets specified and no makefile found.  Stop.

I have also tried the suggested work around but I am still experiencing this.

Reporting also logs:

$ cat /var/folders/pt/1bt8d33d6f560gnyc9jy9rpr0000gn/T/ruby-build.20151113150550.23950.log
/var/folders/pt/1bt8d33d6f560gnyc9jy9rpr0000gn/T/ruby-build.20151113150550.23950 ~/.rbenv/plugins/ruby-build
HTTP/1.1 200 OK
Content-Type: binary/octet-stream
Content-Length: 16613636
Connection: keep-alive
Date: Tue, 10 Nov 2015 23:08:14 GMT
Last-Modified: Mon, 13 Apr 2015 20:10:53 GMT
ETag: "326e99ddc75381c7b50c85f7089f3260"
Accept-Ranges: bytes
Server: AmazonS3
Age: 16898
X-Cache: Hit from cloudfront
Via: 1.1 453967c146678453a641464c7ad8eab6.cloudfront.net (CloudFront)
X-Amz-Cf-Id: -nk9xiIwvbVIVi1JqqvTU1q4fG6_9vNMIEvWCJNs_ZBQr4oOjq9NJw==

/var/folders/pt/1bt8d33d6f560gnyc9jy9rpr0000gn/T/ruby-build.20151113150550.23950/ruby-2.2.2 /var/folders/pt/1bt8d33d6f560gnyc9jy9rpr0000gn/T/ruby-build.20151113150550.23950 ~/.rbenv/plugins/ruby-build
config.guess already exists
config.sub already exists
checking build system type... x86_64-apple-darwin14.5.0
checking host system type... x86_64-apple-darwin14.5.0
checking target system type... x86_64-apple-darwin14.5.0
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether clang accepts -g... yes
checking for clang option to accept ISO C89... none needed
checking whether we are using the GNU C++ compiler... yes
checking whether clang++ accepts -g... yes
checking how to run the C preprocessor... clang -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking whether clang needs -traditional... no
checking for ld... ld
checking whether the linker is GNU ld... no
checking whether clang -E accepts -o... yes
checking for real target cpu... x86_64
checking for ranlib... ranlib
checking for ar... ar
checking for as... as
checking for objdump... no
checking for gobjdump... no
checking for objcopy... no
checking for gobjcopy... no
checking for nm... nm
checking whether ln -s works... yes
checking whether make sets $(MAKE)... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking for a thread-safe mkdir -p...  -d
use 'mkdir -p' as MKDIR_P
checking for dtrace... dtrace
checking for dot... dot
checking for doxygen... no
checking for pkg-config... pkg-config
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
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/hiro/.rbenv/versions/2.2.2/lib "
make: *** No targets specified and no makefile found.  Stop.

@hiromipaw
Copy link

Ok, I have updated to Macosx 10.11 and it seems to work now...

@mislav
Copy link
Member

mislav commented Nov 13, 2015

I have updated to Macosx 10.11 and it seems to work now...

@hiromipaw That's strange, but I'm glad you worked around your problem!

@pkqk
Copy link

pkqk commented Nov 16, 2015

This error just surfaced for me as well. Strange as I'd only just set up a brand new rbenv install on since upgrading to OSX 10.11

It worked about 2 weeks ago but this was the first time since then I needed to install a new ruby. I've not updated rbenv or ruby-build, I have updated homebrew and OSX has possibly run some updates in the background but I'm not sure, there is an XCode update in the list, could that be a culprit.

Can confirm that mkdir -p ~/.rbenv/versions/2.1.0/lib fixed it though. brew upgrade ruby-build has also helped (upgraded to 20151028)

@lacostenycoder
Copy link

I'm having problems installing any versions of ruby with ruby-build latest and current master of rbenv. This is pretty bad. See rbenv/ruby-build#859

@mla
Copy link

mla commented Jan 20, 2016

Colleague ran into the same problem with 2.1.0 on El Capitan. Manual mkdir also fixed it.

@mislav
Copy link
Member

mislav commented Jan 20, 2016

@mla 2.1.0 had a problem, but has been fixed in recent versions of ruby-build. Make sure your colleague updates!

@tonyarnold
Copy link

Mine wasn't working because there was no /usr/local/lib directory (none of my brew formulae needed it). Creating it and re-running the install fixed the issue for me.

@douglasdd
Copy link

(comment added for wider google-ability for problems other than this issue)

For the record, the same fix helped rvm install 2.3.1 (where there was no rvm known ruby 2.3.1 binary & it had to compile it itself).

$ rvm install 2.3.1
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.11/x86_64/ruby-2.3.1.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
...
<elided>
...
ruby-2.3.1 - #extracting ruby-2.3.1 to /Users/ddd/.rvm/src/ruby-2.3.1....
ruby-2.3.1 - #configuring......
Error running './configure --prefix=/Users/ddd/.rvm/rubies/ruby-2.3.1 --with-opt-dir=/opt/local --disable-install-doc --enable-shared',
showing last 15 lines of /Users/ddd/.rvm/log/1468957690_ruby-2.3.1/configure.log
...
<elided>
...
checking whether CFLAGS is valid... yes
checking whether LDFLAGS is valid... no
configure: error: something wrong with LDFLAGS="-L/sw/lib -L/usr/local/lib -L/usr/lib -L/lib -I/usr/X11R6/include -I/opt/X11/include -I/opt/local/include"
There has been an error while running configure. Halting the installation.

Setting LDFLAGS to only directories that existed allowed the configure;make;install to proceed normally.

@gnikyt
Copy link

gnikyt commented Oct 14, 2016

Can confirm. Whatever directory LDFLAGS referenced inside it, didn't exist. Creating it allowed for install to run fine.

@kazhian
Copy link

kazhian commented Jul 25, 2017

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/PAC?ckq4/.rbenv/versions/2.4.0/lib "
make: *** No targets specified and no makefile found. Stop.

I get above error. It is because my user folder name us PAC\xecckq4. As a result \xe is converted as ? and it fails.

Any solution? please

@vieko
Copy link

vieko commented Jun 8, 2018

this worked for me: rbenv/ruby-build#798

@dlqqq
Copy link

dlqqq commented Mar 30, 2021

TL;DR for people needing a quick fix:

LIBRARY_PATH="" rvm install X.X.X

@Chevel
Copy link

Chevel commented Jul 5, 2023

TL;DR for people needing a quick fix:

LIBRARY_PATH="" rvm install X.X.X

Doesn't work anymore :(
M1, macOS Ventura 13.4.1

@ignatius22
Copy link

mkdir -p /usr/local/opt/libffi/lib

This fixed it for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests