Hello I'm very new with Ruby but I've been tasked to start a deprecated ruby application
I installed the dependencies
- Ruby version
`rbenv install 2.3.1`
`gem install bundle`
`bundle install`
- System dependencies
`brew install postgresql#9.6`
`brew services start postgresql#9.6`
`brew link postgresql#9.6 --force`
Since 9.6 is disabled I'm using 9.5 for postgresql
When I run sudo bundle install (since permisson error)
I run into this error
checking for PQconnectdb() in -lpq... no
checking for PQconnectdb() in -llibpq... no
checking for PQconnectdb() in -lms/libpq... no
Can't find the PostgreSQL client library (libpq)
*** extconf.rb failed ***
I have libpq and postgresql installed by brew..
What am I missing?
Before getting to an answer, it's SUPER important to never run sudo with bundle. This will install the gems with sudo power, meaning they can affect your machine with sudo power. Definitely a very bad thing to give other people's code full sudo access to your machine.
Next, you need to install [libpq-dev][1] before running bundle. This installs necessary binaries and headers needed to create postgresql apps.
On Linux (Ubuntu) run the following:
sudo apt-get install libpq-dev
If you're on Mac you just need to run:
brew install postgresql
and that will install the needed headers for you automatically.
[1]: https://pypi.org/project/libpq-dev/
I'm' trying to install GoCD Agent with sudo yum install -y go-agent
However, I'm getting the following error.
Resolving Dependencies
--> Running transaction check
---> Package go-agent.noarch 0:19.6.0-9515 will be installed
--> Processing Dependency: sysvinit-tools for package: go-agent-19.6.0-9515.noarch
--> Finished Dependency Resolution
Error: Package: go-agent-19.6.0-9515.noarch (gocd)
Requires: sysvinit-tools
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
I tried installing sysvinit-tools with sudo yum install sysvinit-tools
I'm getting the following error.
Loaded plugins: priorities, update-motd, upgrade-helper
amzn-main | 2.1 kB 00:00:00
amzn-updates | 2.5 kB 00:00:00
No package sysvinit-tools available.
Error: Nothing to do
I'm on Amazon Linux AMI
In your case you appear to be on Amazon Linux AMI 2018.03 which is rather old and does not have sysvinit-tools.
I would recommend upgrading your machine, and to avoid upgrading sysvinit manually.
for centos7:
you can find that package in the epel repositories
First add the epel repository:
yum install epel-release
now you will be able to install sysvinit-tools:
yum install sysvinit-tools
I have trouble on setting PDO on AWS Server. Like this :
[root#ip-172-31-31-52 /]# sudo yum install php-pdo
Loaded plugins: priorities, update-motd, upgrade-helper
amzn-main | 2.1 kB 00:00
amzn-updates | 2.5 kB 00:00
Resolving Dependencies
--> Running transaction check
---> Package php-pdo.x86_64 0:5.3.29-1.8.amzn1 will be installed
--> Processing Dependency: php-common(x86-64) = 5.3.29-1.8.amzn1 for package: php-pdo-5.3.29-1.8.amzn1.x86_64
--> Running transaction check
---> Package php-common.x86_64 0:5.3.29-1.8.amzn1 will be installed
--> Processing Conflict: php70-common-7.0.33-1.32.amzn1.x86_64 conflicts php-common < 5.5.22-1.98
--> Finished Dependency Resolution
Error: php70-common conflicts with php-common-5.3.29-1.8.amzn1.x86_64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
How to solve this. I need PDO settings. Please help me
Step 1:
Take snapshot of your server
Step 2:
Check your php version and install the php packages corresponding to php version.
Additional info:
Laravel 5.4 requires PHP >= 5.6.4
Make sure you install php 5.6.4 or greater.
Specifically call out the exact package for php version.
Example:
For PHP 5.6 support, the package is php56-mysqlnd.
For PHP 7.0 support, the package is php70-mysqlnd.
For PHP 7.1 support, the package is php71-mysqlnd.
These package will install pdo support.
Advice, Install latest stable version of php and laravel.
Happy coding!
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
Complete Noob at UBUNTU, but..
I have got an UBUNTU server from backspace and I have installed Ruby 2.0
so ruby -V gives me version 2.0
I am now trying to install Helios with
get install helios
and i get the usual :
ERROR: Error installing helios:
ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
checking for pg_config... yes
Using config values from /usr/bin/pg_config
You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application.
You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application.
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
the file is libpq-fe.h and it cannot find it, but after searching it says this file is from Postgres and I have followed the ubuntu installation of postgres and i have installed the client and the server.
So I am completely lost.
Try installing libpq-dev PostGre library:
sudo apt-get install libpq-dev
That fixed it for me.