rubygems / bundler

Manage your Ruby application's gem dependencies
https://bundler.io
MIT License
4.88k stars 2k forks source link

`bundle install` fails to build native extensions but it works with `gem install` #2648

Closed myronmarston closed 11 years ago

myronmarston commented 11 years ago

Trying to install the bundle for VCR on 1.8.7 (so I can troubleshoot a travis build failure), I'm getting weird behavior where bundle install repeatedly fails to build any native extension, but gem install builds it just fine. My shell output is below.

Any ideas?

➜  vcr git:(master) bundle install --system
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/.
Fetching source index from https://rubygems.org/
Resolving dependencies...
Installing rake (10.1.0)
Installing addressable (2.3.5)
Using bundler (1.3.5)
Installing appraisal (0.5.2)
Installing archive-tar-minitar (0.5.2)
Using ffi (1.9.0)
Installing childprocess (0.3.9)
Installing builder (3.2.2)
Installing diff-lcs (1.2.4)
Installing multi_json (1.8.0)
Installing gherkin (2.12.1)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for main() in -lc... no
creating Makefile

make
xcrun cc -I. -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin12.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -fno-common -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE  -fno-common  -pipe -fno-common   -c gherkin_lexer_ar.c
xcode-select: Error: No Xcode is selected. Use xcode-select -switch <path-to-xcode>, or see the xcode-select manpage (man xcode-select) for further information.
make: *** [gherkin_lexer_ar.o] Error 2

Gem files will remain installed in /Users/myron/.gem/ruby/1.8.7/gems/gherkin-2.12.1 for inspection.
Results logged to /Users/myron/.gem/ruby/1.8.7/gems/gherkin-2.12.1/ext/gherkin_lexer_ar/gem_make.out

An error occurred while installing gherkin (2.12.1), and Bundler cannot continue.
Make sure that `gem install gherkin -v '2.12.1'` succeeds before bundling.
➜  vcr git:(master) gem list

*** LOCAL GEMS ***

addressable (2.3.5)
appraisal (0.5.2)
archive-tar-minitar (0.5.2)
builder (3.2.2)
bundler (1.3.5)
childprocess (0.3.9)
diff-lcs (1.2.4)
ffi (1.9.0)
multi_json (1.8.0)
rake (10.1.0)
➜  vcr git:(master) gem install
➜  vcr git:(master) gem install gherkin -v '2.12.1'
Building native extensions.  This could take a while...
Successfully installed gherkin-2.12.1
Installing ri documentation for gherkin-2.12.1
/Users/myron/.rubies/ruby-1.8.7-p374/lib/ruby/1.8/rdoc/rdoc.rb:280: warning: conflicting chdir during another chdir block
/Users/myron/.rubies/ruby-1.8.7-p374/lib/ruby/1.8/rdoc/rdoc.rb:287: warning: conflicting chdir during another chdir block
Done installing documentation for gherkin after 63 seconds
1 gem installed
➜  vcr git:(master) bundle install --system
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using rake (10.1.0)
Using addressable (2.3.5)
Using bundler (1.3.5)
Using appraisal (0.5.2)
Using archive-tar-minitar (0.5.2)
Using ffi (1.9.0)
Using childprocess (0.3.9)
Using builder (3.2.2)
Using diff-lcs (1.2.4)
Using multi_json (1.8.0)
Using gherkin (2.12.1)
Installing multi_test (0.0.2)
Installing cucumber (1.3.8)
Installing rspec-expectations (2.14.2)
Installing aruba (0.5.3)
Installing coderay (1.0.9)
Installing columnize (0.3.6)
Installing cookiejar (0.3.0)
Installing safe_yaml (0.9.7)
Installing crack (0.4.1)
Installing curb (0.8.4)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for curl-config... yes
checking for curlinfo_redirect_time... no
checking for curlinfo_response_code... no
checking for curlinfo_filetime... no
checking for curlinfo_redirect_count... no
checking for curlinfo_os_errno... no
checking for curlinfo_num_connects... no
checking for curlinfo_ftp_entry_path... no
checking for curl_version_ssl... no
checking for curl_version_libz... no
checking for curl_version_ntlm... no
checking for curl_version_gssnegotiate... no
checking for curl_version_debug... no
checking for curl_version_asynchdns... no
checking for curl_version_spnego... no
checking for curl_version_largefile... no
checking for curl_version_idn... no
checking for curl_version_sspi... no
checking for curl_version_conv... no
checking for curlproxy_http... no
checking for curlproxy_socks4... no
checking for curlproxy_socks5... no
checking for curlauth_basic... no
checking for curlauth_digest... no
checking for curlauth_gssnegotiate... no
checking for curlauth_ntlm... no
checking for curlauth_anysafe... no
checking for curlauth_any... no
checking for curle_tftp_notfound... no
checking for curle_tftp_perm... no
checking for curle_tftp_diskfull... no
checking for curle_tftp_illegal... no
checking for curle_tftp_unknownid... no
checking for curle_tftp_exists... no
checking for curle_tftp_nosuchuser... no
checking for curle_send_fail_rewind... no
checking for curle_ssl_engine_initfailed... no
checking for curle_login_denied... no
checking for curlmopt_maxconnects... no
checking for curlopt_seekfunction... no
checking for curlopt_seekdata... no
checking for curlopt_sockoptfunction... no
checking for curlopt_sockoptdata... no
checking for curlopt_opensocketfunction... no
checking for curlopt_opensocketdata... no
checking for curle_conv_failed... no
checking for curle_conv_reqd... no
checking for curle_ssl_cacert_badfile... no
checking for curle_remote_file_not_found... no
checking for curle_ssh... no
checking for curle_ssl_shutdown_failed... no
checking for curle_again... no
checking for curle_ssl_crl_badfile... no
checking for curle_ssl_issuer_error... no
checking for curlinfo_redirect_url... no
checking for curlopt_username... no
checking for curlopt_password... no
checking for curlinfo_primary_ip... no
checking for curlauth_digest_ie... no
checking for curlftpmethod_multicwd... no
checking for curlftpmethod_nocwd... no
checking for curlftpmethod_singlecwd... no
checking for curlm_bad_socket... no
checking for curlm_unknown_option... no
checking for curl_multi_timeout()... no
checking for curl_multi_fdset()... no
checking for curl_multi_perform()... no
checking for curlopt_interleavefunction... no
checking for curlopt_interleavedata... no
checking for curlopt_chunk_bgn_function... no
checking for curlopt_chunk_end_function... no
checking for curlopt_chunk_data... no
checking for curlopt_fnmatch_function... no
checking for curlopt_fnmatch_data... no
checking for curlopt_errorbuffer... no
checking for curlopt_stderr... no
checking for curlopt_failonerror... no
checking for curlopt_url... no
checking for curlopt_protocols... no
checking for curlopt_redir_protocols... no
checking for curlopt_proxy... no
checking for curlopt_proxyport... no
checking for curlopt_proxytype... no
checking for curlopt_noproxy... no
checking for curlopt_httpproxytunnel... no
checking for curlopt_socks5_gssapi_service... no
checking for curlopt_socks5_gssapi_nec... no
checking for curlopt_interface... no
checking for curlopt_localport... no
checking for curlopt_dns_cache_timeout... no
checking for curlopt_dns_use_global_cache... no
checking for curlopt_buffersize... no
checking for curlopt_port... no
checking for curlopt_tcp_nodelay... no
checking for curlopt_address_scope... no
checking for curlopt_netrc... no
checking for curl_netrc_optional... no
checking for curl_netrc_ignored... no
checking for curl_netrc_required... no
checking for curlopt_netrc_file... no
checking for curlopt_userpwd... no
checking for curlopt_proxyuserpwd... no
checking for curlopt_username... no
checking for curlopt_password... no
checking for curlopt_password... no
checking for curlopt_password... no
checking for curlopt_httpauth... no
checking for curlauth_digest_ie... no
checking for curlauth_only... no
checking for curlopt_tlsauth_type... no
checking for curlopt_tlsauth_srp... no
checking for curlopt_tlsauth_username... no
checking for curlopt_tlsauth_password... no
checking for curlopt_proxyauth... no
checking for curlopt_autoreferer... no
checking for curlopt_encoding... no
checking for curlopt_followlocation... no
checking for curlopt_unrestricted_auth... no
checking for curlopt_maxredirs... no
checking for curlopt_postredir... no
checking for curlopt_put... no
checking for curlopt_post... no
checking for curlopt_postfields... no
checking for curlopt_postfieldsize... no
checking for curlopt_postfieldsize_large... no
checking for curlopt_copypostfields... no
checking for curlopt_httppost... no
checking for curlopt_referer... no
checking for curlopt_useragent... no
checking for curlopt_httpheader... no
checking for curlopt_http200aliases... no
checking for curlopt_cookie... no
checking for curlopt_cookiefile... no
checking for curlopt_cookiejar... no
checking for curlopt_cookiesession... no
checking for curlopt_cookielist... no
checking for curlopt_httpget... no
checking for curlopt_http_version... no
checking for curl_http_version_none... no
checking for curl_http_version_1_0... no
checking for curl_http_version_1_1... no
checking for curlopt_ignore_content_length... no
checking for curlopt_http_content_decoding... no
checking for curlopt_http_transfer_decoding... no
checking for curlopt_mail_from... no
checking for curlopt_mail_rcpt... no
checking for curlopt_tftp_blksize... no
checking for curlopt_ftpport... no
checking for curlopt_quote... no
checking for curlopt_postquote... no
checking for curlopt_prequote... no
checking for curlopt_dirlistonly... no
checking for curlopt_append... no
checking for curlopt_ftp_use_eprt... no
checking for curlopt_ftp_use_epsv... no
checking for curlopt_ftp_use_pret... no
checking for curlopt_ftp_create_missing_dirs... no
checking for curlopt_ftp_response_timeout... no
checking for curlopt_ftp_alternative_to_user... no
checking for curlopt_ftp_skip_pasv_ip... no
checking for curlopt_ftpsslauth... no
checking for curlftpauth_default... no
checking for curlftpauth_ssl... no
checking for curlftpauth_tls... no
checking for curlopt_ftp_ssl_ccc... no
checking for curlftpssl_ccc_none... no
checking for curlftpssl_ccc_passive... no
checking for curlftpssl_ccc_active... no
checking for curlopt_ftp_account... no
checking for curlopt_ftp_filemethod... no
checking for curlftpmethod_multicwd... no
checking for curlftpmethod_nocwd... no
checking for curlftpmethod_singlecwd... no
checking for curlopt_rtsp_request... no
checking for curl_rtspreq_options... no
checking for curl_rtspreq_describe... no
checking for curl_rtspreq_announce... no
checking for curl_rtspreq_setup... no
checking for curl_rtspreq_play... no
checking for curl_rtspreq_pause... no
checking for curl_rtspreq_teardown... no
checking for curl_rtspreq_get_parameter... no
checking for curl_rtspreq_set_parameter... no
checking for curl_rtspreq_record... no
checking for curl_rtspreq_receive... no
checking for curlopt_rtsp_session_id... no
checking for curlopt_rtsp_stream_uri... no
checking for curlopt_rtsp_transport... no
checking for curlopt_rtsp_header... no
checking for curlopt_rtsp_client_cseq... no
checking for curlopt_rtsp_server_cseq... no
checking for curlopt_transfertext... no
checking for curlopt_proxy_transfer_mode... no
checking for curlopt_crlf... no
checking for curlopt_range... no
checking for curlopt_resume_from... no
checking for curlopt_resume_from_large... no
checking for curlopt_customrequest... no
checking for curlopt_filetime... no
checking for curlopt_nobody... no
checking for curlopt_infilesize... no
checking for curlopt_infilesize_large... no
checking for curlopt_upload... no
checking for curlopt_maxfilesize... no
checking for curlopt_maxfilesize_large... no
checking for curlopt_timecondition... no
checking for curlopt_timevalue... no
checking for curlopt_timeout... no
checking for curlopt_timeout_ms... no
checking for curlopt_low_speed_limit... no
checking for curlopt_low_speed_time... no
checking for curlopt_max_send_speed_large... no
checking for curlopt_max_recv_speed_large... no
checking for curlopt_maxconnects... no
checking for curlopt_closepolicy... no
checking for curlopt_fresh_connect... no
checking for curlopt_forbid_reuse... no
checking for curlopt_connecttimeout... no
checking for curlopt_connecttimeout_ms... no
checking for curlopt_ipresolve... no
checking for curl_ipresolve_whatever... no
checking for curl_ipresolve_v4... no
checking for curl_ipresolve_v6... no
checking for curlopt_connect_only... no
checking for curlopt_use_ssl... no
checking for curlusessl_none... no
checking for curlusessl_try... no
checking for curlusessl_control... no
checking for curlusessl_all... no
checking for curlopt_resolve... no
checking for curlopt_sslcert... no
checking for curlopt_sslcerttype... no
checking for curlopt_sslkey... no
checking for curlopt_sslkeytype... no
checking for curlopt_keypasswd... no
checking for curlopt_sslengine... no
checking for curlopt_sslengine_default... no
checking for curlopt_sslversion... no
checking for curl_sslversion_default... no
checking for CURL_SSLVERSION_TLSv1... no
checking for CURL_SSLVERSION_SSLv2... no
checking for CURL_SSLVERSION_SSLv3... no
checking for curlopt_ssl_verifypeer... no
checking for curlopt_cainfo... no
checking for curlopt_issuercert... no
checking for curlopt_capath... no
checking for curlopt_crlfile... no
checking for curlopt_ssl_verifyhost... no
checking for curlopt_certinfo... no
checking for curlopt_random_file... no
checking for curlopt_egdsocket... no
checking for curlopt_ssl_cipher_list... no
checking for curlopt_ssl_sessionid_cache... no
checking for curlopt_krblevel... no
checking for curlopt_ssh_auth_types... no
checking for curlopt_ssh_host_public_key_md5... no
checking for curlopt_ssh_public_keyfile... no
checking for curlopt_ssh_private_keyfile... no
checking for curlopt_ssh_knownhosts... no
checking for curlopt_ssh_keyfunction... no
checking for curlkhstat_fine_add_to_file... no
checking for curlkhstat_fine... no
checking for curlkhstat_reject... no
checking for curlkhstat_defer... no
checking for curlopt_ssh_keydata... no
checking for curlopt_private... no
checking for curlopt_share... no
checking for curlopt_new_file_perms... no
checking for curlopt_new_directory_perms... no
checking for curlopt_telnetoptions... no
checking for curle_not_built_in... no
checking for curle_obsolete... no
checking for Ruby 1.9 Hash... no
checking for Ruby 1.9 st.h... no
checking for curl_easy_escape... no
checking for rb_thread_blocking_region()... no
creating curb_config.h
creating Makefile

make
xcrun cc -I. -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin12.0 -I. -DRUBY_EXTCONF_H=\"curb_config.h\"  -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -fno-common -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE  -fno-common  -pipe -fno-common   -g  -c curb.c
xcode-select: Error: No Xcode is selected. Use xcode-select -switch <path-to-xcode>, or see the xcode-select manpage (man xcode-select) for further information.
make: *** [curb.o] Error 2

Gem files will remain installed in /Users/myron/.gem/ruby/1.8.7/gems/curb-0.8.4 for inspection.
Results logged to /Users/myron/.gem/ruby/1.8.7/gems/curb-0.8.4/ext/gem_make.out

An error occurred while installing curb (0.8.4), and Bundler cannot continue.
Make sure that `gem install curb -v '0.8.4'` succeeds before bundling.
➜  vcr git:(master) gem install curb -v '0.8.4'
Building native extensions.  This could take a while...
Successfully installed curb-0.8.4
Installing ri documentation for curb-0.8.4
/Users/myron/.rubies/ruby-1.8.7-p374/lib/ruby/1.8/rdoc/rdoc.rb:280: warning: conflicting chdir during another chdir block
/Users/myron/.rubies/ruby-1.8.7-p374/lib/ruby/1.8/rdoc/rdoc.rb:287: warning: conflicting chdir during another chdir block
Done installing documentation for curb after 1 seconds
1 gem installed
➜  vcr git:(master) bundle install --system
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using rake (10.1.0)
Using addressable (2.3.5)
Using bundler (1.3.5)
Using appraisal (0.5.2)
Using archive-tar-minitar (0.5.2)
Using ffi (1.9.0)
Using childprocess (0.3.9)
Using builder (3.2.2)
Using diff-lcs (1.2.4)
Using multi_json (1.8.0)
Using gherkin (2.12.1)
Using multi_test (0.0.2)
Using cucumber (1.3.8)
Using rspec-expectations (2.14.2)
Using aruba (0.5.3)
Using coderay (1.0.9)
Using columnize (0.3.6)
Using cookiejar (0.3.0)
Using safe_yaml (0.9.7)
Using crack (0.4.1)
Using curb (0.8.4)
Installing eventmachine (1.0.3)
Installing em-socksify (0.3.0)
Installing http_parser.rb (0.6.0.beta.2)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
creating Makefile

make
xcrun cc -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin12.0 -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin12.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -fno-common -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE  -fno-common  -pipe -fno-common  -I/Users/myron/.gem/ruby/1.8.7/gems/http_parser.rb-0.6.0.beta.2/ext/ruby_http_parser  -c ruby_http_parser.c
xcode-select: Error: No Xcode is selected. Use xcode-select -switch <path-to-xcode>, or see the xcode-select manpage (man xcode-select) for further information.
make: *** [ruby_http_parser.o] Error 2

Gem files will remain installed in /Users/myron/.gem/ruby/1.8.7/gems/http_parser.rb-0.6.0.beta.2 for inspection.
Results logged to /Users/myron/.gem/ruby/1.8.7/gems/http_parser.rb-0.6.0.beta.2/ext/ruby_http_parser/gem_make.out

An error occurred while installing http_parser.rb (0.6.0.beta.2), and Bundler cannot continue.
Make sure that `gem install http_parser.rb -v '0.6.0.beta.2'` succeeds before bundling.
➜  vcr git:(master) gem install http_parser.rb -v '0.6.0.beta.2'
Building native extensions.  This could take a while...
Successfully installed http_parser.rb-0.6.0.beta.2
Installing ri documentation for http_parser.rb-0.6.0.beta.2
/Users/myron/.rubies/ruby-1.8.7-p374/lib/ruby/1.8/rdoc/rdoc.rb:280: warning: conflicting chdir during another chdir block
/Users/myron/.rubies/ruby-1.8.7-p374/lib/ruby/1.8/rdoc/rdoc.rb:287: warning: conflicting chdir during another chdir block
Done installing documentation for http_parser.rb after 0 seconds
1 gem installed
➜  vcr git:(master) bundle install --system
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using rake (10.1.0)
Using addressable (2.3.5)
Using bundler (1.3.5)
Using appraisal (0.5.2)
Using archive-tar-minitar (0.5.2)
Using ffi (1.9.0)
Using childprocess (0.3.9)
Using builder (3.2.2)
Using diff-lcs (1.2.4)
Using multi_json (1.8.0)
Using gherkin (2.12.1)
Using multi_test (0.0.2)
Using cucumber (1.3.8)
Using rspec-expectations (2.14.2)
Using aruba (0.5.3)
Using coderay (1.0.9)
Using columnize (0.3.6)
Using cookiejar (0.3.0)
Using safe_yaml (0.9.7)
Using crack (0.4.1)
Using curb (0.8.4)
Using eventmachine (1.0.3)
Using em-socksify (0.3.0)
Using http_parser.rb (0.6.0.beta.2)
Installing em-http-request (1.1.0)
Installing mime-types (1.25)
Installing ethon (0.6.1)
Installing excon (0.26.0)
Installing fakeweb (1.3.0)
Installing multipart-post (1.2.0)
Installing faraday (0.8.8)
Installing rspec-core (2.14.5)
Installing rspec-mocks (2.14.3)
Installing rspec (2.14.1)
Installing rspec-instafail (0.2.4)
Installing ruby-progressbar (1.0.2)
Installing fuubar (1.2.1)
Installing fuubar-cucumber (0.0.20)
Installing github-markup (0.7.5)
Installing httpclient (2.3.4.1)
Installing json (1.8.0)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
creating Makefile

make
xcrun cc -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin12.0 -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin12.0 -I. -DJSON_GENERATOR  -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -fno-common -arch i386 -arch x86_64 -g -O3 -pipe -fno-common -DENABLE_DTRACE  -fno-common  -pipe -fno-common   -c generator.c
xcode-select: Error: No Xcode is selected. Use xcode-select -switch <path-to-xcode>, or see the xcode-select manpage (man xcode-select) for further information.
make: *** [generator.o] Error 2

Gem files will remain installed in /Users/myron/.gem/ruby/1.8.7/gems/json-1.8.0 for inspection.
Results logged to /Users/myron/.gem/ruby/1.8.7/gems/json-1.8.0/ext/json/ext/generator/gem_make.out

An error occurred while installing json (1.8.0), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.0'` succeeds before bundling.
➜  vcr git:(master) gem install
➜  vcr git:(master) gem install json -v '1.8.0'
Building native extensions.  This could take a while...
Successfully installed json-1.8.0
Installing ri documentation for json-1.8.0
/Users/myron/.rubies/ruby-1.8.7-p374/lib/ruby/1.8/rdoc/rdoc.rb:280: warning: conflicting chdir during another chdir block
/Users/myron/.rubies/ruby-1.8.7-p374/lib/ruby/1.8/rdoc/rdoc.rb:287: warning: conflicting chdir during another chdir block
Done installing documentation for json after 1 seconds
1 gem installed
indirect commented 11 years ago

Based on the output complaining about xcode-select, it sounds like you have an interesting OS X build environment issue. Have you tried running the command as requested by the log?

TimMoore commented 11 years ago

It looks like when you run bundler, it's using the Mac OS X system Ruby (/usr/bin/ruby) but when using gem it is using a Ruby 1.8.7 installed in ~/.rubies.

When building native extensions for the system Ruby, you need to have the full XCode installed: just the command-line tools alone don't work.

I'd bet that the problem is that Bundler itself is installed as gem under the system Ruby, rather than the one in ~/.rubies.

myronmarston commented 11 years ago

Thanks @TimMoore -- it looks like that was the problem. Not sure how I got in that state but I reinstalled my 1.8.7 and now it works.