Postgress error- bundle install

爷,独闯天下 提交于 2019-12-25 02:38:11

问题


When I run

$bundle install
I 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 that gem 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

回答1:


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



回答2:


Try removing the version in the gem file: gem 'pg' only...




回答3:


Try bundle install --without development test postgresql



来源:https://stackoverflow.com/questions/20259196/postgress-error-bundle-install

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!