0

我对 ubuntu 没有那么有经验 - 我在 Ubuntu 13.04 上并正在尝试安装 muby ( http://rubyforge.org/projects/muby/ )。当我下载它并尝试 gem install 时...这是我得到的错误:

在此处输入图像描述

如果有人可以请告诉我如何解决这个问题 - 我已经广泛搜索了谷歌并安装了很多东西(如 mysql、ruby 版本和 -dev 的......没有尝试过 RVM,因为我不知道如何)。

更新安装后libncurses5-dev,我收到此错误:

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

        /usr/bin/ruby1.9.1 extconf.rb
checking for unistd.h... yes
checking for ncurses.h... yes
checking for wmove() in -lncurses... yes
checking for newscr()... yes
checking for TABSIZE()... yes
checking for ESCDELAY()... yes
checking for keybound()... yes
checking for curses_version()... yes
checking for tigetstr()... yes
checking for getwin()... yes
checking for putwin()... yes
checking for ungetmouse()... yes
checking for mousemask()... yes
checking for wenclose()... yes
checking for mouseinterval()... yes
checking for wmouse_trafo()... yes
checking for mcprint()... yes
checking for has_key()... yes
checking for delscreen()... yes
checking for define_key()... yes
checking for keyok()... yes
checking for resizeterm()... yes
checking for use_default_colors()... yes
checking for use_extended_names()... yes
checking for wresize()... yes
checking for attr_on()... yes
checking for attr_off()... yes
checking for attr_set()... yes
checking for chgat()... yes
checking for color_set()... yes
checking for filter()... yes
checking for intrflush()... yes
checking for mvchgat()... yes
checking for mvhline()... yes
checking for mvvline()... yes
checking for mvwchgat()... yes
checking for mvwhline()... yes
checking for mvwvline()... yes
checking for noqiflush()... yes
checking for putp()... yes
checking for qiflush()... yes
checking for scr_dump()... yes
checking for scr_init()... yes
checking for scr_restore()... yes
checking for scr_set()... yes
checking for slk_attr_off()... no
checking for slk_attr_on()... no
checking for slk_attr()... yes
checking for slk_attr_set()... yes
checking for slk_color()... yes
checking for tigetflag()... yes
checking for tigetnum()... yes
checking for use_env()... yes
checking for vidattr()... yes
checking for vid_attr()... no
checking for wattr_on()... yes
checking for wattr_off()... yes
checking for wattr_set()... yes
checking for wchgat()... yes
checking for wcolor_set()... yes
checking for getattrs()... yes
checking which debugging functions to wrap...
checking for _tracef()... no
checking for _tracedump()... no
checking for _nc_tracebits()... no
checking for _traceattr()... no
checking for _traceattr2()... no
checking for _tracechar()... no
checking for _tracechtype()... no
checking for _tracechtype2()... no
checking for _tracemouse()... no
checking for other functions that appeared after ncurses version 5.0...
checking for assume_default_colors()... yes
checking for attr_get()... yes
checking for the panel library...
checking for panel.h... yes
checking for panel_hidden() in -lpanel... yes
checking for the form library...
checking for form.h... yes
checking for new_form() in -lform... yes
creating Makefile

make
Makefile:176: warning: overriding commands for target `/var/lib/gems/1.9.1/gems/ncurses-0.9.1/lib'
Makefile:174: warning: ignoring old commands for target `/var/lib/gems/1.9.1/gems/ncurses-0.9.1/lib'
compiling form_wrap.c
form_wrap.c: In function ‘rbncurs_m_new_form’:
form_wrap.c:395:34: error: ‘struct RArray’ has no member named ‘len’
form_wrap.c: In function ‘rbncurs_c_set_field_type’:
form_wrap.c:619:23: error: ‘struct RArray’ has no member named ‘len’
form_wrap.c:624:5: warning: implicit declaration of function ‘STR2CSTR’ [-Wimplicit-function-declaration]
form_wrap.c:624:13: warning: assignment makes pointer from integer without a cast [enabled by default]
form_wrap.c: In function ‘rbncurs_c_set_field_buffer’:
form_wrap.c:741:3: warning: passing argument 3 of ‘set_field_buffer’ makes pointer from integer without a cast [enabled by default]
In file included from form_wrap.h:26:0,
                 from form_wrap.c:28:
/usr/include/form.h:341:28: note: expected ‘const char *’ but argument is of type ‘int’
form_wrap.c: In function ‘rbncurs_c_set_form_fields’:
form_wrap.c:778:34: error: ‘struct RArray’ has no member named ‘len’
form_wrap.c: In function ‘rbncurs_c_form_request_by_name’:
form_wrap.c:1051:3: warning: passing argument 1 of ‘form_request_by_name’ makes pointer from integer without a cast [enabled by default]
In file included from form_wrap.h:26:0,
                 from form_wrap.c:28:
/usr/include/form.h:403:28: note: expected ‘const char *’ but argument is of type ‘int’
form_wrap.c: In function ‘make_arg’:
form_wrap.c:1126:38: error: ‘struct RArray’ has no member named ‘len’
form_wrap.c:1130:5: error: format not a string literal and no format arguments [-Werror=format-security]
cc1: some warnings being treated as errors
make: *** [form_wrap.o] Error 1


Gem files will remain installed in /var/lib/gems/1.9.1/gems/ncurses-0.9.1 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/ncurses-0.9.1/./gem_make.out
4

1 回答 1

3

错误信息很清楚:

checking for ncurses.h... no
...
...
...: ncurses hearder file not found

你只需要安装 ncurses 开发包:

apt-get install libncurses5-dev

更新这是 gem 中的一个错误ncurses,它没有更新为与 Ruby 1.9+ 一起使用,如果可以的话,切换到 Ruby 1.8.7,它将构建没有错误。不幸的是,这颗宝石似乎不再是人为的。

您可以使用rvmrbenv轻松安装 Ruby 1.8.7 ,我建议使用后者。

于 2013-06-15T09:09:39.380 回答