Rubynode won't build on Leopard Ruby

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

Hi Rob,

On Mon, 18 Feb 2008 09:29:08 +0100, Rob S. [email protected]
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

On Feb 18, 2008 2:01 PM, Dominik B. [email protected] 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

Hi Rob,

On Tue, 19 Feb 2008 04:54:15 +0100, Rob S. [email protected]
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

On Thu, 21 Feb 2008 05:04:44 +0100, Rob S. [email protected]
wrote:

I posted the diff to pastie here:

Parked at Loopia

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

Dominik

On Tue, Feb 19, 2008 at 1:41 PM, Dominik B. [email protected] 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

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