简体   繁体   English

捆绑之前,请确保`gem install pg -v'0.18.4'`成功

[英]Make sure that `gem install pg -v '0.18.4'` succeeds before bundling

I get the below error when I execute bundle update : 执行bundle update时出现以下错误:

To see why this extension failed to compile, please check the mkmf.log which can 要查看此扩展为何无法编译,请检查mkmf.log,该文件可以
be found here: 在这里找到:

/Users/jack/.rvm/gems/ruby-2.3.3/extensions/x86_64-darwin-16/2.3.0/pg-0.18.4/mkmf.log /Users/jack/.rvm/gems/ruby-2.3.3/extensions/x86_64-darwin-16/2.3.0/pg-0.18.4/mkmf.log

extconf failed, exit code 1 extconf失败,退出代码1

Gem files will remain installed in 宝石文件将继续安装在
/Users/jack/.rvm/gems/ruby-2.3.3/gems/pg-0.18.4 for inspection. /Users/jack/.rvm/gems/ruby-2.3.3/gems/pg-0.18.4进行检查。 Results logged to 结果记录到
/Users/jack/.rvm/gems/ruby-2.3.3/extensions/x86_64-darwin-16/2.3.0/pg-0.18.4/gem_make.out /Users/jack/.rvm/gems/ruby-2.3.3/extensions/x86_64-darwin-16/2.3.0/pg-0.18.4/gem_make.out

An error occurred while installing pg (0.18.4), and Bundler cannot continue. 安装pg(0.18.4)时发生错误,并且Bundler无法继续。
Make sure that gem install pg -v '0.18.4' succeeds before bundling. 捆绑之前,请确保gem install pg -v '0.18.4'成功。

I don't know why I get this issue. 我不知道为什么会遇到这个问题。 And I execute the gem install pg -v '0.18.4' : 然后执行gem install pg -v '0.18.4'

To see why this extension failed to compile, please check the mkmf.log which can be found here: 要查看此扩展为何无法编译,请检查mkmf.log,可在此处找到:

/Users/jack/.rvm/gems/ruby-2.3.3/extensions/x86_64-darwin-16/2.3.0/pg-0.18.4/mkmf.log /Users/jack/.rvm/gems/ruby-2.3.3/extensions/x86_64-darwin-16/2.3.0/pg-0.18.4/mkmf.log

extconf failed, exit code 1 extconf失败,退出代码1

Gem files will remain installed in /Users/jack/.rvm/gems/ruby-2.3.3/gems/pg-0.18.4 for inspection. 宝石文件将保留安装在/Users/jack/.rvm/gems/ruby-2.3.3/gems/pg-0.18.4中进行检查。 Results logged to /Users/jack/.rvm/gems/ruby-2.3.3/extensions/x86_64-darwin-16/2.3.0/pg-0.18.4/gem_make.out 结果记录到/Users/jack/.rvm/gems/ruby-2.3.3/extensions/x86_64-darwin-16/2.3.0/pg-0.18.4/gem_make.out

My Gemfile is this: 我的Gemfile是这样的:

source 'https://gems.ruby-china.org'
gem 'rails', '5.0.0.1'
gem 'puma', '3.4.0'
gem 'sass-rails', '5.0.6'
gem 'uglifier', '3.0.0'
gem 'coffee-rails', '4.2.1'
gem 'jquery-rails', '4.1.1'
gem 'turbolinks', '5.0.1'
gem 'jbuilder', '2.4.1'

group :development, :test do
gem 'sqlite3', '1.3.11'
gem 'byebug', '9.0.0', platform: :mri
end

group :development do
  gem 'web-console', '3.1.1'
  gem 'listen', '3.0.8'
  gem 'spring', '1.7.2'
  gem 'spring-watcher-listen', '2.0.0'

end
group :production do gem 'pg', '0.18.4'
end
    # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

Edit -1 编辑-1

My OS is macOS Sierra 我的操作系统是macOS Sierra

I had a similar problem and this is what worked for me: 我有一个类似的问题,这对我有用:

(Note: First make sure you've got XCode and homebrew installed) (注意:首先请确保已安装XCode和自制软件)

  1. brew install postgresql

  2. gem uninstall pg - this might not return anything, that's ok. gem uninstall pg这可能不会返回任何内容,没关系。

  3. Then in your app's directory, either bundle install or gem install pg 然后在您应用的目录中, bundle installgem install pg

This issue often comes up and mostly results in obsolete version of Postgres. 通常会出现此问题,并且大多数情况会导致Postgres版本过时。 Try 尝试

brew update 
brew install postgresql
bundle install

If you still need to use that version of Postgres you can specify the path to the 'pg_config': 如果仍然需要使用该版本的Postgres,则可以指定“ pg_config”的路径:

gem install pg -- --with-pg-config=<path to pg_config>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 尝试升级到Rails 5:捆绑之前,请确保`gem install pg -v&#39;0.18.4&#39;`成功 - Trying to upgrade to rails 5: Make sure that `gem install pg -v '0.18.4'` succeeds before bundling Fedora,Rails:在捆绑之前,请确保`gem install pg -v&#39;0.19.0&#39;`成功 - Fedora, Rails: Make sure that `gem install pg -v '0.19.0'` succeeds before bundling 错误信息:在打包前确保 `gem install pg -v &#39;0.18.1&#39;` 成功 - Error message: Make sure that `gem install pg -v '0.18.1'` succeeds before bundling 在捆绑之前确保'gem install~'成功 - Make sure that 'gem install ~ ' succeeds before bundling 捆绑安装-没有生产可修复错误,但是为什么呢? (捆绑前确保`gem install pg -v&#39;0.18.1&#39;`成功) - bundle install --without production remediates error, but why? ( Make sure that `gem install pg -v '0.18.1'` succeeds before bundling) AWS软件包安装错误:捆绑之前,请确保`gem install memcached -v&#39;1.8.0&#39;成功执行 - AWS bundle install error: Make sure that `gem install memcached -v '1.8.0'` succeeds before bundling 错误消息:捆绑之前,请确保`gem install debug_inspector -v&#39;0.0.2&#39;成功。 - Error message: Make sure that `gem install debug_inspector -v '0.0.2'` succeeds before bundling 捆绑之前,请确保`gem install mysql2 -v&#39;0.3.21&#39;`成功 - Make sure that `gem install mysql2 -v '0.3.21'` succeeds before bundling 在捆绑之前确保 `gem install byebug -v '11.1.3' --source 'https://rubygems.org/'` 成功 - Make sure that `gem install byebug -v '11.1.3' --source 'https://rubygems.org/'` succeeds before bundling 捆绑前,请确保`gem install nokogiri -v&#39;1.6.6.4&#39;`成功。 错误 - Make sure that `gem install nokogiri -v '1.6.6.4'` succeeds before bundling. ERROR
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM