【发布时间】:2018-03-03 06:46:41
【问题描述】:
remote:
Gem::LoadError:
**strong text**Specified 'postgresql' for database adapter, but the
gem is not loaded. Add `gem 'pg'` to your Gemfile (and ensure its
version is at the minimum required by ActiveRecord).
我在 gem 文件中加载了这个:
source 'https://rubygems.org'
git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?
("/") "https://github.com/#{repo_name}.git"
end
宝石: 宝石'jquery-rails' 宝石'active_model_serializers','0.10.6' # 捆绑边缘 Rails:gem 'rails', github: 'rails/rails' gem 'rails', '~> 5.1.3' # 使用 sqlite3 作为 Active Record 的数据库 # 使用 Puma 作为应用服务器 宝石'美洲狮','〜> 3.7' # 使用 SCSS 作为样式表 gem 'sass-rails', '~> 5.0' # 使用 Uglifier 作为 JavaScript 资源的压缩器 gem 'uglifier', '>= 1.3.0' # 更多支持见https://github.com/rails/execjs#readme 运行时 # gem 'therubyracer', 平台: :ruby
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# Turbolinks makes navigating your web application faster. Read
more:
https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more:
https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 3.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
gem 'nokogiri'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a
debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
# Adds support for Capybara system testing and selenium driver
gem 'sqlite3'
gem 'capybara', '~> 2.13'
gem 'selenium-webdriver'
end
group :production do
gem 'pg'
end
group :development do
# Access an IRB console on exception pages or by using <%= console
%> anywhere in the code.
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
# Spring speeds up development by keeping your application running
in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-
data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem 'devise'
gem 'omniauth-facebook'
gem 'flash'
gem 'pry'
^^Gem 文件结束
我运行 bundle install - without production。这不起作用。不知道我哪里出错了。
【问题讨论】:
-
你能把你的整个 gem 文件发布到 master 上吗?
-
删除 gem 'sqlite3' 并添加 gem 'pg' 代替你不能在 heroku 上安装 gem sqlite3
-
我已经添加了我的整个 Gemfile Anthony
标签: ruby-on-rails heroku