2013-12-09 15 views
0

爲什麼我的heroku應用程序依賴於will_paginate gem,它不在我的gemfile中了?爲什麼我的heroku應用程序依賴於will_paginate gem,它不在我的gemfile中了?

你好,

我有一個運行在Heroku上的rails 3.2.11應用程序。自從我最後成功部署到Heroku的我在本地:

  • 卸載will_paginate gem是和更新的Gemfile
  • 加入雷寶石到Gemfile中
  • 換成雷者的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' 
+0

您是否在控制檯中嘗試過'heroku run bundle update'?這將在Heroku上運行捆綁器,這可以解決它? –

+0

是的,但它沒有幫助。 – Shako

回答

2

你有/config/initializers/吃剩的初始化引用will_paginate。

+0

你好,我在本地檢查了config/initializers目錄,但沒有發現對will_paginate的引用。你知道我是否可以在我的應用程序中檢查heroku中是否還有這樣的初始化程序?謝謝 – Shako

+0

在將它們推送到heroku之前,您是否承諾進行更改?該錯誤肯定是引用初始化器。 – sevenseacat

+0

是的,最新的變化被推到github。這些更改已部署到heroku。 有沒有辦法在heroku上檢查initializers目錄的內容? – Shako

相關問題