为什么我的heroku应用程序依赖于will_paginate gem,这不再是我的gemfile中的?

时间:2013-12-09 09:07:35

标签: ruby-on-rails heroku

为什么我的heroku应用程序依赖于will_paginate gem,这不再出现在我的gemfile中了?

您好,

我在Heroku上运行了一个rails 3.2.11应用程序。自从我上次成功部署到Heroku后,我就在本地:

  • 卸载了will_paginate gem并更新了Gemfile
  • 将kaminari gem添加到Gemfile
  • 替换了kaminari的
  • 的will_paginate调用
  • 其他一些变化......

本地应用程序运行正常。

当我将此应用程序(从git)部署到heroku时,我在日志中得到以下异常:

» 12:47:45.667 2013-12-07 11:47:45.613491+00:00 heroku web.1 - - Starting process with command `bundle exec rails server thin -p 31620 -e $RACK_ENV`
» 12:47:48.465 2013-12-07 11:47:48.410856+00:00 app web.1 - - => Booting Thin
» 12:47:48.564 2013-12-07 11:47:48.410856+00:00 app web.1 - - => Rails 3.2.11 application starting in production on http://0.0.0.0:31620
» 12:47:48.564 2013-12-07 11:47:48.410856+00:00 app web.1 - - => Call with -d to detach
» 12:47:48.564 2013-12-07 11:47:48.410856+00:00 app web.1 - - => Ctrl-C to shutdown server
» 12:47:48.564 2013-12-07 11:47:48.410856+00:00 app web.1 - - Connecting to database specified by DATABASE_URL
» 12:47:48.922 2013-12-07 11:47:48.860489+00:00 app web.1 - - Exiting
» 12:47:48.922 2013-12-07 11:47:48.861515+00:00 app web.1 - - /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:317:in `rescue in depend_on': No such file to load -- will_paginate (LoadError) from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:312:in `depend_on' from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:225:in `require_dependency' from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.11/lib/rails/engine.rb:439:in `block (2 levels) in eager_load!' from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.11/lib/rails/engine.rb:438:in `each' from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.11/lib/rails/engine.rb:438:in `block in eager_load!' from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.11/lib/rails/engine.rb:436:in `each' from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.11/lib/rails/engine.rb:436:in `eager_load!' from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.11/lib/rails/application/finisher.rb:53:in `block in <module:Finisher>' from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.11/lib/rails/initializable.rb:30:in `instance_exec' from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.11/lib/rails/initializable.rb:30:in `run' from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.11/lib/rails/initializable.rb:55:in `block in run_initializers' from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.11/lib/rails/initializable.rb:54:in `each' from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.11/lib/rails/initializable.rb:54:in `run_initializers' from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.11/lib/rails/application.rb:136:in `initialize!' from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.11/lib/rails/railtie/configurable.rb:30:in `method_missing' from /app/config/environment.rb:41:in `<top (required)>' from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require' from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `block in require' from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:236:in `load_dependency' from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require' from /app/config.ru:3:in `block in <main>' from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval' from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize' from /app/config.ru:in `new' from /app/config.ru:in `<main>' from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/builder.rb:40:in `eval' from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/builder.rb:40:in `parse_file' from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/server.rb:200:in `app' from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.11/lib/rails/commands/server.rb:46:in `app' from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/server.rb:304:in `wrapped_app' from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/server.rb:254:in `start' from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.11/lib/rails/commands/server.rb:70:in `start' from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.11/lib/rails/commands.rb:55:in `block in <top (required)>' from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.11/lib/rails/commands.rb:50:in `tap' from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.11/lib/rails/commands.rb:50:in `<top (required)>' from script/rails:6:in `require' from script/rails:6:in `<main>' EXCEPT
» 12:47:50.130 2013-12-07 11:47:50.075742+00:00 heroku web.1 - - Process exited with status 1
» 12:47:51.142 2013-12-07 11:47:50.088491+00:00 heroku web.1 - - State changed from starting to crashed
» 12:47:53.004 2013-12-07 11:47:42.195734+00:00 heroku web.1 - - State changed from crashed to starting

似乎我在Heroku上的应用程序仍然需要will_paginate gem。我怎样才能找出原因?

我尝试将此应用程序部署到一个新的heroku应用程序,基本上应该只使用我的Git中的代码而不是引用一些以前部署的代码/配置,但结果是相同的。

这是我的Gemfile:

source 'https://rubygems.org'

gem 'rails', '3.2.11'

# REPLACED BY KAMINARI gem: gem 'will_paginate' #, "~> 2.3.11", :source => 'http://gemcutter.org'
gem 'kaminari'

gem 'meta_search', "~> 1.1.3"
gem 'hirb', "0.5.0"
gem "paperclip", "~> 3.0"
gem 'i18n'
gem 'rake', '10.0.3'

# needed for amazon s3
gem 'aws-sdk'

# needed for mysql (cleardb mysql on heroku)
gem 'activerecord-mysql-adapter'
gem 'mysql2'

group :development, :test do

end

group :production do
    gem 'pg'

    # for heroku production
    gem 'thin'  

    gem 'rails_12factor'

end

# Gems used only for assets and not required
# in production environments by default.
group :assets do

    # to be able to test thin locally
    gem 'foreman'

    gem "hirb", "0.5.0"

    gem 'factory_girl'

    gem 'sass-rails',   '~> 3.2.3'
    gem 'coffee-rails', '~> 3.2.1'

    # See https://github.com/sstephenson/execjs#readme for more supported runtimes
    # gem 'therubyracer', :platforms => :ruby

    gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

# Use unicorn as the app server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'debugger'

1 个答案:

答案 0 :(得分:2)

/config/initializers/中有一个剩余的初始值设定项引用了will_paginate。