winton / stasis

Static sites made powerful
http://stasis.me
MIT License
677 stars 56 forks source link

Stasis crashes when using coffee-script #29

Closed dteoh closed 12 years ago

dteoh commented 12 years ago

I cannot use coffee-script gem version ~> 2.2.0, Stasis just crashes outright.

I updated yajl-ruby to 1.1.0 and it seemed to fix it.

dyld: lazy symbol binding failed: Symbol not found: _yajl_set_static_value
  Referenced from: /Users/dteoh/.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: /Users/dteoh/.rvm/gems/ruby-1.9.3-p0/gems/yajl-ruby-1.0.0/lib/yajl/yajl.bundle
  Expected in: flat namespace

/Users/dteoh/.rvm/gems/ruby-1.9.3-p0/gems/multi_json-1.0.3/lib/multi_json/engines/yajl.rb:10: [BUG] Segmentation fault
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin10.8.0]
Aupajo commented 12 years ago

I have the same problem.

Stack trace in gist.

Aupajo commented 12 years ago

I couldn't update to yajl-ruby 1.1.0. Anyone know any more about this?

Aupajo commented 12 years ago

Found a workaround from this post.

  1. Go to where the gem lives (e.g. ~/.rvm/gems/ruby-1.9.3-p194/gems/yajl-ruby-1.0.0)
  2. Inside ext/yajl, edit both yajl_ext.h and yajl_ext.c, and change both instances of inline void to static void (see below)
  3. Still inside ext/yajl, run make clean all
  4. Copy the newly minted yajl.bundle from ext/yajl to replace the one in lib/yajl

In yajl_ext.c:

static void yajl_check_and_fire_callback(void * ctx) {
// ...snip...
static void yajl_set_static_value(void * ctx, VALUE val) {

In yajl_ext.h:

static void yajl_check_and_fire_callback(void * ctx);
static void yajl_set_static_value(void * ctx, VALUE val);
marvinahv commented 12 years ago

Updating to new version 1.1.0 didn't work, but @Aupajo's solution did. Thanks

winton commented 12 years ago

Pulling Yajl out in next release (already in HEAD). Sorry for the hassle guys.