安装ruby-devel和httparty

时间:2014-03-14 04:59:11

标签: ruby-on-rails ruby amazon-web-services gem rhel

在我的EC2 redhat实例上,我正在尝试使用gem安装httparty。

在下面的网站上,我添加了repo并安装了ruby193。

http://developerblog.redhat.com/2013/01/28/software-collections-on-red-hat-enterprise-linux/

是的,我在/ usr / bin创建了ruby和gem的软链接,并在/etc/ld.so.conf.d/中创建了conf文件并运行了ldconfig。

现在,当我尝试安装时,我遇到了错误。

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

            /opt/rh/ruby193/root/usr/bin/ruby extconf.rb
    mkmf.rb can't find header files for ruby at /opt/rh/ruby193/root/usr/share/include/ruby.h


    Gem files will remain installed in /opt/rh/ruby193/root/usr/local/share/gems/gems/json-1.8.1 for inspection.
    Results logged to /opt/rh/ruby193/root/usr/local/share/gems/gems/json-1.8.1/ext/json/ext/generator/gem_make.out
    Building native extensions.  This could take a while...
    .
    ERROR:  Error installing json:
            ERROR: Failed to build gem native extension.

            /opt/rh/ruby193/root/usr/bin/ruby extconf.rb
    mkmf.rb can't find header files for ruby at /opt/rh/ruby193/root/usr/share/include/ruby.h


    Gem files will remain installed in /opt/rh/ruby193/root/usr/local/share/gems/gems/json-1.8.1 for inspection.
    Results logged to /opt/rh/ruby193/root/usr/local/share/gems/gems/json-1.8.1/ext/json/ext/generator/gem_make.out

做了一些谷歌搜索,发现我需要安装ruby-devel。得到rpm并尝试安装我现在得到以下错误。

#-> yum install /tmp/ruby-devel-1.9.3.392-22.1.x86_64.rpm
Loaded plugins: amazon-id, rhui-lb, security
rhui-us-east-1-client-config-server-6                                                                                                                                    | 2.6 kB     00:00
rhui-us-east-1-rhel-server-releases                                                                                                                                      | 3.7 kB     00:00
rhui-us-east-1-rhel-server-releases-optional                                                                                                                             | 3.5 kB     00:00
Setting up Install Process
Examining /tmp/ruby-devel-1.9.3.392-22.1.x86_64.rpm: ruby-devel-1.9.3.392-22.1.x86_64
Marking /tmp/ruby-devel-1.9.3.392-22.1.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package ruby-devel.x86_64 0:1.9.3.392-22.1 will be installed
--> Processing Dependency: ruby(x86-64) = 1.9.3.392-22.1 for package: ruby-devel-1.9.3.392-22.1.x86_64
--> Finished Dependency Resolution
Error: Package: ruby-devel-1.9.3.392-22.1.x86_64 (/ruby-devel-1.9.3.392-22.1.x86_64)
           Requires: ruby(x86-64) = 1.9.3.392-22.1
           Available: ruby-1.8.7.299-4.el6.x86_64 (rhui-us-east-1-rhel-server-releases)
               ruby(x86-64) = 1.8.7.299-4.el6
           Available: ruby-1.8.7.299-5.el6_0.1.x86_64 (rhui-us-east-1-rhel-server-releases)
               ruby(x86-64) = 1.8.7.299-5.el6_0.1
           Available: ruby-1.8.7.299-7.el6.x86_64 (rhui-us-east-1-rhel-server-releases)
               ruby(x86-64) = 1.8.7.299-7.el6
           Available: ruby-1.8.7.299-7.el6_1.1.x86_64 (rhui-us-east-1-rhel-server-releases)
               ruby(x86-64) = 1.8.7.299-7.el6_1.1
           Available: ruby-1.8.7.352-3.el6.x86_64 (rhui-us-east-1-rhel-server-releases)
               ruby(x86-64) = 1.8.7.352-3.el6
           Available: ruby-1.8.7.352-4.el6_2.x86_64 (rhui-us-east-1-rhel-server-releases)
               ruby(x86-64) = 1.8.7.352-4.el6_2
           Available: ruby-1.8.7.352-7.el6_2.x86_64 (rhui-us-east-1-rhel-server-releases)
               ruby(x86-64) = 1.8.7.352-7.el6_2
           Available: ruby-1.8.7.352-10.el6_4.x86_64 (rhui-us-east-1-rhel-server-releases)
               ruby(x86-64) = 1.8.7.352-10.el6_4
           Available: ruby-1.8.7.352-12.el6_4.x86_64 (rhui-us-east-1-rhel-server-releases)
               ruby(x86-64) = 1.8.7.352-12.el6_4
           Available: ruby-1.8.7.352-13.el6.x86_64 (rhui-us-east-1-rhel-server-releases)
               ruby(x86-64) = 1.8.7.352-13.el6
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

我知道它抱怨ruby1.9,但我已经安装了它。

1 个答案:

答案 0 :(得分:0)

我找到了解决方案:

我在yum找到了devel包,它的名字不同。

yum install ruby​​193_devel