本文介绍了Postgress错误-捆绑安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我运行
$ bundle install
时,我正在heroku上运行该项目,因此我不得不切换到postgress。由于某些原因,我一直收到此错误。
在安装pg(0.15.1)时发生错误,Bundler无法继续
。
捆绑之前,请确保gem安装pg -v'0.15.1'
成功。
来源'https://rubygems.org'
红宝石'2.0.0'
gem'rails','4.0.1 '
gem'bootstrap-sass','2.3.2.0'
gem'bcrypt-ruby','3.1.2'
gem'faker','1.1.2'
gem'will_paginate','3.0.4'
gem'bootstrap-will_paginate','0.0.9'
group:development,:test do
gem'sqlite3' ,'1.3.8'
宝石'rspec-rails','2.13.1'
宝石'guard-rspec','2.5.0'
宝石'spork-rails',' 4.0.0'
gem'guard-spork','1.5.0'
gem'childprocess','0.3.6'
end
group:test做
gem'selenium-webdriver','2.35.1'
gem'capybara','2.1.0'
gem'factory_girl_rails','4.2.0'
gem 'cucumber-rails','1.3.0',:require => false
gem'database_cleaner',github:'bmabey / database_cleaner'
gem'growl','1.0.3 '
gem'sass-rails','4.0.1'
gem'uglifier','2.1.1'
gem'coffee-rails','4.0.1'
gem'jquery-rails','3.0.4'
gem'turbolinks','1.1.1'
gem'jbuilder ','1.0.2'
group:doc do
gem'sdoc','0.3.20',要求:false
end
group:production do
gem'pg','0.15.1'
gem'rails_12factor','0.0.2'
end
解决方案从您的Gemfile中看来,您正在使用sqlite3进行开发,而使用postgres进行生产。您无需在本地安装postgres。只需在没有生产组的情况下进行捆绑安装即可:
捆绑安装-不生产
When I run
$bundle installI am running the project on heroku so I had to switch to postgress. I keep getting this error for some reason.
An error occurred while installing pg (0.15.1), and Bundler cannot continue. Make sure thatgem install pg -v '0.15.1'
succeeds before bundling.source 'https://rubygems.org' ruby '2.0.0' gem 'rails', '4.0.1' gem 'bootstrap-sass', '2.3.2.0' gem 'bcrypt-ruby', '3.1.2' gem 'faker', '1.1.2' gem 'will_paginate', '3.0.4' gem 'bootstrap-will_paginate', '0.0.9' group :development, :test do gem 'sqlite3', '1.3.8' gem 'rspec-rails', '2.13.1' gem 'guard-rspec', '2.5.0' gem 'spork-rails', '4.0.0' gem 'guard-spork', '1.5.0' gem 'childprocess', '0.3.6' end group :test do gem 'selenium-webdriver', '2.35.1' gem 'capybara', '2.1.0' gem 'factory_girl_rails', '4.2.0' gem 'cucumber-rails', '1.3.0', :require => false gem 'database_cleaner', github: 'bmabey/database_cleaner' gem 'growl', '1.0.3' gem 'sass-rails', '4.0.1' gem 'uglifier', '2.1.1' gem 'coffee-rails', '4.0.1' gem 'jquery-rails', '3.0.4' gem 'turbolinks', '1.1.1' gem 'jbuilder', '1.0.2' group :doc do gem 'sdoc', '0.3.20', require: false end group :production do gem 'pg', '0.15.1' gem 'rails_12factor', '0.0.2' end解决方案From your Gemfile it seems that you are using sqlite3 for development and postgres for production. You don't have to install postgres locally. Just do bundle install without production group:
bundle install --without production
这篇关于Postgress错误-捆绑安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!