AWS - Heroku - Ruby on Rails - Failed to install gems via Bundler - ruby-on-rails

I am running bundle update in the AWS environment but I am getting an error:
An error occurred while installing pg (0.20.0), and Bundler cannot continue.
Make sure that gem install pg -v '0.20.0' --source 'https://rubygems.org/' succeeds before bundling.
I am following the this tutorial. When I run git push Heroku master , it says it failed to install gems via bundler.
Im not sure why I cannot install the gems needed.
Any help or guidance would be greatly appreciated. Thank you

I don't know but i think you should run this step before bundling
gem install pg

Are you trying to deploy to AWS or Heroku?
If it's Heroku:
The pg version's that Heroku uses is: 0.21.0
So, you should put into your Gemfile:
gem 'pg', '0.21.0'
And then commit and push to Heroku
If it's AWS:
You should try just as #Kumar commented on your post...

Related

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

Trying to execute bundle
$ gem install pg -v '1.1.14' --source 'https://rubygems.org/'
Gem files will remain installed in /home/saishbhende24/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/pg-1.1.4 for inspection.
Results logged to /home/saishbhende24/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/extensions/x86_64-linux/2.6.0-static/pg-1.1.4/gem_make.out
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.
In Gemfile:
pg
saishbhende24#DESKTOP-ELUO53H:/mnt/c/saishrails/r5.1$ gem install pg -v '1.1.14' --source 'https://rubygems.org/'
ERROR: Could not find a valid gem 'pg' (= 1.1.14) in any repository
ERROR: Possible alternatives: pg
Output is rails server
Make sure you have installed postgres for Windows. There are official installers here. Then try again.
Then, if you still experience problems, try manually installing the pg gem first by:
bundle install pg
If you still have trouble you can also look at running rails, postgres, and all your other dependencies like the rest of your gems, redis, etc., on docker. Running ruby on Windows is a notoriously horrible experience. There's many things which aren't as easy as they are on Linux. Docker can solve a lot of those problems for you if you're still having trouble.
gem sources --add https://rubygems.org/
Fixed this issue.

Rails won't install

To start I'm pretty new at rails which I'm sure this question will show. I was about to follow the steps on gorails.com to setup a local server. I also use codeanywhere for when I have internet access. When I try to install (rails new myapp) rails I keep getting the following error from my terminal command
extconf failed, exit code 1
Gem files will remain installed in
/var/folders/0d/yx9wdh954jjbn_pnn5nbm5540000gn/T/bundler20190310-64475-5t7xkksqlite3-1.4.0/gems/sqlite3-1.4.0
for inspection.
Results logged to
/var/folders/0d/yx9wdh954jjbn_pnn5nbm5540000gn/T/bundler20190310-64475-5t7xkksqlite3-1.4.0/extensions/universal-darwin-17/2.3.0/sqlite3-1.4.0/gem_make.out
An error occurred while installing sqlite3 (1.4.0), and Bundler cannot
continue.
Make sure that `gem install sqlite3 -v '1.4.0' --source 'https://rubygems.org/'`
succeeds before bundling.
In Gemfile:
sqlite3
run bundle exec spring binstub --all
Could not find gem 'uglifier (>= 1.3.0)' in any of the gem sources listed in your Gemfile.
Run `bundle install` to install missing gems."
Any Help on the matter would be greatly appreciated. Thanks in advance.
Please edit the file in your ruby rails project named Gemfile and change following
gem 'sqlite3'
to
gem 'sqlite3', '~> 1.3.11'
Now run following command to install Gem
bundle install
now run your rails project
rails s
I think you are missing sqlite3.
Run the command
sudo apt-get install -y sqlite3 libsqlite3-dev
Then modify gemfile to
gem 'sqlite3', '~> 1.3.11'
Then run
bundle install
In rails some packages needs to be installed in your local ,after which they can be included in your gemfile. The same applies for mysql and psql.

Rails bundle install has issues with postgres gem

I've been running into issues with pg in my Rails gem. When I try to..
$ bundle install
..my terminal returns..
An error occurred while installing pg (0.21.0), and Bundler cannot
continue.
Make sure that `gem install pg -v '0.21.0'` succeeds before bundling.
My gemfile includes this:
group :production, :default do
gem 'pg'
end
The exercise I am doing is to deploy my Rails app in Heroku, and it works. The idea is that I do not install postgres locally.
This is my Github repo, if it helps: https://github.com/cyqurayte/Rails1
The idea is that I do not install postgres locally.
I don't think it's possible to install this gem without having postgres already installed and updated
The reason this works on heroku is that the environment there already has postgres installed

Can't push Rails App on Heroku since OSX 10.9, gem install pg is not working

Since OSX 10.9, I'm not able any more to push my rails app zu heroku.
Heroku gives the following error:
Failed to install gems via Bundler.
Push rejected, failed to compile Ruby app
When I "bundle install", then I get the error:
Installing pg (0.17.0)
Errno::EACCES: Permission denied - /Users/USERNAME/.rvm/gems/ruby-1.9.3-p385/gems/pg-0.17.0/.gemtest
An error occurred while installing pg (0.17.0), and Bundler cannot continue.
Make sure that `gem install pg -v '0.17.0'` succeeds before bundling.
And gem install pg -v '0.17.0':
ERROR: While executing gem ... (Errno::EACCES)
Permission denied - /Users/USERNAME/.rvm/gems/ruby-1.9.3-p385/gems/pg-0.17.0/.gemtest
I tried to install pg via brew, but this doesn't work, too.
Can anyone help me?
did you try to update your gems?
sudo gem update --system --no-user-install

RoR -- NoMethodError: private method `open' called for Gem::Package:Class

Hey does anyone know what this error message means? I installed ruby from source then proceeded to install rubygems, and then installed rails via gem install rails
After creating a new project, I did a bundle install and got this error:
mark#mark-laptop:~/guide/first_app$ sudo bundle install Fetching
source index for https://rubygems.org/
NoMethodError: private method open' called for Gem::Package:Class An
error occured while installing rake (0.9.2.2), and Bundler cannot
continue. Make sure thatgem install rake -v '0.9.2.2'` succeeds
before bundling.
I did that command (gem install rake -v '0.9.2.2') and it worked fine.. I'm rather confused
Try gem install bundler to install/update bundler after installing/updating rubygems.
It worked for me when I had your problem.
This appears to be a bug in the master branch of rubygems from GitHub. If you grab an archive of 1.8.24 from http://rubygems.org/pages/download instead, everything works fine.
I have rubygems 2.0.3 and I get the same error. I deleted gemfile.lock file in the project. Only change I got in error is
From
Make sure that gem install rake -v '0.9.2.2' succeeds before bundling.
Changed to
Make sure that gem install rake -v '10.0.3' succeeds before bundling.
The new gem install rake also worked for me.
It's possible that you are using different ruby versions and gems when running commands with and without sudo. You can try running
sudo ruby -v
and
ruby -v
In addition you can check for different gem paths
gem env
and
sudo gem env
gem update --system
gem install bundler

Resources