无法在Heroku上进行迁移。错误在哪里?

时间:2016-04-17 21:18:52

标签: ruby-on-rails ruby heroku deployment heroku-toolbelt

已经尝试过捆绑安装和捆绑更新rake。 bundle exec rake db:migrate在开发中运行良好(c9),但是heroku运行rake db:migrate会出现错误。

错误追踪:

Running rake db:migrate --trace on guarded-citadel-14762... up, run.3560
rake aborted!
NoMethodError: undefined method `active_record' for #<Rails::Application::Configuration:0x007f15934ea1b0>
/app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.6/lib/rails/railtie/configuration.rb:95:in `method_missing'
/app/config/application.rb:24:in `<class:Application>'
/app/config/application.rb:10:in `<module:Pochta>'
/app/config/application.rb:9:in `<top (required)>'
/app/Rakefile:4:in `require'
/app/Rakefile:4:in `<top (required)>'
/app/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/rake_module.rb:28:in `load'
/app/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/rake_module.rb:28:in `load_rakefile'
/app/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/application.rb:689:in `raw_load_rakefile'
/app/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/application.rb:94:in `block in load_rakefile'
/app/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/application.rb:176:in `standard_exception_handling'
/app/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/application.rb:93:in `load_rakefile'
/app/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/application.rb:77:in `block in run'
/app/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/application.rb:176:in `standard_exception_handling'
/app/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/lib/rake/application.rb:75:in `run'
/app/vendor/bundle/ruby/2.2.0/gems/rake-11.1.2/bin/rake:33:in `<top (required)>'
/app/vendor/bundle/ruby/2.2.0/bin/rake:23:in `load'
/app/vendor/bundle/ruby/2.2.0/bin/rake:23:in `<main>'

Heroku部署:

Counting objects: 7, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 339 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Using set buildpack heroku/ruby
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.2.4
remote: -----> Installing dependencies using bundler 1.11.2
remote:        Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote:        Using i18n 0.7.0
remote:        Using rake 11.1.2
remote:        Using CFPropertyList 2.3.2
remote:        Using json 1.8.3
remote:        Using minitest 5.8.4
remote:        Using thread_safe 0.3.5
remote:        Using builder 3.2.2
remote:        Using erubis 2.7.0
remote:        Using mini_portile2 2.0.0
remote:        Using rack 1.6.4
remote:        Using bcrypt 3.1.7
remote:        Using mime-types-data 3.2016.0221
remote:        Using coffee-script-source 1.10.0
remote:        Using execjs 2.6.0
remote:        Using thor 0.19.1
remote:        Using concurrent-ruby 1.0.1
remote:        Using orm_adapter 0.5.0
remote:        Using excon 0.49.0
remote:        Using formatador 0.2.5
remote:        Using multi_json 1.11.2
remote:        Using ipaddress 0.8.3
remote:        Using xml-simple 1.1.5
remote:        Using inflecto 0.0.2
remote:        Using sass 3.4.22
remote:        Using tilt 1.4.1
remote:        Using mimemagic 0.3.0
remote:        Using subexec 0.2.3
remote:        Using pg 0.17.1
remote:        Using rails_serve_static_assets 0.0.5
remote:        Using rails_stdout_logging 0.0.5
remote:        Using bundler 1.11.2
remote:        Using faker 1.4.2
remote:        Using rdoc 4.2.2
remote:        Using fission 0.5.0
remote:        Using tzinfo 1.2.2
remote:        Using rack-test 0.6.3
remote:        Using warden 1.2.6
remote:        Using puma 2.11.1
remote:        Using nokogiri 1.6.7.2
remote:        Using uglifier 2.5.3
remote:        Using coffee-script 2.4.1
remote:        Using sprockets 3.6.0
remote:        Using fog-core 1.37.0
remote:        Using mime-types 3.0
remote:        Using mini_magick 3.8.0
remote:        Using rails_12factor 0.0.2
remote:        Using activesupport 4.2.6
remote:        Using loofah 2.0.3
remote:        Using sdoc 0.4.0
remote:        Using fog-json 1.0.2
remote:        Using fog-xml 0.1.2
remote:        Using fog-local 0.3.0
remote:        Using rails-deprecated_sanitizer 1.0.3
remote:        Using activemodel 4.2.6
remote:        Using climate_control 0.0.3
remote:        Using jbuilder 2.2.3
remote:        Using rails-html-sanitizer 1.0.3
remote:        Using fog-aliyun 0.1.0
remote:        Using fog-brightbox 0.10.1
remote:        Using fog-sakuracloud 1.7.5
remote:        Using fog-serverlove 0.1.2
remote:        Using fog-softlayer 1.1.0
remote:        Using fog-storm_on_demand 0.1.1
remote:        Using fog-atmos 0.1.0
remote:        Using fog-aws 0.9.2
remote:        Using fog-dynect 0.0.3
remote:        Using fog-ecloud 0.3.0
remote:        Using fog-google 0.1.0
remote:        Using fog-powerdns 0.1.1
remote:        Using fog-profitbricks 0.0.5
remote:        Using fog-radosgw 0.0.5
remote:        Using fog-riakcs 0.1.0
remote:        Using fog-terremark 0.1.0
remote:        Using fog-voxel 0.1.0
remote:        Using fog-xenserver 0.2.3
remote:        Using rails-dom-testing 1.0.7
remote:        Using fog-vmfusion 0.1.0
remote:        Using cocaine 0.5.8
remote:        Using carrierwave 0.10.0
remote:        Using actionview 4.2.6
remote:        Using paperclip 4.3.6
remote:        Using fog 1.36.0
remote:        Using actionpack 4.2.6
remote:        Using railties 4.2.6
remote:        Using sprockets-rails 3.0.4
remote:        Using coffee-rails 4.1.0
remote:        Using responders 2.1.2
remote:        Using sass-rails 5.0.2
remote:        Using jquery-rails 4.0.3
remote:        Using devise 3.5.6
remote:        Using turbolinks 2.3.0
remote:        Using foundation-icons-sass-rails 3.0.0
remote:        Bundle complete! 26 Gemfile dependencies, 92 gems now installed.
remote:        Gems in the groups development and test were not installed.
remote:        Bundled gems are installed into ./vendor/bundle.
remote:        Bundle completed (0.61s)
remote:        Cleaning up the bundler cache.
remote:        Detected manifest file, assuming assets were compiled locally
remote: 
remote: ###### WARNING:
remote:        You have not declared a Ruby version in your Gemfile.
remote:        To set your Ruby version add this line to your Gemfile:
remote:        ruby '2.2.4'
remote:        # See https://devcenter.heroku.com/articles/ruby-versions for more information.
remote: 
remote: ###### WARNING:
remote:        No Procfile detected, using the default web server.
remote:        We recommend explicitly declaring how to boot your server process via a Procfile.
remote:        https://devcenter.heroku.com/articles/ruby-default-web-server
remote: 
remote: 
remote: -----> Discovering process types
remote:        Procfile declares types     -> (none)
remote:        Default types for buildpack -> console, rake, web, worker
remote: 
remote: -----> Compressing...
remote:        Done: 51M
remote: -----> Launching...
remote:        Released v9
remote:        https://guarded-citadel-14552.herokuapp.com/ deployed to Heroku
remote: 
remote: Verifying deploy... done.
To https://git.heroku.com/guarded-citadel-14552.git
   3de066e..c7fcc56  master -> master

的Gemfile:

source 'https://rubygems.org'

gem 'bcrypt',                  '3.1.7'
gem 'faker',                   '1.4.2'
gem 'carrierwave',             '0.10.0'
gem 'mini_magick',             '3.8.0'
gem 'fog',                     '1.36.0'
gem 'devise'
gem 'foundation-icons-sass-rails'
gem 'paperclip', '~> 4.3', '>= 4.3.5'
gem 'sass-rails',              '5.0.2'
gem 'uglifier',                '2.5.3'
gem 'coffee-rails',            '4.1.0'
gem 'jquery-rails',            '4.0.3'
gem 'turbolinks',              '2.3.0'
gem 'jbuilder',                '2.2.3'
gem 'sdoc',                    '0.4.0', group: :doc

group :development do
  gem 'rails_layout'
end

group :development, :test do
  gem 'sqlite3',     '1.3.9'
  gem 'byebug',      '3.4.0'
  gem 'web-console', '2.0.0.beta3'
  gem 'spring',      '1.1.3'
end

group :test do
  gem 'minitest-reporters', '1.0.5'
  gem 'mini_backtrace',     '0.1.3'
  gem 'guard-minitest',     '2.3.1'
end

group :production do
  gem 'pg',             '0.17.1'
  gem 'rails_12factor', '0.0.2'
  gem 'puma',           '2.11.1'
end

有什么想法吗?

0 个答案:

没有答案