Can't install with Command Line Tools for XCode 4.3 #31

Closed
endersonmaia opened this Issue Mar 2, 2012 · 18 comments

Projects

None yet

9 participants

@endersonmaia

I removed the bloated XCode (sudo /Developer/Library/uninstall-devtools –mode=all) in favor of Apple's "Command Line Tools for XCode 4.3" package.

But I get this errors when trying to install rb-fsevent.

$ gem install rb-fsevent -v '0.4.3.1'
Building native extensions.  This could take a while...
ERROR:  Error installing rb-fsevent:
    ERROR: Failed to build gem native extension.

        /usr/local/Cellar/ruby/1.9.3-p0/bin/ruby extconf.rb
creating Makefile
CFLAGS='-isysroot //SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.7 -mdynamic-no-pic -std=gnu99 -Os -pipe -Wmissing-prototypes -Wreturn-type -Wmissing-braces -Wparentheses -Wswitch -Wunused-function -Wunused-label -Wunused-parameter -Wunused-variable -Wunused-value -Wuninitialized -Wunknown-pragmas -Wshadow -Wfour-char-constants -Wsign-compare -Wnewline-eof -Wconversion -Wshorten-64-to-32 -Wglobal-constructors -pedantic' /usr/bin/clang -isysroot //SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.7 -mdynamic-no-pic -std=gnu99 -dead_strip -framework CoreServices -o '/usr/local/lib/ruby/gems/1.9.1/gems/rb-fsevent-0.4.3.1/bin/fsevent_watch' fsevent/fsevent_watch.c
fsevent/fsevent_watch.c:1:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
         ^
1 error generated.
extconf.rb:59:in `<main>': Compilation of fsevent_watch failed (see README) (RuntimeError)


Gem files will remain installed in /usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rb-fsevent-0.4.3.1 for inspection.
Results logged to /usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rb-fsevent-0.4.3.1/ext/gem_make.out

I used the xcode-select to witch the XCode path, and change it to /, since I could not find any /Developer/ ou /Developer/MacOSX10.7.sdk folder.

@endersonmaia

I just ignored -isysroot //SDKs/MacOSX10.7.sdk param on extconf.rb, and I could run ruby extconf.rb fine.

I just don't know yet how to proceed with gem installation after changing the extconf.rb.

@ttilley
Collaborator
ttilley commented Mar 2, 2012

There should really be an apple support forum for this. The problem is incredibly common. Search for other bugs for Xcode 4.3 and you'll find a closed one with the solution you seek.

Sent from my iPhone

On Mar 1, 2012, at 8:45 PM, Enderson Maiareply@reply.github.com wrote:

I removed the bloated XCode (sudo /Developer/Library/uninstall-devtools –mode=all) in favor of Apple's "Command Line Tools for XCode 4.3" package.

But I get this errors when trying to install rb-fsevent.

$ gem install rb-fsevent -v '0.4.3.1'
Building native extensions.  This could take a while...
ERROR:  Error installing rb-fsevent:
   ERROR: Failed to build gem native extension.

       /usr/local/Cellar/ruby/1.9.3-p0/bin/ruby extconf.rb
creating Makefile
CFLAGS='-isysroot //SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.7 -mdynamic-no-pic -std=gnu99 -Os -pipe -Wmissing-prototypes -Wreturn-type -Wmissing-braces -Wparentheses -Wswitch -Wunused-function -Wunused-label -Wunused-parameter -Wunused-variable -Wunused-value -Wuninitialized -Wunknown-pragmas -Wshadow -Wfour-char-constants -Wsign-compare -Wnewline-eof -Wconversion -Wshorten-64-to-32 -Wglobal-constructors -pedantic' /usr/bin/clang -isysroot //SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.7 -mdynamic-no-pic -std=gnu99 -dead_strip -framework CoreServices -o '/usr/local/lib/ruby/gems/1.9.1/gems/rb-fsevent-0.4.3.1/bin/fsevent_watch' fsevent/fsevent_watch.c
fsevent/fsevent_watch.c:1:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
        ^
1 error generated.
extconf.rb:59:in `<main>': Compilation of fsevent_watch failed (see README) (RuntimeError)


Gem files will remain installed in /usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rb-fsevent-0.4.3.1 for inspection.
Results logged to /usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rb-fsevent-0.4.3.1/ext/gem_make.out

I used the xcode-select to witch the XCode path, and change it to /, since I could not find any /Developer/ ou /Developer/MacOSX10.7.sdk folder.


Reply to this email directly or view it on GitHub:
#31

@ttilley
Collaborator
ttilley commented Mar 3, 2012

...or you can use rb-fsevent 0.9.x which comes with a pre-compiled binary

@ttilley
Collaborator
ttilley commented Mar 3, 2012

dare i ask what package is depending on 0.4.x?

@barcahead

same problem. waiting for the solution for installing this without xcode

@endersonmaia

Installing 0.9.x works here

@ttilley
Collaborator
ttilley commented Mar 6, 2012

Please let me know what packages are depending on 0.4.x so that I can let their maintainers know 0.9.x is safe now, and version dependencies can be updated.

@ttilley
Collaborator
ttilley commented Mar 6, 2012

also, there's a bug filed on xcode command line tools: radr://10881681, "Installing Xcode 4.3 command tools doesn't set developer directory path"

If you have xcode installed, you need to sudo xcode-select -switch /Applications/Xcode.app. If you don't, then I guess you might need to sudo xcode-select / (since the command-line tools install to normal paths and have no funky path prefix). All I know is what's in the man page:

    As a convenience, for Xcode 4.3 and later, you can supply just the path to the Xcode
    application, e.g. "/Applications/Xcode.app", and xcode-select will determine the proper
    path to the Developer directory it contains.

Additionally, you may need to sudo chmod a+r /usr/share/xcode-select/xcode_dir_path, as this file should be world-readable but the tools don't always seem to get this part right. This second bug is filed as rdar://10893107, "xcode-select -switch sets wrong permissions on /usr/share/xcode-select/xcode_dir".

After all that, try to run xcrun -find clang or some such to see if the xcode-based tools are working and can find themselves.

Note: I'm only trying to give out useful advice obtained through pain and confusion. 0.4.x will still try to use a developer SDK that no longer exists. Rather, I don't believe the SDKs are part of the command-line tools install, and the build won't use the "current OS version" which doesn't need an SDK unless the right build variables are overridden. This is easy in 0.9.x's build, as I made it easy, but none of that work went into 0.4.x (also, 0.9.x comes with a pre-built binary so you don't need a compiler of any kind unless you really want to rebuild).

I could do another release of 0.4.x, but since this problem doesn't exist with 0.9.x, it would be easier and more helpful to find out which developers have dependencies on 0.4.x and have them update.

@endersonmaia

I saw that error when running bundler install for octopress, but
when I tryied it again it worked.

The Gemfile for octopress doesn't require any specific version.

I didn't succeeded repeating the require for 0.4.x, since I removed
rvm and reinstalled it with homebrew, and after this it worked.

@josharian

For the octopress setup, does it help if you bundle update before you bundle install? (That seemed to be the magic step for me, although I tried a lot of things, so I'm not 100% that was the one.) Alternatively, can you simply gem install rb-fsevent?

@endersonmaia

Like I said, it's working now with 0.9.x ,but I couldn't reproduce the error.

Forcing installation of the 0.4.3.1 version won't do the job.

If it's considered an issue, should be fixed in 0.4.x I think, if it won't be fixed in the 0.4.x (which I agree there's no need for, since it's fixed in newer versions) this issue should be closed, right ?

@josharian

@enderson yes, I think this issue should be closed.

What I was hoping to do (in my reply to you) was identify what steps it took to get Octopress to use 0.9.x instead of 0.4.x, so I could file an issue with them -- I think bundle update is the thing, and I was hoping you could confirm. Anyway, I've filed imathis/octopress#480.

@ttilley ttilley closed this Mar 12, 2012
@subdigital

If you've upgraded to Xcode 4.3, you need to tell the system where the new developer directory is. I had to run this to get this gem installed:

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/

Hope this helps others with the same error.

@MattMcComb

@josharian You're correct - executing 'bundle update' fetches fsevent 0.9.1 and fixes this problem.

@shanemaiolo

@subdigital Thanks for the Xcode select command, exactly what I needed.

@BenU
BenU commented Jul 22, 2012

@subdigital Thanks as well! Much positive karma sent your way.

@aeonaut
aeonaut commented Dec 1, 2012

Works for me! Wish I could vote you up, @subdigital.

@ttilley
Collaborator
ttilley commented Jan 23, 2013

why +1 a closed and fixed bug? Seriously. Read the history. Besides, all recent versions of rb-fsevent contain pre-compiled binaries for x86, x86-64, and ppc with support for all features from 10.6 on. the api hasn't even changed! move on for chrissake...

Hell, even if you're of the vocal minority on ppc 10.5, there are instructions at the top of the readme for how to recompile for your platform! If you're still having problems, it's not an rb-fsevent bug. It's some software you use not versioning rb-fsevent properly and thus depending on an ancient revision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment