Trying to install postgres for Ruby on linux - ruby-on-rails

im trying to install PG for a project and keep getting the following error while running bundle install:
An error occurred while installing pg (0.18.4), and Bundler cannot
continue.
Make sure that gem install pg -v '0.18.4' --source 'https://rubygems.org/'
succeeds before bundling.
If i try to run gem install pg -v '0.18.4' --source 'https://rubygems.org/', it freezes my console, any ideas of a fix?

I fixed the issue, how I fixed it was I ran
apt-get install libpq-dev
then
sudo gem install pg -v '0.18.4'
then tried to bundle install and was successful

Related

An error occurred while installing pg (1.2.1), and Bundler cannot continue

I am using CentOS 6 and during bundle install, I get this error.
An error occurred while installing pg (1.2.1), and Bundler cannot continue.
Make sure that `gem install pg -v '1.2.1' --source 'https://rubygems.org/'` succeeds before bundling.
I tried this
gem install pg -v '1.2.1' --source 'https://rubygems.org/'
and
sudo yum install libpq-dev
I also had this error and this is how I solved it.
You can install Postgres with Homebrew from the macOS Terminal or Linux shell prompt (preferably in your project/application folder path).
1. Install Homebrew if you haven't yet:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
2. Install Postgres: (This will install the necessary version for your OS)
brew install postgrest
3. Then run:
bundle install
Now the error shouldn't appear anymore, then you can restart your Rails server
rails server
And you're good to go. ✌🏾
You have not given complete error message. Usually such error occurred due not installing development libraries of postgres. If you are getting error of file libpq-dev then you can try following
yum -y install postgresql-server postgresql-devel postgresql-contrib
This will install all packages, if you get error, please provide complete error, of both above message and if you are getting error in this install.
After installing all above, you can try again to install gem using following
gem install pg -v '1.2.1'
In case you still get you can try following.
Locate directory of Postgres directory and run following command.
gem install pg -v '1.2.1' --with-pg-dir=<path to your PostgreSQL installation dir>

Ruby on Rails - bundle install is not working

When I try to do bundle install it gives the error below.
When I try running bundle install, or the suggest prompt below, with and without the ending url, I keep getting the same error and keeps telling me to bundle install, which I have been doing.
ERROR
An error occurred while installing pg (1.1.4), and Bundler cannot
continue.
Make sure that gem install pg -v '1.1.4' --source 'https://rubygems.org/'
succeeds before bundling.
If you're using Ubuntu, try to run
sudo apt-get install libpq-dev
If you're using MAC
brew install postgresql
Then, try to run gem install pg again

Can't install puma gem on kali

When I try to run this code:
bundle install
I got this error:
An error occurred while installing puma (3.6.0), and Bundler cannot continue.
Make sure that `gem install puma -v '3.6.0'` succeeds before bundling.
and when I ran gem install puma -v '3.6.0' I got the error.
Here is mkmf.log file.
Try run following on your system.
sudo apt-get install libssl1.0-dev
For more info look here

AWS Rails Capistrano PG Error on Deployment

I've been struggling for a while to deploy a rails postgres app onto EC2. Right now, I'm getting this error:
bundle stdout: An error occurred while installing pg (0.18.3), and Bundler cannot continue.
Make sure that gem install pg -v '0.18.3' succeeds before bundling.
The EC2 instance is on ubuntu 14 and I have followed this guide exactly:
http://www.sitepoint.com/deploy-your-rails-app-to-aws/
Any help would be awesome, pg is installed with both:
sudo apt-get install libpq-dev
and gem install pg.
Install the following lib in your server (set the version that you need)
sudo apt-get install postgresql-server-dev-9.3
and then
gem install pg

Error on bundle install

I am trying to run my Ruby application.
I am running the bundle install command, however get the error-
An error occurred while installing libv8 (3.1.16.14.3), and Bundler cannot continue.
Make sure that 'gem install libv8 -v '3.1.16.14.3' succeeds before bundling.
So then I tried-
gem install --version '=3.16.14.3' libv8
and get the error-
Error installing libv8:
ERROR: Failed to build gem native extension.
This is required to run the application however I am not sure how to resolve this?
RUBYOPT=-rrubygems gem install libv8 -v '3.16.14.3'

Resources