0

我正在尝试让 octopress 运行,但在安装所需的软件包 posix-spawn 时遇到了麻烦。

这是错误输出:

ERROR:  Error installing posix-spawn:
        ERROR: Failed to build gem native extension.

/home/private/.rvm/rubies/ruby-1.9.3-p392/bin/ruby extconf.rb
creating Makefile

make
compiling posix-spawn.c
posix-spawn.c:9:19: error: spawn.h: No such file or directory
In file included from /home/private/.rvm/rubies/ruby-1.9.3-p392/include/ruby-    1.9.1/ruby/ruby.h:24,
                 from /home/private/.rvm/rubies/ruby-1.9.3-p392/include/ruby-1.9.1/ruby.h:32,
                 from posix-spawn.c:14:
/home/private/.rvm/rubies/ruby-1.9.3-p392/include/ruby-1.9.1/i386-    freebsd8.3/ruby/config.h:17:1: warning: "_GNU_SOURCE" redefined
posix-spawn.c:3:1: warning: this is the location of the previous definition
posix-spawn.c:103: error: expected declaration specifiers or '...' before     'posix_spawn_file_actions_t'
posix-spawn.c: In function 'posixspawn_file_actions_addclose':
posix-spawn.c:113: warning: implicit declaration of function     'posix_spawn_file_actions_addclose'
posix-spawn.c:113: error: 'fops' undeclared (first use in this function)
posix-spawn.c:113: error: (Each undeclared identifier is reported only once
posix-spawn.c:113: error: for each function it appears in.)
posix-spawn.c: At top level:
posix-spawn.c:129: error: expected declaration specifiers or '...' before     'posix_spawn_file_actions_t'
posix-spawn.c: In function 'posixspawn_file_actions_adddup2':
posix-spawn.c:141: warning: implicit declaration of function     'posix_spawn_file_actions_adddup2'
posix-spawn.c:141: error: 'fops' undeclared (first use in this function)
posix-spawn.c: At top level:
posix-spawn.c:155: error: expected declaration specifiers or '...' before     'posix_spawn_file_actions_t'
posix-spawn.c: In function 'posixspawn_file_actions_addopen':
posix-spawn.c:173: warning: implicit declaration of function     'posix_spawn_file_actions_addopen'
posix-spawn.c:173: error: 'fops' undeclared (first use in this function)
posix-spawn.c: At top level:
posix-spawn.c:186: error: expected declaration specifiers or '...' before     'posix_spawn_file_actions_t'
posix-spawn.c: In function 'posixspawn_file_actions_operations_iter':
posix-spawn.c:190: error: 'fops' undeclared (first use in this function)
posix-spawn.c:190: error: too many arguments to function 'posixspawn_file_actions_addclose'
posix-spawn.c:193: error: too many arguments to function 'posixspawn_file_actions_adddup2'
posix-spawn.c:196: error: too many arguments to function 'posixspawn_file_actions_addopen'
posix-spawn.c: At top level:
posix-spawn.c:210: error: expected ')' before '*' token
posix-spawn.c:230: error: expected declaration specifiers or '...' before 'posix_spawnattr_t'
posix-spawn.c: In function 'posixspawn_set_pgroup':
posix-spawn.c:237: error: 'POSIX_SPAWN_SETPGROUP' undeclared (first use in this function)
posix-spawn.c:238: warning: implicit declaration of function 'posix_spawnattr_setpgroup'
posix-spawn.c:238: error: 'pattr' undeclared (first use in this function)
posix-spawn.c: In function 'each_env_check_i':
posix-spawn.c:253: warning: unused parameter 'arg'
posix-spawn.c: In function 'rb_posixspawn_pspawn':
posix-spawn.c:330: error: 'posix_spawn_file_actions_t' undeclared (first use in this function)
posix-spawn.c:330: error: expected ';' before 'fops'
posix-spawn.c:331: error: 'posix_spawnattr_t' undeclared (first use in this function)
posix-spawn.c:331: error: expected ';' before 'attr'
posix-spawn.c:332: warning: ISO C90 forbids mixed declarations and code
posix-spawn.c:341: warning: ISO C90 forbids mixed declarations and code
posix-spawn.c:381: warning: ISO C90 forbids mixed declarations and code
posix-spawn.c:391: warning: implicit declaration of function 'posixspawn_file_actions_init'
posix-spawn.c:391: error: 'fops' undeclared (first use in this function)
posix-spawn.c:392: warning: implicit declaration of function 'posix_spawnattr_init'
posix-spawn.c:392: error: 'attr' undeclared (first use in this function)
posix-spawn.c:395: error: 'POSIX_SPAWN_SETSIGMASK' undeclared (first use in this function)
posix-spawn.c:397: warning: implicit declaration of function 'posix_spawnattr_setsigmask'
posix-spawn.c:407: error: too many arguments to function 'posixspawn_set_pgroup'
posix-spawn.c:409: warning: implicit declaration of function 'posix_spawnattr_setflags'
posix-spawn.c:418: warning: implicit declaration of function 'posix_spawnp'
posix-spawn.c:427: warning: implicit declaration of function     'posix_spawn_file_actions_destroy'
posix-spawn.c:428: warning: implicit declaration of function 'posix_spawnattr_destroy'
posix-spawn.c:320: warning: unused parameter 'self'
*** Error code 1

我在 Github 中找到了这条评论,上面写着要确保 spawn.h 在我的 /usr/include/ 文件夹中,但这似乎没有效果。

还有其他想法吗?

4

1 回答 1

2

作者解决了这个问题,但显然从未进入 ruby​​ gems repo。你可以在这里看到它。

您可以克隆 repo 并在本地编译它,这对我有用:

git clone https://github.com/rtomayko/posix-spawn.git
cd posix-spawn/
gem build posix-spawn.gemspec
gem install posix-spawn*.gem
于 2013-05-03T09:07:21.447 回答