Ruby on rails: rake is not working -


when ever try run rake test in rails, it's give me error message "undefined method `whitelist_attributes". i'don't know why it's coming.

the error is:


    nomethoderror: undefined method `whitelist_attributes=' #  <class:0x50de7d8>   c:/users/arvind/project/book/config/initializers/devise.rb:21:in `block in <top (required)>'  c:/users/arvind/project/book/config/initializers/devise.rb:4:in `<top (required)>'  c:/users/arvind/project/book/config/environment.rb:8:in `<top (required)>'      tasks: top => environment     (see full trace running task --trace)`enter code here` 

my gem file this:


  source 'https://rubygems.org'      # bundle edge rails instead: gem 'rails', github: 'rails/rails'    gem 'rails', '4.2.1'   # use sqlite3 database active record     gem 'devise'   gem 'protected_attributes'     gem 'simple_form'   gem 'state_machine', :git => 'https://github.com/seuros/state_machine.git'   gem 'draper', '~> 2.1'   gem 'js-routes'   gem 'paperclip', :git => "git://github.com/thoughtbot/paperclip.git"   gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-    bootstrap-rails.git'   gem 'will_paginate'  gem 'bootstrap-will_paginate'  gem 'private_pub'  gem 'foreman'  gem 'bootstrap-sass', :git => 'git://github.com/thomas-mcdonald/bootstrap-sass.git'  gem 'font-awesome-less'   gem 'faye'    group :development    gem 'thin'     end   group :test     gem 'shoulda'     gem 'factory_girl_rails'     end    group :development    gem 'sqlite3'     gem 'log_buddy'  end    group :production      gem 'pg'   end     gem 'rails_12factor', group: :production       gem 'sass-rails', '~> 5.0'    # use uglifier compressor javascript assets     gem 'uglifier', '>= 1.3.0'  # use coffeescript .coffee assets , views    gem 'coffee-rails', '~> 4.1.0'    # see https://github.com/rails/execjs#readme more supported runtimes    # gem 'therubyracer', platforms: :ruby    # use jquery javascript library     gem 'jquery-rails'  # turbolinks makes following links in web application faster. read more: https://github.com/rails/turbolinks   gem 'turbolinks'  # build json apis ease. read more: https://github.com/rails/jbuilder gem 'jbuilder', '~> 2.0'   # bundle exec rake doc:rails generates api under doc/api.  gem 'sdoc', '~> 0.4.0', group: :doc    # use activemodel has_secure_password     # gem 'bcrypt', '~> 3.1.7'   # use unicorn app server  # gem 'unicorn'   # use capistrano deployment  # gem 'capistrano-rails', group: :development    group :development, :test   # call 'byebug' anywhere in code stop execution , debugger  console    gem 'byebug'    # access irb console on exception pages or using <%= console %> in views    gem 'web-console', '~> 2.0' end     # windows not include zoneinfo files, bundle tzinfo-data gem   gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] 

thank you!

do have config.active_record.whitelist_attributes defined in config/application.rb file? if so, remove line or set false: config.active_record.whitelist_attributes = false

do have white_list_attributes defined in model classes? if so, remove those. should using strong_parameters in 4.2.1. https://github.com/rails/strong_parameters


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -