Hi,

You should try looking around in the includes directory a bit ….

ruby/config.h exists in

/opt/local/include/ruby-2.1.0/x86_64-darwin13

so it looks like you need to add

-I/opt/local/include/ruby-2.1.0/x86_64-darwin13

to your compilation command. No idea if this is normal ruby behaviour, as I 
said I am not a user or ruby.

Chris

On 26 Apr 2014, at 7:00pm, Christopher Jones <[email protected]> wrote:

> Hi,
> 
> ( Why do you have -I/opt/local/include/ruby-2.1.0/ twice ? )
> 
> Looking at
> 
> MacBookPro /opt/local/include/ruby-2.1.0 > ls
> ruby          ruby.h          x86_64-darwin13
> 
> I see there is a ruby.h there. This file sets various things then includes 
> <ruby/ruby.h>
> 
> I not a user of ruby, so I am guessing here, but what happens if you include
> 
> #include <ruby.h>
> 
> instead, to pick up /opt/local/include/ruby-2.1.0/ruby.h
> 
> ?
> 
> Chris
> 
> 
> 
> 
> On 26 Apr 2014, at 5:59pm, Kevin Walzer <[email protected]> wrote:
> 
>> On 4/26/14, 12:27 PM, Chris Jones wrote:
>>> Do you not include any ruby headers in your code ? If you do, you should 
>>> make sure to pick those matching the library you are using. It might well 
>>> work without, but that will be just by pure chance..
>> 
>> Just this:
>> 
>> #include <ruby/ruby.h>
>> 
>> If I use the "-I" flag, like so:
>> 
>> gcc -Wall -v -o run run.c -L/opt/local/lib -lruby.2.1 
>> -I/opt/local/include/ruby-2.1.0/ -I/opt/local/include/ruby-2.1.0/
>> 
>> then it fails to compile, with this error:
>> 
>> #include <...> search starts here:
>> /opt/local/include/ruby-2.1.0
>> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/5.1/include
>> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
>> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include
>> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks
>>  (framework directory)
>> End of search list.
>> In file included from run.c:1:
>> /opt/local/include/ruby-2.1.0/ruby/ruby.h:24:10: fatal error: 'ruby/config.h'
>>     file not found
>> #include "ruby/config.h"
>>        ^
>> 
>> Ruby seems to have a convoluted batch of headers; multiple versions of 
>> "ruby.h" are located in the tree for reasons unknown to me. I've seen this 
>> error before when trying to compile against MacPorts Ruby and trying to 
>> guess at the include path.
>> 
>> Any suggestions, especially when the other invocation works as expected?
>> 
>> --Kevin
>> 
>> -- 
>> Kevin Walzer
>> Code by Kevin/Mobile Code by Kevin
>> http://www.codebykevin.com
>> http://www.wtmobilesoftware.com
> 
> _______________________________________________
> macports-users mailing list
> [email protected]
> https://lists.macosforge.org/mailman/listinfo/macports-users

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
macports-users mailing list
[email protected]
https://lists.macosforge.org/mailman/listinfo/macports-users

Reply via email to