2

我正在尝试安装 ruby​​-perf。我遇到了问题,但是在安装 ruby​​-dev 之后,它通过控制台运行良好。

ubuntu@ubuntu-VirtualBox:~/web$ sudo gem install ruby-prof -v '0.13.0'
Fetching: ruby-prof-0.13.0.gem (100%)
Building native extensions.  This could take a while...
Successfully installed ruby-prof-0.13.0
1 gem installed

但是当我运行捆绑器时,它仍然显示错误。

ubuntu@ubuntu-VirtualBox:~/web$  bundle install
. . .
Installing ruby-prof (0.13.0) 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /home/ubuntu/jruby-1.7.3/bin/jruby extconf.rb 
/home/ubuntu/jruby-1.7.3/lib/ruby/shared/mkmf.rb:14: Use RbConfig instead of obsolete and deprecated Config.
checking for sys/times.h... yes
checking for rb_os_allocated_objects()... no
checking for rb_gc_allocated_size()... no
checking for rb_gc_collections()... no
checking for rb_gc_time()... no
checking for rb_class_superclass()... checking for rb_heap_total_mem()... no
checking for rb_gc_heap_info()... no
checking for rb_fiber_current()... no
extconf.rb:54 warning: tracing (e.g. set_trace_func) will not capture all events without --debug flag
creating Makefile

make
cc -I. -I. -I/home/ubuntu/jruby-1.7.3/lib/native/include/ruby -I. -DHAVE_SYS_TIMES_H -DHAVE_RB_CLASS_SUPERCLASS -DRUBY_VERSION=193 -DTHREADS_INHERIT_EVENT_FLAGS=0        -fPIC  -fno-omit-frame-pointer -fno-strict-aliasing  -fexceptions    -m32 -c rp_measure_gc_time.c
In file included from rp_measure_gc_time.c:6:0:
ruby_prof.h:23:18: fatal error: node.h: No such file or directory
compilation terminated.
make: *** [rp_measure_gc_time.o] Error 1


Gem files will remain installed in /home/ubuntu/jruby-1.7.3/lib/ruby/gems/shared/gems/ruby-prof-0.13.0 for inspection.
Results logged to /home/ubuntu/jruby-1.7.3/lib/ruby/gems/shared/gems/ruby-prof-0.13.0/ext/ruby_prof/gem_make.out

An error occurred while installing ruby-prof (0.13.0), and Bundler cannot
continue.
Make sure that `gem install ruby-prof -v '0.13.0'` succeeds before bundling.

我验证了 gems 也已安装。

ubuntu@ubuntu-VirtualBox:~/web$ sudo gem list

*** LOCAL GEMS ***

json (1.8.0, 1.7.7)
minitest (5.0.6)
rake (10.1.0)
rake-compiler (0.8.3)
ruby-prof (0.13.0)
4

1 回答 1

0

您正在使用 sudo 运行第一个命令,而在没有 sudo 的情况下运行第二个命令。

于 2013-12-06T21:11:09.150 回答