# Rubynode won't build on Leopard Ruby

**URL:** <https://www.ruby-forum.com/t/rubynode-wont-build-on-leopard-ruby/129399>\
**Category:** Ruby\
**Created:** [February 18, 2008, 9:29am UTC](https://www.ruby-forum.com/t/rubynode-wont-build-on-leopard-ruby/129399 "2008-02-18T09:29:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rsanheim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/47e85d/32.png) [@rsanheim](https://www.ruby-forum.com/u/rsanheim)\
**Post date:** [February 18, 2008, 9:29am UTC](https://www.ruby-forum.com/t/rubynode-wont-build-on-leopard-ruby/129399/1 "2008-02-18T09:29:46Z")

</div>

I’m trying to build rubynode on a macports installed Ruby on Leopard,  
and failing. (I’m aware rubynode is one of the stock gems installed  
in leopard, but its out of date and my whole dev world is in macports,  
so I’d like to stay there)

I’ve tried grabbing the source for ruby p110, and setting the  
environment var before installation as instructed in the error message  
below. I inevitably hit further errors down the road. Any ideas?

rsanheim@ares:~$ ruby -v  
ruby 1.8.6 (2007-09-23 patchlevel 110) [i686-darwin9.0.0]

rsanheim@ares:~$ sudo gem install rubynode  
Building native extensions. This could take a while…  
ERROR: Error installing rubynode:  
ERROR: Failed to build gem native extension.

# /opt/local/bin/ruby extconf.rb install rubynode ==================== ERROR ===================== Please set RUBY\_SOURCE\_DIR to the source path of ruby 1.8.6 (2007-09-23)!

Gem files will remain installed in  
/opt/local/lib/ruby/gems/1.8/gems/rubynode-0.1.5 for inspection.  
Results logged to  
/opt/local/lib/ruby/gems/1.8/gems/rubynode-0.1.5/ext/rubynode\_ext/gem\_make.out

thanks,

- Rob

> **[Home](https://robsanheim.com/)**
>
> Just another WordPress site

> **[Cognitect, a Nu Holdings, Ltd. Company](https://cognitect.com/)**

---

<div class="post-metadata">

**Author:** ![rsanheim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/47e85d/32.png) [@rsanheim](https://www.ruby-forum.com/u/rsanheim)\
**Post date:** [February 18, 2008, 8:04pm UTC](https://www.ruby-forum.com/t/rubynode-wont-build-on-leopard-ruby/129399/2 "2008-02-18T20:04:04Z")

</div>

Hi Rob,

On Mon, 18 Feb 2008 09:29:08 +0100, Rob S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> I’m trying to build rubynode on a macports installed Ruby on Leopard,  
> and failing. (I’m aware rubynode is one of the stock gems installed  
> in leopard, but its out of date and my whole dev world is in macports,  
> so I’d like to stay there)
> 
> I’ve tried grabbing the source for ruby p110, and setting the  
> environment var before installation as instructed in the error message  
> below. I inevitably hit further errors down the road. Any ideas?

I just had a similar request last week and as a result I released a new  
version (0.1.5) with improved and more flexible version detection, which  
should work with 1.8.6-p110. Could you verify that gem tries to install  
that version. And if that isn’t the case please try downloading the gem  
manually and install it directly (gem install rubynode-0.1.5.gem).

I hope that helps.

Dominik

---

<div class="post-metadata">

**Author:** ![rsanheim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/47e85d/32.png) [@rsanheim](https://www.ruby-forum.com/u/rsanheim)\
**Post date:** [February 19, 2008, 4:54am UTC](https://www.ruby-forum.com/t/rubynode-wont-build-on-leopard-ruby/129399/3 "2008-02-19T04:54:48Z")

</div>

On Feb 18, 2008 2:01 PM, Dominik B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > environment var before installation as instructed in the error message  
> > Dominik  
> > Hi Dominik

I verified that gem does bring down the latest 0.1.5 version. It  
fails with the same error. I tried downloading the archive and  
installing manually, and still no luck:

# rsanheim@ares:~/Downloads$ sudo ruby rubynode-0.1.5/setup.rb —\> lib \<— lib —\> ext —\> ext/rubynode\_ext /opt/local/bin/ruby /Users/rsanheim/Downloads/rubynode-0.1.5/ext/rubynode\_ext/extconf.rb ==================== ERROR ===================== Please set RUBY\_SOURCE\_DIR to the source path of ruby 1.8.6 (2007-09-23)!

rubynode-0.1.5/setup.rb:655:in `command': system("/opt/local/bin/ruby" "/Users/rsanheim/Downloads/rubynode-0.1.5/ext/rubynode_ext/extconf.rb") failed (RuntimeError) from rubynode-0.1.5/setup.rb:660:in `ruby’  
from rubynode-0.1.5/setup.rb:1238:in `extconf' from rubynode-0.1.5/setup.rb:1230:in `config\_dir\_ext’  
from rubynode-0.1.5/setup.rb:1532:in ` __send__' from rubynode-0.1.5/setup.rb:1532:in `traverse’  
from rubynode-0.1.5/setup.rb:1549:in `dive_into' from rubynode-0.1.5/setup.rb:1530:in `traverse’  
from rubynode-0.1.5/setup.rb:1534:in `traverse' ... 8 levels... from rubynode-0.1.5/setup.rb:991:in `exec\_config’  
from rubynode-0.1.5/setup.rb:812:in `invoke' from rubynode-0.1.5/setup.rb:773:in `invoke’  
from rubynode-0.1.5/setup.rb:1578

After switching to root and setting the ruby source dir env var again,  
I get this new error when trying to do setup.rb:

ares:Downloads root# ruby rubynode-0.1.5/setup.rb  
—\> lib  
\<— lib  
—\> ext  
—\> ext/rubynode\_ext  
/opt/local/bin/ruby  
/Users/rsanheim/Downloads/rubynode-0.1.5/ext/rubynode\_ext/extconf.rb  
==================== ERROR =====================  
/opt/local/lib/ruby/1.8/i686-darwin9.0.0/node.h  
is different from  
/Users/rsanheim/Downloads/ruby-1.8.6-p110/node.h

# Please set RUBY\_SOURCE\_DIR to the source path of ruby 1.8.6 (2007-09-23)!

rubynode-0.1.5/setup.rb:655:in `command': system("/opt/local/bin/ruby" "/Users/rsanheim/Downloads/rubynode-0.1.5/ext/rubynode_ext/extconf.rb") failed (RuntimeError) from rubynode-0.1.5/setup.rb:660:in `ruby’  
from rubynode-0.1.5/setup.rb:1238:in `extconf' from rubynode-0.1.5/setup.rb:1230:in `config\_dir\_ext’  
from rubynode-0.1.5/setup.rb:1532:in ` __send__' from rubynode-0.1.5/setup.rb:1532:in `traverse’  
from rubynode-0.1.5/setup.rb:1549:in `dive_into' from rubynode-0.1.5/setup.rb:1530:in `traverse’  
from rubynode-0.1.5/setup.rb:1534:in `traverse' ... 8 levels... from rubynode-0.1.5/setup.rb:991:in `exec\_config’  
from rubynode-0.1.5/setup.rb:812:in `invoke' from rubynode-0.1.5/setup.rb:773:in `invoke’  
from rubynode-0.1.5/setup.rb:1578

thanks,  
Rob

> **[Home](https://robsanheim.com/)**
>
> Just another WordPress site

> **[Cognitect, a Nu Holdings, Ltd. Company](https://cognitect.com/)**

---

<div class="post-metadata">

**Author:** ![rsanheim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/47e85d/32.png) [@rsanheim](https://www.ruby-forum.com/u/rsanheim)\
**Post date:** [February 19, 2008, 7:43pm UTC](https://www.ruby-forum.com/t/rubynode-wont-build-on-leopard-ruby/129399/4 "2008-02-19T19:43:06Z")

</div>

Hi Rob,

On Tue, 19 Feb 2008 04:54:15 +0100, Rob S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> ==================== ERROR =====================  
> /opt/local/lib/ruby/1.8/i686-darwin9.0.0/node.h  
> is different from  
> /Users/rsanheim/Downloads/ruby-1.8.6-p110/node.h

That seems to be the problem. macports probably somehow modifies the  
node.h it installs. Could you diff the two files?

As a workaround you could just copy  
/opt/local/lib/ruby/1.8/i686-darwin9.0.0/node.h to  
/Users/rsanheim/Downloads/ruby-1.8.6-p110/node.h and try to install the  
gem again:

RUBY\_SOURCE\_DIR=“/Users/rsanheim/Downloads/ruby-1.8.6-p110” gem install  
rubynode

But I still would really like to know what the difference between the  
two  
files is.

Thanks.

Dominik

---

<div class="post-metadata">

**Author:** ![rsanheim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/47e85d/32.png) [@rsanheim](https://www.ruby-forum.com/u/rsanheim)\
**Post date:** [February 21, 2008, 8:49pm UTC](https://www.ruby-forum.com/t/rubynode-wont-build-on-leopard-ruby/129399/5 "2008-02-21T20:49:08Z")

</div>

On Thu, 21 Feb 2008 05:04:44 +0100, Rob S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> I posted the diff to pastie here:
> 
> [Parked at Loopia](http://pastie.caboo.se/155179)

Thanks. So, indeed, macports uses a patched node.h and that was the  
problem.

Dominik

---

<div class="post-metadata">

**Author:** ![rsanheim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/47e85d/32.png) [@rsanheim](https://www.ruby-forum.com/u/rsanheim)\
**Post date:** [February 21, 2008, 5:06am UTC](https://www.ruby-forum.com/t/rubynode-wont-build-on-leopard-ruby/129399/6 "2008-02-21T05:06:24Z")

</div>

On Tue, Feb 19, 2008 at 1:41 PM, Dominik B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > \<— lib  
> > node.h it installs. Could you diff the two files?  
> > files is.
> 
> Thanks.
> 
> Dominik

Hi Dominik

I posted the diff to pastie here:

[http://pastie.caboo.se/155179](http://pastie.caboo.se/155179)

I was finally able to get it to install, though I had to switch to  
root user, set the env var, then do ‘gem install’…which installed  
into the macports rubygem context like I wanted. I couldn’t figure  
out a way to set the required env var _and_ run gem install via sudo  
only.

- Rob
