Ruby Ubuntu RVM 安装报错

LinuxGit · 2012年04月28日 · 最后由 zhangyan 回复于 2012年08月19日 · 4996 次阅读

昨天把 fedora 格了装了 Ubuntu LTS,刚照着 wiki 安装到 $rvm pkg install readline 时 报错如下:


Fetching readline-5.2.tar.gz to /home/diglike/.rvm/archives
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1989k  100 1989k    0     0   286k      0  0:00:06  0:00:06 --:--:--  477k
Extracting readline-5.2.tar.gz to /home/diglike/.rvm/src
Applying patch '/home/diglike/.rvm/patches/readline-5.2/shobj-conf.patch'...
Prepare readline in /home/diglike/.rvm/src/readline-5.2.
Error running 'autoreconf -is --force', please read /home/diglike/.rvm/log/readline/autoreconf.log
Configuring readline in /home/diglike/.rvm/src/readline-5.2.
Compiling readline in /home/diglike/.rvm/src/readline-5.2.
Installing readline to /home/diglike/.rvm/usr
Fetching readline-6.2.tar.gz to /home/diglike/.rvm/archives
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 2224k  100 2224k    0     0   335k      0  0:00:06  0:00:06 --:--:--  453k
Extracting readline-6.2.tar.gz to /home/diglike/.rvm/src
Applying patch '/home/diglike/.rvm/patches/readline-6.2/patch-shobj-conf.diff'...
Prepare readline in /home/diglike/.rvm/src/readline-6.2.
Error running 'autoreconf -is --force', please read /home/diglike/.rvm/log/readline/autoreconf.log
Configuring readline in /home/diglike/.rvm/src/readline-6.2.
Compiling readline in /home/diglike/.rvm/src/readline-6.2.
Installing readline to /home/diglike/.rvm/usr

$ cat autoreconf.log

cat autoreconf.log
[2012-04-28 14:50:46] autoreconf -is --force
autoheader: warning: missing template: CTYPE_NON_ASCII
autoheader: Use AC_DEFINE([CTYPE_NON_ASCII], [], [Description])
autoheader: warning: missing template: FIONREAD_IN_SYS_IOCTL
autoheader: warning: missing template: HAVE_BSD_SIGNALS
autoheader: warning: missing template: HAVE_GETPW_DECLS
autoheader: warning: missing template: HAVE_LANGINFO_CODESET
autoheader: warning: missing template: HAVE_MBRLEN
autoheader: warning: missing template: HAVE_MBSCMP
autoheader: warning: missing template: HAVE_MBSNRTOWCS
autoheader: warning: missing template: HAVE_MBSRTOWCS
autoheader: warning: missing template: HAVE_MBSTATE_T
autoheader: warning: missing template: HAVE_POSIX_SIGNALS
autoheader: warning: missing template: HAVE_POSIX_SIGSETJMP
autoheader: warning: missing template: HAVE_STRUCT_DIRENT_D_FILENO
autoheader: warning: missing template: HAVE_STRUCT_DIRENT_D_INO
autoheader: warning: missing template: HAVE_USG_SIGHOLD
autoheader: warning: missing template: HAVE_WCRTOMB
autoheader: warning: missing template: HAVE_WCSCOLL
autoheader: warning: missing template: HAVE_WCSDUP
autoheader: warning: missing template: HAVE_WCTYPE
autoheader: warning: missing template: HAVE_WCWIDTH
autoheader: warning: missing template: MUST_REINSTALL_SIGHANDLERS
autoheader: warning: missing template: NO_MULTIBYTE_SUPPORT
autoheader: warning: missing template: SPEED_T_IN_SYS_TYPES
autoheader: warning: missing template: STRCOLL_BROKEN
autoheader: warning: missing template: STRUCT_WINSIZE_IN_SYS_IOCTL
autoheader: warning: missing template: STRUCT_WINSIZE_IN_TERMIOS
autoheader: warning: missing template: TIOCSTAT_IN_SYS_IOCTL
autoheader: warning: missing template: VOID_SIGHANDLER
autoreconf: /usr/bin/autoheader failed with exit status: 1

以前也是这错误,找了很多方法试了不行,刚开始学习 ruby,忽略后 rails console 有问题,索性就用源码装的 ruby。 在 http://ruby-china.org/topics/996 看到 @superbatironmans5 的方法是 gem install rb-readline, then added gem 'rb-readline' to my app's Gemfile,想知道使用 Ubuntu 的童鞋是怎么装的?

使用 Ruby-China 的安装教程,我一直没有安装成功过。这个问题我也一直存在,尝试过很多次都这样。后来干脆 rvm install 1.9.3 gem install rails -v="3.2.1"

刚刚按照 wiki 的方法装好的环境,出现这玩意貌似是没问题的

#2 楼 @ywjno 我之前忽略后,irb 补全用不了,rails console 也报错的。

最新的 12.04 直接 apt-get install ruby-rvm

我的脚本是

  1. 安装 RVM sudo apt-get install curl sudo apt-get install git-core sudo apt-get install ruby curl -L get.rvm.io | bash -s stable source ~/.rvm/scripts/'rvm' $ rvm requirements 安装 ruby 需要的库

$sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion $ rvm install 1.9.3

直接忽略上面的报错把 ruby 装上去,运行 irb 会报 Readline was unable to be required。 gem install rb-readline运行 irb 后就正常了。

#6 楼 @LinuxGit 不错,非常感谢

需要 登录 后方可回复, 如果你还没有账号请 注册新账号