maximevaillancourt / digital-garden-jekyll-template

Start your own digital garden using this Jekyll template 🌱
https://digital-garden-jekyll-template.netlify.app/
Other
961 stars 750 forks source link

Problem with posix-spawn when setting up #202

Closed dougalk closed 1 month ago

dougalk commented 4 months ago

When running bundle, I was faced with the following error:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

compiling posix-spawn.c
posix-spawn.c:226:27: error: incompatible function pointer types passing 'int (VALUE, VALUE,
posix_spawn_file_actions_t *)' (aka 'int (unsigned long, unsigned long, void **)') to parameter of
type 'int (*)(VALUE, VALUE, VALUE)' (aka 'int (*)(unsigned long, unsigned long, unsigned long)')
[-Wincompatible-function-pointer-types]
        rb_hash_foreach(options, posixspawn_file_actions_operations_iter, (VALUE)fops);
                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
note: passing
argument to parameter 'func' here
void rb_hash_foreach(VALUE hash, int (*func)(VALUE key, VALUE val, VALUE arg), VALUE arg);
                                       ^
1 error generated.
make: *** [posix-spawn.o] Error 1

make failed, exit code 2

To get round this error I had to run: gem install posix-spawn -- --with-cflags="-Wno-incompatible-function-pointer-types" before running bundle

Answer found here: https://github.com/rtomayko/posix-spawn/issues/92

Hope this helps someone

maximevaillancourt commented 1 month ago

Should be resolved now: https://github.com/maximevaillancourt/digital-garden-jekyll-template/pull/207#issuecomment-2330405773.