2017-05-09 192 views
1

在更新到rails 5.1之後,在本地運行服務器時,它提供了一個下面提到的錯誤,我到處檢查,但沒有找到任何解決方案。我還刪除了所有代碼之前的過濾器,但仍然出現此錯誤。嘗試加載gem'ie_iframe_cookies'時發生錯誤。 (Bundler :: GemRequireError)

Gem Load Error is: undefined method `before_filter' for ActionController::Base:Class 
Did you mean? before_action 
Backtrace for gem load error is: 
/home/affi/.rvm/gems/ruby-2.3.1/gems/ie_iframe_cookies-0.2.0/lib/ie_iframe_cookies.rb:5:in `<class:Base>' 
/home/affi/.rvm/gems/ruby-2.3.1/gems/ie_iframe_cookies-0.2.0/lib/ie_iframe_cookies.rb:4:in `<module:ActionController>' 
/home/affi/.rvm/gems/ruby-2.3.1/gems/ie_iframe_cookies-0.2.0/lib/ie_iframe_cookies.rb:3:in `<top (required)>' 
/home/affi/.rvm/gems/ruby-2.3.1/gems/bundler-1.14.6/lib/bundler/runtime.rb:91:in `require' 
/home/affi/.rvm/gems/ruby-2.3.1/gems/bundler-1.14.6/lib/bundler/runtime.rb:91:in `block (2 levels) in require' 
/home/affi/.rvm/gems/ruby-2.3.1/gems/bundler-1.14.6/lib/bundler/runtime.rb:86:in `each' 
/home/affi/.rvm/gems/ruby-2.3.1/gems/bundler-1.14.6/lib/bundler/runtime.rb:86:in `block in require' 
/home/affi/.rvm/gems/ruby-2.3.1/gems/bundler-1.14.6/lib/bundler/runtime.rb:75:in `each' 
/home/affi/.rvm/gems/ruby-2.3.1/gems/bundler-1.14.6/lib/bundler/runtime.rb:75:in `require' 
/home/affi/.rvm/gems/ruby-2.3.1/gems/bundler-1.14.6/lib/bundler.rb:107:in `require' 
/home/affi/officeData/evercam-devops/evercam-dashboard/config/application.rb:12:in `<top (required)>' 
/home/affi/.rvm/gems/ruby-2.3.1/gems/railties-5.1.0/lib/rails/commands/server/server_command.rb:128:in `require' 
/home/affi/.rvm/gems/ruby-2.3.1/gems/railties-5.1.0/lib/rails/commands/server/server_command.rb:128:in `block in perform' 
/home/affi/.rvm/gems/ruby-2.3.1/gems/railties-5.1.0/lib/rails/commands/server/server_command.rb:125:in `tap' 
/home/affi/.rvm/gems/ruby-2.3.1/gems/railties-5.1.0/lib/rails/commands/server/server_command.rb:125:in `perform' 
/home/affi/.rvm/gems/ruby-2.3.1/gems/thor-0.19.4/lib/thor/command.rb:27:in `run' 
/home/affi/.rvm/gems/ruby-2.3.1/gems/thor-0.19.4/lib/thor/invocation.rb:126:in `invoke_command' 
/home/affi/.rvm/gems/ruby-2.3.1/gems/thor-0.19.4/lib/thor.rb:369:in `dispatch' 
/home/affi/.rvm/gems/ruby-2.3.1/gems/railties-5.1.0/lib/rails/command/base.rb:63:in `perform' 
/home/affi/.rvm/gems/ruby-2.3.1/gems/railties-5.1.0/lib/rails/command.rb:44:in `invoke' 
/home/affi/.rvm/gems/ruby-2.3.1/gems/railties- 5.1.0/lib/rails/commands.rb:16:in `<top (required)>' 
bin/rails:8:in `require' 
bin/rails:8:in `<main>' 
Bundler Error Backtrace: 
    from /home/affi/.rvm/gems/ruby-2.3.1/gems/bundler- 1.14.6/lib/bundler/runtime.rb:90:in `block (2 levels) in require' 
    from /home/affi/.rvm/gems/ruby-2.3.1/gems/bundler-1.14.6/lib/bundler/runtime.rb:86:in `each' 
    from /home/affi/.rvm/gems/ruby-2.3.1/gems/bundler-1.14.6/lib/bundler/runtime.rb:86:in `block in require' 
    from /home/affi/.rvm/gems/ruby-2.3.1/gems/bundler-1.14.6/lib/bundler/runtime.rb:75:in `each' 
    from /home/affi/.rvm/gems/ruby-2.3.1/gems/bundler-1.14.6/lib/bundler/runtime.rb:75:in `require' 
    from /home/affi/.rvm/gems/ruby-2.3.1/gems/bundler-1.14.6/lib/bundler.rb:107:in `require' 
    from /home/affi/officeData/evercam-devops/evercam-dashboard/config/application.rb:12:in `<top (required)>' 
    from /home/affi/.rvm/gems/ruby-2.3.1/gems/railties-5.1.0/lib/rails/commands/server/server_command.rb:128:in `require' 
    from /home/affi/.rvm/gems/ruby-2.3.1/gems/railties-5.1.0/lib/rails/commands/server/server_command.rb:128:in `block in perform' 
    from /home/affi/.rvm/gems/ruby-2.3.1/gems/railties-5.1.0/lib/rails/commands/server/server_command.rb:125:in `tap' 
    from /home/affi/.rvm/gems/ruby-2.3.1/gems/railties-5.1.0/lib/rails/commands/server/server_command.rb:125:in `perform' 
    from /home/affi/.rvm/gems/ruby-2.3.1/gems/thor-0.19.4/lib/thor/command.rb:27:in `run' 
    from /home/affi/.rvm/gems/ruby-2.3.1/gems/thor-0.19.4/lib/thor/invocation.rb:126:in `invoke_command' 
    from /home/affi/.rvm/gems/ruby-2.3.1/gems/thor-0.19.4/lib/thor.rb:369:in `dispatch' 
    from /home/affi/.rvm/gems/ruby-2.3.1/gems/railties-5.1.0/lib/rails/command/base.rb:63:in `perform' 
    from /home/affi/.rvm/gems/ruby-2.3.1/gems/railties-5.1.0/lib/rails/command.rb:44:in `invoke' 
    from /home/affi/.rvm/gems/ruby-2.3.1/gems/railties-5.1.0/lib/rails/commands.rb:16:in `<top (required)>' 
    from bin/rails:8:in `require' 
    from bin/rails:8:in `<main>' 

這是我的創業板文件'捆綁安裝'運行正常。

source 'https://rubygems.org' 
ruby '2.3.1' 
gem 'rails', '~> 5.1' 

gem 'railties', '~> 5.1' 
gem 'sass-rails' 
gem 'yui-compressor' 
gem 'uglifier' 
gem 'coffee-rails' 
gem 'jquery-rails' 
gem 'sprockets' 
gem 'javascript-securehash-rails' 
gem 'fog' 
gem 'asset_sync' 
gem 'autoprefixer-rails' 
gem 'stripe', 
    github: 'stripe/stripe-ruby' 
gem 'stripe_event' 
gem 'nprogress-rails' 
gem 'turbolinks' 
gem 'georuby' 
gem 'geocoder' 
gem 'hashie' 
gem 'timezone' 

gem 'pg' 
gem 'sequel' 
gem 'bcrypt', '~> 3.1.10' 
gem 'protected_attributes_continued' 
gem 'rack-rewrite' 
gem 'typhoeus' 
gem 'puma' 
gem 'data_uri' 
gem 'country_select', 
    github: 'stefanpenner/country_select' 
gem "devise", 
    git: 'https://github.com/plataformatec/devise.git' 
gem 'ie_iframe_cookies' 
gem 'heroku-api' 
gem 'intercom-rails' 
gem 'wicked_pdf' 
gem 'wkhtmltopdf-binary' 
gem 'intercom', require: 'intercom' 
gem 'imgareaselect-rails', '~> 1.0' 
gem 'dotenv' 

group :evercam do 
    gem 'evercam', 
    github: 'evercam/evercam-ruby' 
end 

group :production do 
    gem 'rails_12factor' 
    gem 'newrelic_rpm' 
    gem 'wkhtmltopdf-heroku' 
    gem 'heroku-deflater', 
    git: "https://github.com/romanbsd/heroku-deflater.git" 
end 

group :development do 
    # gem 'jazz_hands', 
    # github: 'nixme/jazz_hands', 
    # branch: 'bring-your-own-debugger' 
    gem 'pry-byebug' 
    gem 'rspec' 
    gem 'guard-rspec' 
end 

group :test do 
    gem 'database_cleaner' 
    gem 'factory_girl' 
    gem 'vcr' 
    gem 'rspec-rails' 
    gem 'webmock' 
    gem 'poltergeist' 
    gem 'nokogiri' 
    gem 'simplecov' 
    gem 'rack_session_access' 
    gem 'selenium-webdriver' 
    gem 'launchy' 
    gem 'codeclimate-test-reporter', require: nil 
end 

source 'https://rails-assets.org' do 
    gem 'rails-assets-bootbox' 
    gem 'rails-assets-bootstrap' 
    gem 'rails-assets-bootstrap-datepicker' 
    gem 'rails-assets-bootstrap-tabdrop' 
    gem 'rails-assets-datatables' 
    gem 'rails-assets-datatables-plugins' 
    gem 'rails-assets-datetimepicker' 
    gem 'rails-assets-fullcalendar' 
    gem 'rails-assets-iCheck' 
    gem 'rails-assets-jquery-cookie' 
    gem 'rails-assets-moment', '~> 2.12.0' 
    gem 'rails-assets-jquery-form-validator' 
    gem 'rails-assets-jquery.browser' 
    gem 'rails-assets-jquery.nicescroll' 
    gem 'rails-assets-jquery.slimscroll' 
    gem 'rails-assets-jquery.uniform' 
    gem 'rails-assets-ladda' 
    gem 'rails-assets-screenfull' 
    gem 'rails-assets-videojs' 
    gem 'rails-assets-bs-slider' 
    gem 'rails-assets-bootstrap-toggle' 
    gem 'rails-assets-select2' 
    gem 'rails-assets-jquery-tags-input' 
end 

回答

0

我覺得這是一個問題before_filterbefore_filter已在軌5.1

您應該使用before_action代替before_filter

+0

我已經這樣做了,但仍然顯示這個'before_action'錯誤。 – Affi

+0

Affi,你把它們取代了寶石? –

+0

我認爲這不依賴於寶石。你可以粘貼你的代碼如何使用 – Sunny

0

before_filter已被棄用,不會在軌5.還刪除工作,它看起來像寶石也是「不推薦/不維護」。您可以嘗試分叉回購並將所有before_filter更改爲before_action。然後將repo添加到您的gemfile中;但是,沒有保證可行。

+0

我已發佈相同的答案 – Sunny

+0

陽光明媚,我相信你沒有意識到問題是與寶石。我的回答說明 –

相關問題