简体   繁体   中英

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/ 

解决了此问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM