Link against MacPorts Ruby instead of system Ruby

Christopher Jones jonesc at hep.phy.cam.ac.uk
Sat Apr 26 07:21:14 PDT 2014


p.s.

You probably also should use the -I option, to tell gcc to take the ruby includes from /opt/local/include/ruby-2.1.0/ as well, otherwise it will pick up the system ones, and thus there will be a miss match.

On 26 Apr 2014, at 3:16pm, Christopher Jones <jonesc at hep.phy.cam.ac.uk> wrote:

> Hi,
> 
> You need to use the -L option to tell the linker to look in your MacPorts installation. 
> 
> Also, if you want a particular ruby version, it would be better I think to explicitly link against that, rather than relying on what ‘libruby’ point to
> 
> so (if your installation is in the default prefix) use
> 
> -L/opt/local/lib -lruby.2.1
> 
> Chris
> 
> On 26 Apr 2014, at 2:55pm, Kevin Walzer <kw at codebykevin.com> wrote:
> 
>> On Mavericks, I am developing a tool that uses an embedded Ruby interpreter and am trying to link it against my MacPorts installation of Ruby 2.1. However, while it successfully builds and runs with the following command:
>> 
>> gcc -Wall -v -o test test.c -lruby
>> 
>> it is linked against the system Ruby, 2.0. (Apple has apparently replaced MacRuby with standard Ruby in Mavericks.)
>> 
>> Can anyone suggest the correct command-line invocation to point my tool at MacPorts Ruby instead?
>> 
>> --Kevin
>> -- 
>> Kevin Walzer
>> Code by Kevin/Mobile Code by Kevin
>> http://www.codebykevin.com
>> http://www.wtmobilesoftware.com
>> _______________________________________________
>> macports-users mailing list
>> macports-users at lists.macosforge.org
>> https://lists.macosforge.org/mailman/listinfo/macports-users
> 
> _______________________________________________
> macports-users mailing list
> macports-users at lists.macosforge.org
> https://lists.macosforge.org/mailman/listinfo/macports-users

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2030 bytes
Desc: not available
URL: <https://lists.macosforge.org/pipermail/macports-users/attachments/20140426/bbb7e4ac/attachment.p7s>


More information about the macports-users mailing list