Title: installing ruby-devel and httparty
Tags: ruby-on-rails;ruby;amazon-web-services;gem;rhel
Question: On my EC2 redhat instance I am trying to install httparty with gem.
following below site, I added repo and installed ruby193.
http://developerblog.redhat.com/2013/01/28/software-collections-on-red-hat-enterprise-linux/
And yes, I have create soft links for ruby and gem at /usr/bin and create conf file in /etc/ld.so.conf.d/ and ran ldconfig.
Now when I try to install I am getting below error.
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
did some googling and found out that I need to install ruby-devel. got rpm and trying to install now I am getting below error.
#-&gt; yum install /tmp/ruby-devel-151.320-41-7929-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-151.320-41-7929-22.1.x86_64.rpm: ruby-devel-151.320-41-7929-22.1.x86_64
Marking /tmp/ruby-devel-151.320-41-7929-22.1.x86_64.rpm to be installed
Resolving Dependencies
--&gt; Running transaction check
---&gt; Package ruby-devel.x86_64 0:151.320-41-7929-22.1 will be installed
--&gt; Processing Dependency: ruby(x86-64) = 151.320-41-7929-22.1 for package: ruby-devel-151.320-41-7929-22.1.x86_64
--&gt; Finished Dependency Resolution
Error: Package: ruby-devel-151.320-41-7929-22.1.x86_64 (/ruby-devel-151.320-41-7929-22.1.x86_64)
Requires: ruby(x86-64) = 151.320-41-7929-22.1
Available: ruby-151.320-41-7929-4.el6.x86_64 (rhui-us-east-1-rhel-server-releases)
ruby(x86-64) = 151.320-41-7929-4.el6
Available: ruby-151.320-41-7929-5.el6_0.1.x86_64 (rhui-us-east-1-rhel-server-releases)
ruby(x86-64) = 151.320-41-7929-5.el6_0.1
Available: ruby-151.320-41-7929-7.el6.x86_64 (rhui-us-east-1-rhel-server-releases)
ruby(x86-64) = 151.320-41-7929-7.el6
Available: ruby-151.320-41-7929-7.el6_1.1.x86_64 (rhui-us-east-1-rhel-server-releases)
ruby(x86-64) = 151.320-41-7929-7.el6_1.1
Available: ruby-151.320-41-7929-3.el6.x86_64 (rhui-us-east-1-rhel-server-releases)
ruby(x86-64) = 151.320-41-7929-3.el6
Available: ruby-151.320-41-7929-4.el6_2.x86_64 (rhui-us-east-1-rhel-server-releases)
ruby(x86-64) = 151.320-41-7929-4.el6_2
Available: ruby-151.320-41-7929-7.el6_2.x86_64 (rhui-us-east-1-rhel-server-releases)
ruby(x86-64) = 151.320-41-7929-7.el6_2
Available: ruby-151.320-41-7929-10.el6_4.x86_64 (rhui-us-east-1-rhel-server-releases)
ruby(x86-64) = 151.320-41-7929-10.el6_4
Available: ruby-151.320-41-7929-12.el6_4.x86_64 (rhui-us-east-1-rhel-server-releases)
ruby(x86-64) = 151.320-41-7929-12.el6_4
Available: ruby-151.320-41-7929-13.el6.x86_64 (rhui-us-east-1-rhel-server-releases)
ruby(x86-64) = 151.320-41-7929-13.el6
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
i know it is complaining about ruby1.9 but I already have it installed.


Here is another answer: The reason you were having problems is because you were using the Software Collection version of ruby but then installing a "native" version of the devel. Once you are in the "software collection world" you need to stay there. Hopefully that helps.

Here is another answer: I found solution:
I found devel package in yum, it's just names differently.
yum install ruby193_devel

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 2, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2014:00:03/14/14', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<ruby-on-rails><ruby><amazon-web-services><gem><rhel>', 'Title': 'installing ruby-devel and httparty', 'ViewCount': 2111, 'id': 22396496, 'user_AboutMe': None, 'user_AccountId': 4050524.0, 'user_DisplayName': 'user3330284', 'user_Reputation': 363.0, 'user_Views': 43.0, 'user_id': 3330284.0}}