0

目前,我已经在我的 Ubuntu 11.10 上安装了 Ruby(ruby 1.9.3p194(2012-04-20 修订版 35410))。想要使用“sudo gem install amqp”安装 AMQP gem。但它失败并显示以下错误消息:

    Building native extensions.  This could take a while...
    ERROR:  Error installing amqp:
    ERROR: Failed to build gem native extension.

    /usr/local/bin/ruby extconf.rb
    checking for main() in -lssl... no
    checking for rb_trap_immediate in ruby.h,rubysig.h... no
    checking for rb_thread_blocking_region()... yes
    checking for inotify_init() in sys/inotify.h... yes
    checking for writev() in sys/uio.h... yes
    checking for rb_thread_check_ints()... yes
    checking for rb_time_new()... yes
    checking for sys/event.h... no
    checking for epoll_create() in sys/epoll.h... yes
    creating Makefile

    make
    compiling ed.cpp
    make: g++: Command not found
    make: *** [ed.o] Error 127


    Gem files will remain installed in /usr/local/lib/ruby/gems/1.9.1/gems/eventmachine-1.0.0 for inspection.
    Results logged to /usr/local/lib/ruby/gems/1.9.1/gems/eventmachine-1.0.0/ext/gem_make.out

如果有人可以帮助我,将不胜感激。谢谢。

4

1 回答 1

1

为了编译本机扩展,您需要一个编译器。只需使用以下命令安装 g++ 和朋友:

sudo apt-get install build-essential

然后再试一次。

于 2012-09-23T09:06:48.833 回答