您的位置:首页 > 运维架构 > Linux

CentOS6.3安装Opennebula3.6时gem安装问题

2014-12-13 15:44 274 查看
故障现象:

[root@cloudmaster gem]# gem install rails -l

ERROR:  Error installing rails:

        activemodel requires builder (~> 3.0.0, runtime)

[root@cloudmaster gem]#

故障分析:

gem包使用本地安装,而本地builder-3.1.4.gem版本大于3.0.0,按提示应该不是此问题;尝试其他方法解决都行不通,故找来另一台机器直接gem install rails一下,之后gem list结果如下:

[root@ezCloud ~]# gem install rails

Successfully installed rails-3.2.9

1 gem installed

Installing ri documentation for rails-3.2.9...

Installing RDoc documentation for rails-3.2.9...

[root@ezCloud ~]# gem list

*** LOCAL GEMS ***

actionmailer (3.2.9)

actionpack (3.2.9)

activemodel (3.2.9)

activerecord (3.2.9)

activeresource (3.2.9)

activesupport (3.2.9)

arel (3.0.2)
builder (3.0.4)

bundler (1.2.3)

daemons (1.1.9)

erubis (2.7.0)

eventmachine (1.0.0)

headers (0.0.1)

hike (1.2.1)

i18n (0.6.1)

journey (1.0.4)

json (1.7.5, 1.4.6)

libraries (0.1.6)
mail (2.4.4)

mime-types (1.19)

multi_json (1.5.0)

nokogiri (1.5.6)

polyglot (0.3.3)

rack (1.4.1)

rack-cache (1.2)

rack-protection (1.3.2)

rack-ssl (1.3.2)

rack-test (0.6.2)

rails (3.2.9)

railties (3.2.9)

rake (10.0.3)

rdoc (3.12)

sequel (3.42.0)

sinatra (1.3.3)

sinatra-sequel (0.9.0)

sprockets (2.2.2)

thin (1.5.0)

thor (0.16.0)

tilt (1.3.3)

treetop (1.4.12)

tzinfo (0.3.35)

[root@ezCloud ~]# 

结果发现builder为3.0.4,我的ruby版本是1.8.7,可能是本地的builder版本过高缘故,下载builder-3.0.4并安装:

[root@cloudmaster gem]# wget http://tokyo-m.rubygems.org/gems/builder-3.0.4.gem

[root@cloudmaster gem]# gem install builder-3.0.4.gem -l

Successfully installed builder-3.0.4

1 gem installed

Installing ri documentation for builder-3.0.4...

Installing RDoc documentation for builder-3.0.4...

[root@cloudmaster gem]# gem install rails -l

ERROR:  Error installing rails:

        actionmailer requires mail (~> 2.4.4, runtime)                             /*要求mail的版本是2.4.4*/

[root@cloudmaster gem]# wget http://tokyo-m.rubygems.org/gems/mail-2.4.4.gem

再次安装rails,安装成功;

[root@cloudmaster gem]# gem install rails -l

Successfully installed mime-types-1.19

Successfully installed polyglot-0.3.3

Successfully installed treetop-1.4.12

Successfully installed mail-2.4.4

Successfully installed actionmailer-3.2.9

Successfully installed rack-ssl-1.3.2

Successfully installed thor-0.16.0

Successfully installed railties-3.2.9

Successfully installed ………………

****************************************************************

故障现象:

[root@ezcloudmaster ~]# gem install xmlparser

Building native extensions.  This could take a while...

ERROR:  Error installing xmlparser:

        ERROR: Failed to build gem native extension.

/usr/bin/ruby extconf.rb

checking for expat.h... no

checking for xmlparse.h... no

*** extconf.rb failed ***

Could not create Makefile due to some reason, probably lack of

necessary libraries and/or headers.  Check the mkmf.log file for more

details.  You may need configuration options.

Provided configuration options:

        --with-opt-dir

        --without-opt-dir

        --with-opt-include

        --without-opt-include=${opt-dir}/include

        --with-opt-lib

        --without-opt-lib=${opt-dir}/lib

        --with-make-prog

        --without-make-prog

        --srcdir=.

        --curdir

        --ruby=/usr/bin/ruby

        --with-perl-enc-map

        --without-perl-enc-map

        --with-expat-dir

        --without-expat-dir

        --with-expat-include

        --without-expat-include=${expat-dir}/include

        --with-expat-lib

        --without-expat-lib=${expat-dir}/lib

Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/xmlparser-0.7.2.1 for inspection.

Results logged to /usr/lib/ruby/gems/1.8/gems/xmlparser-0.7.2.1/ext/gem_make.out

解决办法:

[root@ezcloudmaster ~]# yum install expat-devel

………………

[root@ezcloudmaster ~]# gem install xmlparser

Building native extensions.  This could take a while...

Successfully installed xmlparser-0.7.2.1

1 gem installed

Installing ri documentation for xmlparser-0.7.2.1...

Installing RDoc documentation for xmlparser-0.7.2.1...

[root@ezcloudmaster ~]# 

****************************************************************

gem download:
http://rubygems.org/gems/sequel

gem install:

gem install sequel -l
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  gem install