ruby-rice / rice

Ruby Interface for C++ Extensions
http://ruby-rice.github.io/
Other
378 stars 63 forks source link

Fail installation on macOS 10.14 Mojave. Due to Apple SDK location change #109

Closed vanitu closed 3 years ago

vanitu commented 6 years ago

I failed to install rice on latest macOS 10.14 Mojave and got error that file not found at /usr/include/iconv.h

The core reason is that Apple deprecate to use /usr/include anymore. pls see macOS 10.14 release notes https://developer.apple.com/documentation/xcode_release_notes/xcode_10_release_notes#3035624

There is a workaround for this macOS version only which will not be supported in next releases.

Dear rice maintainers pls take a note on this macOS 10.14 release note _The command line tools will search the SDK for system headers by default. However, some software may fail to build correctly against the SDK and require macOS headers to be installed in the base system under /usr/include. If you are the maintainer of such software, we encourage you to update your project to work with the SDK or file a bug report for issues that are preventing you from doing so. As a workaround, an extra package is provided which will install the headers to the base system. In a future release, this package will no longer be provided. You can find this package at: /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS10.14.pkg

Failure

Building native extensions. This could take a while...
ERROR:  Error installing rice:
    ERROR: Failed to build gem native extension.

    current directory: ...rvm/gems/ruby-2.5.3/gems/rice-2.1.2
...rvm/rubies/ruby-2.5.3/bin/ruby -r ./siteconf20181116-91112-zwca2m.rb extconf.rb
-----
The file "/usr/include/iconv.h" is missing in your build environment,
which means you haven't installed Xcode Command Line Tools properly.
To install Command Line Tools, try running `xcode-select --install` on
terminal and follow the instructions.  If it fails, open Xcode.app,
select from the menu "Xcode" - "Open Developer Tool" - "More Developer
Tools" to open the developer site, download the installer for your OS
version and run it.
-----

Current Workaround open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg this command will create required by rice /usr/include/* files

jasonroelofs commented 6 years ago

Thanks for the heads up. I recently merged in a change to how we look for iconv.h (https://github.com/jasonroelofs/rice/pull/108) that might already work around this change. However I have not yet built a new release. Can you try Rice from the master branch and see if this works for you?

jasonroelofs commented 3 years ago

Going to assume that this is fixed, though please re-open if the problem still exists.