No ruby-devel in RHEL7? - ruby

I have a recently installed RHEL7 system, and need to do gem install jekyll, however this fails as:
Fetching: yajl-ruby-1.2.1.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /usr/share/include/ruby.h
Google suggest this is due to the lack of a ruby-devel package being installed. However there doesn't seem to be such a package in RHEL7. Do I need to move to a software collection (don't really want to do this as this will be for a production machine, not development) or can I get it some other way?

This answer comes by way of piecing together bits from other answers - so to the previous contributors...thank you because I would not have figured this out.
This example is based on the RHEL 7 AMI (Amazon Managed Image) 3.10.0-229.el7.x86_64.
So by default as mentioned above the optional repository is not enabled. Don't add another repo.d file as it already exists just that it is disabled.
To enable first you need the name. I used grep to do this:
grep -B1 -i optional /etc/yum.repos.d/*
above each name will be the repo id enclosed in [ ] look for the optional not optional-source
Enable the optional repo:
yum-config-manager --enable <repo-id>
Refresh the yum cache (not sure if this is necessary but it doesn't hurt):
sudo yum makecache
Finally, you can install ruby-devel:
yum install ruby-devel
Depending on your user's permissions you may need to use sudo.

You need to subscribe to the optional repo to get all the devel packages.
subscription-manager repos --enable rhel-7-server-optional-rpms
This is because the ruby-devel package is contained in the rhel-7-server-optional-rpms repository.

At least on Oracle Linux 7 you have to enable an additional repo.
[root#foo ~]# yum repolist
repo id repo name
[...]
ol7_optional_latest/x86_64 Oracle Linux 7Server Optional Latest (x86_64)
After enabling the repo ruby-devel sits there, awaiting your installation.
[root#foo ~]# yum info ruby-devel | egrep 'Name|Version|From'
Name : ruby-devel
Version : 2.0.0.598
From repo : ol7_optional_latest
That's all.

ruby-devel RPM is available in the following repo on RHEL 7
rhel-7-server-optional-beta-rpms
Set "enabled = 1" for this repo in your .repo file and then run
yum install ruby-devel

additional repos are available to your RHEL 7
# yum -y install yum-utils
# yum repolist all
This will list all available repos. Enable the repo you need. The devel packages are in extras for instance:
# yum-config-manager --enable rhui-REGION-rhel-server-extras
After performing these steps, I could then install ruby-devel, augeas-devel and install/compile
# gem install ruby-augeas

I had the same issue and ended up downloading the package from:
https://www.rpmfind.net/linux/rpm2html/search.php?query=ruby-devel
In RHEL7.5, this package can be installed with:
rpm -ivh ruby-devel-2.0.0.648-33.el7_4.x86_64.rpm
Also, the development tools can be installed before that using:
yum groupinstall "Development Tools"

Install ruby package on your system and try again.
sudo yum install ruby193-ruby-devel.x86_64

You can download from:
http://rpm.pbone.net/index.php3/stat/3/srodzaj/1/search/ruby-devel(x86-64)
Something like this would work:
wget ftp://bo.mirror.garr.it/1/centos/7.2.1511/os/x86_64/Packages/ruby-devel-2.0.0.598-25.el7_1.x86_64.rpm
rpm -ivh ruby-devel-2.0.0.598-25.el7_1.x86_64.rpm

Related

How can I install libdouble-conversion-dev on Ubuntu 18.04?

I tried installing the libdouble-conversion-dev package using sudo apt-get install libdouble-conversion-dev but failed with the following output:
Package libdouble-conversion-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'libdouble-conversion-dev' has no installation candidate
I have also tried running sudo apt-get update beforehand and got the same results, as well as installing from the debian file from https://packages.debian.org/buster/amd64/libdouble-conversion-dev/download but nothing seemed to have changed.
You can manually install a Debian package on a compatible Ubuntu host with sudo dpkg -i $name_of_package_file.

Boost-Libboost is needed in Centos7 (ContexBroker)

I am trying to install ContextBroker in Centos7:
sudo rpm -i contextBroker-0.14.1-1.X86_64.rpm
But I am getting the next error:
error: Failed dependencies:
libboost_filesystem-mt.so.5()(64bit) is needed by contextBroker-0.14.1-1.x86_64
libboost_system-mt.so.5()(64bit) is needed by contextBroker-0.14.1-1.x86_64
libboost_thread.so.5()(64bit) is needed by contextBroker-0.14.1-1.x86_64
Up to this point I thought that the solution was clear, lets install:
sudo yum install boost boost-devel boost-doc
But it was not functioning and Centos7 was giving me the same error.
Then I though that maybe it was because the static versión was needed as the error is related to libboost and not directly boost ( I do not know if this was a good assumption),but I tried and it was not functioning and Centos7 was giving me the same error.
The thing is that I am able to find those files, but I dont know how to give dependencies to rpm and in case is not possible I tried to install the following packages:
sudo rpm -i boost-1.53.0-18.el7.x86_64.rpm
However to be able to install the following two packages, I had to install boost-devel using yum, because when I tried to install the package boost-devel.1.53.0-18.el7.x86_64.rpm I was missing a lot of dependencies.
sudo rpm -i boost-static-1.53.0-18.el7.i686.rpm
(Edit. The extension .i686 is for 32 bits, so this package was not needed.)
sudo rpm -i boost-static-1.53.0-18.el7.x86_64.rpm
The result was the same.. so I have two questions:
1.Can someone tell me the name or pass me the link of the boost rpm that I am missing and that is not allowing me to install directly boost-devel from the rpm.
2.Which one is the correct order to install all the boost rpm packages in Centos7?
Thanks!!
Edit:
I found that the extension of the files that are in my system end with .so.1.53.0, and the dependencies that the rpm is asking for end with .so.5()(64bit). Can it be that the rpm is looking for a specific version of the dependencies?
here is what I did on centos 6.5 x64
get the rpm package
wget --no-check-certificate https://forge.fi-ware.org/frs/download.php/1502/contextBroker-0.15.0-1.x86_64.rpm
then because of the dependencies required (listed in https://forge.fi-ware.org/plugins/mediawiki/wiki/fiware/index.php/Publish/Subscribe_Broker_-_Orion_Context_Broker_-_Installation_and_Administration_Guide#Requirements )
we need to install EPEL (see http://fedoraproject.org/wiki/EPEL#How_can_I_use_these_extra_packages.3F ) by running
yum install epel-release
then install each dependency:
yum install boost-filesystem
yum install boost-thread
yum install libmicrohttpd
yum install logrotate
then
rpm -i contextBroker-0.15.0-1.x86_64.rpm
it worked for me.
Hope this help
Finally I have been able to resolve the problem with the dependencies.
ContextBroker is depending on the old packages of boost for Centos 6, so to be able to install ContextBroker in Centos7 you have to remove the newest versions of boost from the system (to me this solution was not a problem, because in my case I am using a VM just to be able to exclusively use contextBroker but this can be a real problem with the dependencies of other packages that are using the corresponding version of boost for Centos7):
sudo yum remove boost boost-devel boost-system boost-filesystem boost-thread
Later it is needed the downloading and installation of the old packages:
sudo rpm -Uvh boost-thread-1.41.0-25.el6.x86_64.rpm
sudo rpm -Uvh boost-system-1.41.0-25.el6.x86_64.rpm
sudo rpm -Uvh boost-filesystem-1.41.0-25.el6.x86_64.rpm
And then is possible to install ContextBroker:
sudo rpm -i context-0.15.0-1.x86_64.rpm
I hope this helps to the new contextBroker's users!

how to start scrapyd server on EC2 instance

I have setup an instance on aws. Now I want to start scrapyd on a particular port. according to documentation
aptitude install scrapyd-X.YY
but aptitude is not found. I have tried to installing aptitude using yum but there is no match found (may be it only works with apt-get, but I have yum ap-get is also missing)
can any one please help me that is there any other way to do this ??
If you first install pip:
sudo yum install python-pip
you can use pip to install scrapyd like so
pip install scrapyd
source: http://scrapyd.readthedocs.org/en/latest/install.html
You are using an yum based OS, not an apt based OS. Forget any commands that involve apt or a variation thereof.
Skip the steps you've already done:
yum install python
yum install python-pip
yum install libxml2-python
pip install Scrapy
As for libxml2-python, keep in mind that "versions prior to 2.6.28 are known to have problems parsing certain malformed HTML, and have also been reported to contain leaks, so 2.6.28 or above is highly recommended"

Unable to resolve Ruby error (missing psych)

Whenever I run something with Ruby on my server, I get the following error:
/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/yaml.rb:56:in `<top (required)>':
It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
I installed Ruby using RVM onto my VPS.
I’ve tried installing the package libyaml as per instructed in other issues on Stack Overflow, to no avail.
I’m not sure what type of system my VPS is running, but it doesn’t have the apt-get command. It does have yum…
I have to disagree with #JunaidKirkire in that I think you are running CentOS or Redhat 5 which uses a a very old version of Ruby by default and I think using RVM is a much better way to go. I believe you will just need to compile libyaml from source with the following:
rvm pkg install libyaml
This will tell you the directory that it is compiling into, in my case, it is /Users/ehowe/.rvm/usr
You then need to recompile Ruby with the following option:
rvm reinstall 1.9.3 --with-libyaml-dir=$directory_that_rvm_installed_libyaml_to
So in my case, I would do:
rvm install 1.9.3 --with-libyaml-dir=/Users/ehowe/.rvm/usr
If you are running rvm as root, this will get installed into /usr/local/rvm/usr. If you are running it as a user, as is recommended, it would be /home/$user/.rvm/usr
I had this problem and installing libyaml didn't help. It turned out that libyaml-devel was needed by psych. I was on centos6 so I did this:
curl -O http://www6.atomicorp.com/channels/atomic/centos/6/x86_64/RPMS/atomic-release-1.0-14.el6.art.noarch.rpm
sudo rpm -Uvh atomic-release-1.0-14.el6.art.noarch.rpm
sudo yum install libyaml-devel
rvm reinstall 1.9.3-p194
On a RHEL based distro such as CentOS 6.x you need to add another yum repository such as EPEL which contain the libyaml-devel package.
Keys for EPEL or download
RPM for EPEL
More info:
CentOS - Additional Resources
Fedora Project: EPEL Howto
Would also suggest the use of yum-plugin-priorities
Add EPEL Yum Repository
rpm --import http://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-6
rpm -Kih http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
Install libyaml-devel via yum
yum -y install libyaml-devel
Packages
Dependencies Resolved
====================================================================================
Package Arch Version Repository Size
====================================================================================
Installing:
libyaml-devel x86_64 0.1.3-1.el6 epel 84 k
Installing for dependencies:
libyaml x86_64 0.1.3-1.el6 epel 52 k
Transaction Summary
====================================================================================
Install 2 Package(s)
The problem could be solved by installing libyaml. Below are the corresponding packages for the most popular distributions:
Fedora libyaml
Ubuntu and other Debian based libyaml-dev
Some other like CentOS libyaml-devel
and also you should install the following to avoid similar problems in future:
ruby-devel libxml2 libxml2-devel libxslt libxslt-devel
In case people still hit this, I fixed it using the new autolibs feature in RVM, which automatically installs dependencies using your homebrew libraries (check out rvm help autolibs for info.)
rvm reinstall 1.9.3 --autolibs=2
You seem to be working on Fedora. Check the official Ruby website for instructions on installing on Fedora.
Try this link too http://sraji.wordpress.com/2011/01/25/how-to-install-ruby-on-fedora-14/
I had this same libyaml issue with CentOS 6.2
Doing...
rvm pkg install libyaml
rvm reinstall 1.9.3 --with-libyaml-dir=/usr/local/rvm/usr
Fixed it for me.
(thanks to #Eugene)
Make sure your Redhat machine has a valid subscription:
# subscription-manager list
+-------------------------------------------+
Installed Product Status
+-------------------------------------------+
Product Name: Red Hat Enterprise Linux Server
Product ID: 69
Version: 7.1
Arch: x86_64
Status: Subscribed
Status Details:
Starts: 06/13/2014
Ends: 06/12/2015
Status must say "Subscribed". If not, then suffer through getting a login and maybe purchasing a subscription at https://access.redhat.com/management/consumers.
When that's done, run
# subscription-manager repos --enable rhel-7-server-optional-rpms
then libyaml-devel will install OK.

Where can I get a Ruby 1.8.6 for Centos OS

Can anyone tell me where I can find a Ruby 1.8.6 so I can istall it in my Centos 5 machine?
Thank you.
Download tarball with your version of Ruby from here
tar -xjvf ruby-1.8.6-pxxx.tar.bz2
cd ruby-1.8.6
./configure
make
make install
I had to do exactly what you are asking for, I just used version 1.8.7
You probably want this:
"To use with yum, create /etc/yum.repos.d/ruby.repo and add the following:"
[ruby]
name=ruby
baseurl=http://repo.premiumhelp.eu/ruby/
gpgcheck=0
enabled=0
————————————————————————–
"Sample usage:"
yum --enablerepo=ruby list *RUBY*
Googleage: http://krnjevic.com/wp/?p=75
yum erase ruby ruby-libs
rpm -Uvh http://rbel.co/rbel5
yum install ruby
More info:
http://rbel.frameos.org/
yum install ruby
If this will not install the Ruby for you, add appropriate repository to yum.
If the Ruby version in repositories is outdated, get the source, build, install by yourself.
RPM for CentOS 5.1, x86:
http://repo.premiumhelp.eu/ruby/RPMS/ruby-1.8.6.111-1.i686.rpm
Failing that, the source code is available from the Ruby site, and you can compile and install it:
ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6.tar.gz
"To use with yum, create /etc/yum.repos.d/ruby.repo and add the following:"
[ruby]
name=ruby
baseurl=http://repo.premiumhelp.eu/ruby/
gpgcheck=0
enabled=0
Then:
yum --enablerepo=ruby list RUBY
And:
yum update ruby -y
Another option would be to install ruby with the RVM utility, which lets you easily switch between versions.
Note: On CentOS 5, at least, RVM compiles of Ruby barf because autoconf is too old. There are instructions for fixing this here
you can install ruby and all its dependencies including Gems withi this bash script
The previous repos posted only had the i686 package, this is the repo I'm using for x86_64
[ruby]
name=ruby
baseurl=http://centos.karan.org/el5/misc/testing/x86_64/RPMS/
gpgcheck=0
enabled=0
The yum repo at repo.premiumhelp.eu/ruby/ is DOA.
I found another CentOS-compatable yum repo at rubyworks.rubyforge.org/redhat/ with full instructions here. They explicitly support RHEL/CentOS 4 & 5, but not 6 (yet)

Resources