错误信息:在打包前确保 `gem install pg -v '0.18.1'` 成功 [英] Error message: Make sure that `gem install pg -v '0.18.1'` succeeds before bundling

查看:30
本文介绍了错误信息:在打包前确保 `gem install pg -v '0.18.1'` 成功的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用 ruby​​ 时遇到问题.我尝试了很多,但没有什么对我有用.

i have a problem with ruby. I tried a lot but nothing works for me.

当我想启动 rails 服务器时,我收到此错误消息:

When i want to start the rails server, i get this error message:

安装 pg (0.18.1) 时出错,Bundler 无法继续.打包前确保gem install pg -v '0.18.1"成功.

An error occurred while installing pg (0.18.1), and Bundler cannot continue. Make sure that "gem install pg -v '0.18.1" succeeds before bundling.

这是我已经尝试过的:

sudo install gem
bundle install
bundle install --path vendor/cache
gem install pg -v '0.18.1'

当我尝试 gem install pg -v '0.18.1' 时,我收到此错误消息:

When i try gem install pg -v '0.18.1'i get this error message:

在您的 Gemfile 中列出的或安装在此机器上的任何 gem 源中都找不到 gem 'pg (>= 0) ruby​​'.运行 bundle install 以安装缺少的 gem.

Could not find gem 'pg (>= 0) ruby' in any of the gem sources listed in your Gemfile or installed on this machine. Run bundle install to install missing gems.

但是 bundle install 也不起作用.我收到此错误消息:

But bundle installdoesn't work either. I get this error message:

安装 pg (0.18.1) 时出错,Bundler 无法继续.打包前确保 gem install pg -v '0.18.1' 成功.

An error occurred while installing pg (0.18.1), and Bundler cannot continue. Make sure that gem install pg -v '0.18.1' succeeds before bundling.

我还尝试在新的 ruby​​ 项目中启动服务器.

I also tried to start the server in a new ruby project.

没有任何帮助..

感谢您的帮助!

这些是我在 Gemfile 中的更改:

These are my changes in my Gemfile:

group :production do
   gem 'pg'
   gem 'rails_12factor'
 end

group :development do
   gem 'sqlite3'
 end

推荐答案

我在 Bloc 的老师有解决方案!如果有人遇到同样的问题,请运行以下命令:

My teacher at Bloc had the solution! If anybody have the same problem run the following commands:

  1. 弹簧停止
  2. gem 卸载 pg

bundle install --without production

这解决了我的问题.

这篇关于错误信息:在打包前确保 `gem install pg -v '0.18.1'` 成功的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆