Thin/eventmachine非root安装问题
尝试在nginx+thin下在rails框架上运行ruby,目前在WEBrick下工作。
我没有 root 访问权限,因为它托管在网络托管服务上。
到目前为止,所有有关 gems 的问题都已解决,无需 root 访问权限。
Thin 需要 eventmachine,所以:
$ gem install eventmachine
Building native extensions. This could take a while...
ERROR: Error installing eventmachine:
ERROR: Failed to build gem native extension.
/usr/local/bin/ruby18 extconf.rb
checking for rb_trap_immediate in ruby.h,rubysig.h... yes
checking for rb_thread_blocking_region()... no
checking for inotify_init() in sys/inotify.h... no
checking for __NR_inotify_init in sys/syscall.h... no
checking for writev() in sys/uio.h... yes
checking for rb_thread_check_ints()... no
checking for rb_time_new()... yes
checking for sys/event.h... yes
checking for sys/queue.h... yes
creating Makefile
make
<cutted non-informative output>
make install
/usr/bin/install -c -o root -g wheel -m 0755 rubyeventmachine.so /www/<hostname>/.gems/gems/eventmachine-0.12.10/lib
install: /www/<hostname>/.gems/gems/eventmachine-0.12.10/lib/rubyeventmachine.so: chown/chgrp: Operation not permitted
*** Error code 71
Stop in /www/<hostname>/.gems/gems/eventmachine-0.12.10/ext.
Gem files will remain installed in /www/<hostname>/.gems/gems/eventmachine-0.12.10 for inspection.
Results logged to /www/<hostname>/.gems/gems/eventmachine-0.12.10/ext/gem_make.out
ruby 和安装的 gems 的版本:
$ ruby -v
ruby 1.8.7 (2010-08-16 patchlevel 302) [i386-freebsd8]
$ gem list
activesupport (3.0.9)
backports (2.2.1)
bin (0.6.3)
bson (1.3.1)
i18n (0.4.2)
mongo (1.0.9)
rack (1.1.1)
rake (0.8.7)
rake-compiler (0.7.9)
ruby-augeas (0.3.0)
rubygems-update (1.8.5)
sources (0.0.2)
specific_install (0.2.3)
yard (0.7.2)
我没有真正弄清楚,问题是在 ERROR: Failed to build gem native extension.
或 make install ** 中*错误代码71
。
尝试 $ gem install Thin
也会发生同样的事情
Trying to run ruby on rails framework under nginx+thin, currently working under WEBrick.
I don't have root access, cause it is hosted at web hosting service.
Till this moment all problems with gems solved w/o root access.
thin requires eventmachine, so:
$ gem install eventmachine
Building native extensions. This could take a while...
ERROR: Error installing eventmachine:
ERROR: Failed to build gem native extension.
/usr/local/bin/ruby18 extconf.rb
checking for rb_trap_immediate in ruby.h,rubysig.h... yes
checking for rb_thread_blocking_region()... no
checking for inotify_init() in sys/inotify.h... no
checking for __NR_inotify_init in sys/syscall.h... no
checking for writev() in sys/uio.h... yes
checking for rb_thread_check_ints()... no
checking for rb_time_new()... yes
checking for sys/event.h... yes
checking for sys/queue.h... yes
creating Makefile
make
<cutted non-informative output>
make install
/usr/bin/install -c -o root -g wheel -m 0755 rubyeventmachine.so /www/<hostname>/.gems/gems/eventmachine-0.12.10/lib
install: /www/<hostname>/.gems/gems/eventmachine-0.12.10/lib/rubyeventmachine.so: chown/chgrp: Operation not permitted
*** Error code 71
Stop in /www/<hostname>/.gems/gems/eventmachine-0.12.10/ext.
Gem files will remain installed in /www/<hostname>/.gems/gems/eventmachine-0.12.10 for inspection.
Results logged to /www/<hostname>/.gems/gems/eventmachine-0.12.10/ext/gem_make.out
Versions of ruby and installed gems:
$ ruby -v
ruby 1.8.7 (2010-08-16 patchlevel 302) [i386-freebsd8]
$ gem list
activesupport (3.0.9)
backports (2.2.1)
bin (0.6.3)
bson (1.3.1)
i18n (0.4.2)
mongo (1.0.9)
rack (1.1.1)
rake (0.8.7)
rake-compiler (0.7.9)
ruby-augeas (0.3.0)
rubygems-update (1.8.5)
sources (0.0.2)
specific_install (0.2.3)
yard (0.7.2)
I didn't really figured out, is the problem in ERROR: Failed to build gem native extension.
or in make install ***Error code 71
.
Same thing happens trying $ gem install thin
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
错误是
错误:无法构建 gem 本机扩展。
。通常这意味着您的系统中缺少某些内容。 Ruby 开发库或 gem 的依赖项。在这种特殊情况下,我认为 libevent (它是 eventmachine 的依赖项)不在您的系统中。您可以在以下位置找到问题的完整描述:
/www/<主机名>/.gems/gems/eventmachine-0.12.10/ext/gem_make.out
The error is
ERROR: Failed to build gem native extension.
. Usually it means something is missing in your system. Ruby development libraries or a dependency of the gem. In this particular case i think libevent (its a dependency of eventmachine) is not in your system.You will find a complete description of what went wrong at:
/www/<hostname>/.gems/gems/eventmachine-0.12.10/ext/gem_make.out
谢谢你的建议,巴勃罗!
不幸的是,gem_make.out只包含我提供的信息,没有其他信息...
由于
rel="nofollow">rubyforge bugtracker aboud freebsd,我意识到将这一行添加到 .bashrc 可以解决
source 之后的 .bashrc
我成功安装了 eventmachine 和 Thin。Thanks for advice, Pablo!
Unfortunately, gem_make.out contained only information I provided, nothing else...
Due to rubyforge bugtracker aboud freebsd, I realised that adding this line to .bashrc solves the problem
After
source .bashrc
I successfully installed both eventmachine and thin.