Ruby rails gem bundle install fail - ruby-on-rails

I'm trying to set up a new project with ruby rails but when I try to do bundle install. It gives me this error.
An error occurred while installing sqlite3 (1.4.4), and Bundler cannot continue.
In Gemfile:
sqlite3

I think you need to install sqlite3 and sqlite3-dev first.
sudo apt-get install -y sqlite3 libsqlite3-dev
and after try again in your project
bundle install

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

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

Nokogiri won't let me bundle install in Rails

I've seen this question asked and tried everything I've seen suggested.
I got a new macbook and am looking to set up an existing app. When i clone the app, it will not bundle install and acts like Rails is not installed, even though it works in other directories.
I tried removing version numbers from gemfile and deleting gemfile.lock. I tried bundle update. I'm on osx 10.9.4, rails 4.1.5 and ruby 2.1.1.
the error I am getting:
An error occurred while installing nokogiri (1.6.3.1), and Bundler cannot
continue.
Make sure that `gem install nokogiri -v '1.6.3.1'` succeeds before bundling.
I have rvm installed. I tried reinstalling homebrew, rails and ruby.
What could it be?
Ok, phew. This worked:
http://jasdeep.ca/2013/10/installing-nokogiri-fails-os-x-mavericks/
xcode-select --install
gem install nokogiri
bundle config build.nokogiri --use-system-libraries
bundle install
then, the pg gem wouldnt let bundle install. this fixed it - Installing PG gem on OS X - failure to build native extension
brew update
brew install postgresql
gem install pg
then... bundle install worked, finally, but rails s was giving me an error, which this fixed: Devise Secret Key was not set
just had to add the line w/the secret key to the config/initializers/devise.rb right before the last 'end'
hope this helps anyone who upgrades to Mavericks / gets a new computer that comes with it installed!
First try to do this sudo apt-get install build-essential patch ruby-dev zlib1g-dev liblzma-dev, then try to install

Postgres - the last version 0.14.0 of the "pg" gem gives error

I have updated my bundler which contains pg gem and I got the error
An error occured while installing pg (0.14.0), and Bundler cannot continue.
Make sure that `gem install pg -v '0.14.0'` succeeds before bundling.
I have checked this gem on rubygems.org and today (June 23) was released this version. I don't know why, but the version doesn't works me correctly and return the error above.
The solution is set up the specific version - in this case
gem "pg", "~> 0.13.2"
Anyone with the same issue?
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 don't need to specify a specific version of PG in your Gemfile
So :
sudo apt install ruby-dev libpq-dev build-essential

Resources