cucumber + yajl troubles (OSX Lion)

Posted by – November 1, 2011

using rails 3.0.1 and cucumber-rails (~>1.1.0).. and got this weird error message:

dyld: lazy symbol binding failed: Symbol not found: _yajl_set_static_value
  Referenced from: ~/.rvm/gems/ruby-1.9.3-p0/gems/yajl-ruby-1.0.0/lib/yajl/yajl.bundle
  Expected in: flat namespace

dyld: Symbol not found: _yajl_set_static_value
  Referenced from: ~/.rvm/gems/ruby-1.9.3-p0/gems/yajl-ruby-1.0.0/lib/yajl/yajl.bundle
  Expected in: flat namespace

Trace/BPT trap: 5

so.. working solution is:

  • go to the gem itself (~/.rvm/gems/ruby-1.9.3-p0/gems/yajl-ruby-1.0.0/ext/yajl)
  • open yajl_ext.h and yajl_ext.c and change “inline void” to “static void
  • gmake clean all
  • overwrite yajl.bundle in lib/
example of edited yajl.h
static void yajl_check_and_fire_callback(void * ctx);
static void yajl_set_static_value(void * ctx, VALUE val);
voila! :)

3 Comments on cucumber + yajl troubles (OSX Lion)

  1. I Love Google says:

    Very nice! Ran into this while using Yajl::Parser to parse an HTTP stream, and this fix solved it.

    Is changing inline to static safe? Not enough of a C whiz to understand the implications…

  2. Or, just upgrade yajl-ruby to 1.1.0.

  3. Tom says:

    Leonind: Sometimes there’s a case when you can’t upgrade…

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>