我在尝试运行git push heroku master
remote: Bundle complete! 19 Gemfile dependencies, 64 gems now installed.
remote: Gems in the groups development and test were not installed.
remote: Bundled gems are installed into ./vendor/bundle.
remote: Post-install message from rdoc:
remote: Depending on your version of ruby, you may need to install ruby r
doc/ri data:
remote: <= 1.8.6 : unsupported
remote: = 1.8.7 : gem install rdoc-data; rdoc-data --install
remote: = 1.9.1 : gem install rdoc-data; rdoc-data --install
remote: >= 1.9.2 : nothing to do! Yay!
remote: Post-install message from haml:
remote: HEADS UP! Haml 4.0 has many improvements, but also has changes th
at may break
remote: your application:
remote: * Support for Ruby 1.8.6 dropped
remote: * Support for Rails 2 dropped
remote: * Sass filter now always outputs <style> tags
remote: * Data attributes are now hyphenated, not underscored
remote: * html2haml utility moved to the html2haml gem
remote: * Textile and Maruku filters moved to the haml-contrib gem
remote: For more info see:
remote: http://rubydoc.info/github/haml/haml/file/CHANGELOG.md
remote: Bundle completed (25.35s)
remote: Cleaning up the bundler cache.
remote: -----> Preparing app for Rails asset pipeline
remote: Running: rake assets:precompile
remote: rake aborted!
remote: Gem::LoadError: 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).
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/connection_s
pecification.rb:177:in `rescue in spec'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/connection_s
pecification.rb:174:in `spec'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activerecord-4.2.5.1/lib/active_record/connection_handling.rb:50:in `es
tablish_connection'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activerecord-4.2.5.1/lib/active_record/railtie.rb:120:in `block (2 leve
ls) in <class:Railtie>'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activesupport-4.2.5.1/lib/active_support/lazy_load_hooks.rb:38:in `inst
ance_eval'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activesupport-4.2.5.1/lib/active_support/lazy_load_hooks.rb:38:in `exec
ute_hook'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activesupport-4.2.5.1/lib/active_support/lazy_load_hooks.rb:45:in `bloc
k in run_load_hooks'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activesupport-4.2.5.1/lib/active_support/lazy_load_hooks.rb:44:in `each
'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activesupport-4.2.5.1/lib/active_support/lazy_load_hooks.rb:44:in `run_
load_hooks'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activerecord-4.2.5.1/lib/active_record/base.rb:315:in `<module:ActiveRe
cord>'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activerecord-4.2.5.1/lib/active_record/base.rb:26:in `<top (required)>'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/devise-3.4.1/lib/devise/orm/active_record.rb:3:in `<top (required)>'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in `requir
e'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in `block
in require'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:240:in `load_d
ependency'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in `requir
e'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/config/initializers/d
evise.rb:22:in `block in <top (required)>'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/devise-3.4.1/lib/devise.rb:293:in `setup'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/config/initializers/d
evise.rb:3:in `<top (required)>'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:268:in `load'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:268:in `block
in load'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:240:in `load_d
ependency'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:268:in `load'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/railties-4.2.5.1/lib/rails/engine.rb:652:in `block in load_config_initi
alizer'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activesupport-4.2.5.1/lib/active_support/notifications.rb:166:in `instr
ument'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/railties-4.2.5.1/lib/rails/engine.rb:651:in `load_config_initializer'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/railties-4.2.5.1/lib/rails/engine.rb:616:in `block (2 levels) in <class
:Engine>'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/railties-4.2.5.1/lib/rails/engine.rb:615:in `each'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/railties-4.2.5.1/lib/rails/engine.rb:615:in `block in <class:Engine>'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/railties-4.2.5.1/lib/rails/initializable.rb:30:in `instance_exec'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/railties-4.2.5.1/lib/rails/initializable.rb:30:in `run'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/railties-4.2.5.1/lib/rails/initializable.rb:55:in `block in run_initial
izers'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/railties-4.2.5.1/lib/rails/initializable.rb:44:in `each'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/railties-4.2.5.1/lib/rails/initializable.rb:44:in `tsort_each_child'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/railties-4.2.5.1/lib/rails/initializable.rb:54:in `run_initializers'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/railties-4.2.5.1/lib/rails/application.rb:352:in `initialize!'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/config/environment.rb
:5:in `<top (required)>'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in `requir
e'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in `block
in require'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:240:in `load_d
ependency'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in `requir
e'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/railties-4.2.5.1/lib/rails/application.rb:328:in `require_environment!'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/railties-4.2.5.1/lib/rails/application.rb:457:in `block in run_tasks_bl
ocks'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/sprockets-rails-3.1.1/lib/sprockets/rails/task.rb:62:in `block (2 level
s) in define'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/rake-11.2.2/exe/rake:27:in `<top (required)>'
remote: Gem::LoadError: can't activate pg (~> 0.15), already activated pg
-0.12.2. Make sure all dependencies are added to Gemfile.
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/bundler-1.11.2/lib/bundler/rubygems_integration.rb:314:in `block in rep
lace_gem'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/postgresql_a
dapter.rb:16:in `<top (required)>'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in `requir
e'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in `block
in require'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:240:in `load_d
ependency'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in `requir
e'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/connection_s
pecification.rb:175:in `spec'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activerecord-4.2.5.1/lib/active_record/connection_handling.rb:50:in `es
tablish_connection'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activerecord-4.2.5.1/lib/active_record/railtie.rb:120:in `block (2 leve
ls) in <class:Railtie>'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activesupport-4.2.5.1/lib/active_support/lazy_load_hooks.rb:38:in `inst
ance_eval'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activesupport-4.2.5.1/lib/active_support/lazy_load_hooks.rb:38:in `exec
ute_hook'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activesupport-4.2.5.1/lib/active_support/lazy_load_hooks.rb:45:in `bloc
k in run_load_hooks'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activesupport-4.2.5.1/lib/active_support/lazy_load_hooks.rb:44:in `each
'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activesupport-4.2.5.1/lib/active_support/lazy_load_hooks.rb:44:in `run_
load_hooks'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activerecord-4.2.5.1/lib/active_record/base.rb:315:in `<module:ActiveRe
cord>'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activerecord-4.2.5.1/lib/active_record/base.rb:26:in `<top (required)>'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/devise-3.4.1/lib/devise/orm/active_record.rb:3:in `<top (required)>'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in `requir
e'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in `block
in require'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:240:in `load_d
ependency'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in `requir
e'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/config/initializers/d
evise.rb:22:in `block in <top (required)>'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/devise-3.4.1/lib/devise.rb:293:in `setup'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/config/initializers/d
evise.rb:3:in `<top (required)>'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:268:in `load'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:268:in `block
in load'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:240:in `load_d
ependency'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:268:in `load'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/railties-4.2.5.1/lib/rails/engine.rb:652:in `block in load_config_initi
alizer'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activesupport-4.2.5.1/lib/active_support/notifications.rb:166:in `instr
ument'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/railties-4.2.5.1/lib/rails/engine.rb:651:in `load_config_initializer'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/railties-4.2.5.1/lib/rails/engine.rb:616:in `block (2 levels) in <class
:Engine>'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/railties-4.2.5.1/lib/rails/engine.rb:615:in `each'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/railties-4.2.5.1/lib/rails/engine.rb:615:in `block in <class:Engine>'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/railties-4.2.5.1/lib/rails/initializable.rb:30:in `instance_exec'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/railties-4.2.5.1/lib/rails/initializable.rb:30:in `run'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/railties-4.2.5.1/lib/rails/initializable.rb:55:in `block in run_initial
izers'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/railties-4.2.5.1/lib/rails/initializable.rb:44:in `each'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/railties-4.2.5.1/lib/rails/initializable.rb:44:in `tsort_each_child'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/railties-4.2.5.1/lib/rails/initializable.rb:54:in `run_initializers'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/railties-4.2.5.1/lib/rails/application.rb:352:in `initialize!'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/config/environment.rb
:5:in `<top (required)>'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in `requir
e'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in `block
in require'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:240:in `load_d
ependency'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in `requir
e'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/railties-4.2.5.1/lib/rails/application.rb:328:in `require_environment!'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/railties-4.2.5.1/lib/rails/application.rb:457:in `block in run_tasks_bl
ocks'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/sprockets-rails-3.1.1/lib/sprockets/rails/task.rb:62:in `block (2 level
s) in define'
remote: /tmp/build_4364280abfd75b78ccd270519b98e88a/vendor/bundle/ruby/2.
2.0/gems/rake-11.2.2/exe/rake:27:in `<top (required)>'
remote: Tasks: TOP => environment
remote: (See full trace by running task with --trace)
remote: !
remote: ! Precompiling assets failed.
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to instagramm1.
remote:
To https://git.heroku.com/instagramm1.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/instagramm1.git'
这是application.rb
require File.expand_path('../boot', __FILE__)
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module Insta
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
# Do not swallow errors in after_commit/after_rollback callbacks.
config.active_record.raise_in_transactional_callbacks = true
config.assets.initialize_on_precompile = false
end
end
我已按照Heroku网站的说明进行操作。知道我错过了什么吗?
请解决此问题。
答案 0 :(得分:0)
Gem :: LoadError:指定&#39; postgresql&#39;对于数据库适配器,但是 宝石没有加载。将
gem 'pg'
添加到您的Gemfile中(并确保其版本达到ActiveRecord所需的最低版本)。
在pg
群组下的Gemfile
添加production
gem。
group :production do
gem 'pg'
end
答案 1 :(得分:0)
如果您的数据库适配器是SQLite,则heroku不支持它。你应该添加
gem 'pg', '~> 0.18' #to your Gemfile.
您必须在下面指定database.yml
。
default: &default
adapter: postgresql
encoding: unicode
development:
<<: *default
database: your_app_development
production:
url: <%= ENV['DATABASE_URL'] %>
如果您想在生产和开发中使用不同的适配器,请删除该行
default: &default
并定义适配器而不是它。
确保您已将Heroku Postgres::Database
加载项添加到您的应用中。