sorcery occured error on rails4 on using mongoid gem - ruby-on-rails

I wanna use sorcery gem using user authentication and mongid gem
add Gemfile to
gem 'sorcery'
$ bundle
$ rails g sorcery:install core reset_password
I was success using activerecord...
but mongoid not make defualt sorcery initial files..
why not make initial files
help expert persons :(
This is deprecated, in future versions you may need to `bundle binstub rails` to work around a system/bundle conflict.
/Users/user_name/.rvm/gems/ruby-2.1.0/gems/activesupport-4.1.0/lib/active_support/concern.rb:126:in `included': Cannot define multiple 'included' blocks for a Concern (ActiveSupport::Concern::MultipleIncludedBlocks)
from /Users/user_name/.rvm/gems/ruby-2.1.0/gems/sorcery-0.8.5/lib/sorcery.rb:73:in `block in <module:Sorcery>'
from /Users/user_name/.rvm/gems/ruby-2.1.0/gems/sorcery-0.8.5/lib/sorcery.rb:72:in `module_eval'
from /Users/user_name/.rvm/gems/ruby-2.1.0/gems/sorcery-0.8.5/lib/sorcery.rb:72:in `<module:Sorcery>'
from /Users/user_name/.rvm/gems/ruby-2.1.0/gems/sorcery-0.8.5/lib/sorcery.rb:1:in `<top (required)>'
from /Users/user_name/.rvm/gems/ruby-2.1.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:76:in `require'
from /Users/user_name/.rvm/gems/ruby-2.1.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /Users/user_name/.rvm/gems/ruby-2.1.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:72:in `each'
from /Users/user_name/.rvm/gems/ruby-2.1.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:72:in `block in require'
from /Users/user_name/.rvm/gems/ruby-2.1.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:61:in `each'
from /Users/user_name/.rvm/gems/ruby-2.1.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:61:in `require'
from /Users/user_name/.rvm/gems/ruby-2.1.0/gems/bundler-1.6.2/lib/bundler.rb:132:in `require'
from /Users/user_name/Desktop/rails/project/config/application.rb:14:in `<top (required)>'
from /Users/user_name/.rvm/gems/ruby-2.1.0/gems/spring-1.1.3/lib/spring/application.rb:82:in `require'
from /Users/user_name/.rvm/gems/ruby-2.1.0/gems/spring-1.1.3/lib/spring/application.rb:82:in `preload'
from /Users/user_name/.rvm/gems/ruby-2.1.0/gems/spring-1.1.3/lib/spring/application.rb:140:in `serve'
from /Users/user_name/.rvm/gems/ruby-2.1.0/gems/spring-1.1.3/lib/spring/application.rb:128:in `block in run'
from /Users/user_name/.rvm/gems/ruby-2.1.0/gems/spring-1.1.3/lib/spring/application.rb:122:in `loop'
from /Users/user_name/.rvm/gems/ruby-2.1.0/gems/spring-1.1.3/lib/spring/application.rb:122:in `run'
from /Users/user_name/.rvm/gems/ruby-2.1.0/gems/spring-1.1.3/lib/spring/application/boot.rb:18:in `<top (required)>'
from /Users/user_name/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/user_name/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'

Related

rake task does not launch for lack of Mime JSON

After installing a repository locally and bundling for a rails 4.0 application, the database creation
rake db:create
command fails returning the following error:
uninitialized constant Mime::JSON
invoking from application.rb this particular line
Bundler.require(:default, Rails.env)
this line is preceeded by:
require File.expand_path('../boot', __FILE__)
require 'rails/all'
How can I get rake to properly process?
** update **
as per request full stack trace follows. I did manage to avoid the error by removing the jbuilder gem.
NameError: uninitialized constant Mime::JSON
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/jbuilder-1.5.3/lib/jbuilder/jbuilder_template.rb:110:in `<class:JbuilderHandler>'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/jbuilder-1.5.3/lib/jbuilder/jbuilder_template.rb:108:in `<top (required)>'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/jbuilder-1.5.3/lib/jbuilder.rb:358:in `<top (required)>'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:74:in `require'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:74:in `block (2 levels) in require'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:69:in `each'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:69:in `block in require'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:58:in `each'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:58:in `require'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler.rb:174:in `require'
/Volumes/Mo/r/uelcom/config/application.rb:7:in `<top (required)>'
/Volumes/Mo/r/uelcom/Rakefile:8:in `require'
/Volumes/Mo/r/uelcom/Rakefile:8:in `<top (required)>'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/rake_module.rb:29:in `load'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/rake_module.rb:29:in `load_rakefile'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:703:in `raw_load_rakefile'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:104:in `block in load_rakefile'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:186:in `standard_exception_handling'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:103:in `load_rakefile'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:82:in `block in run'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:186:in `standard_exception_handling'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:80:in `run'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
/Users/deploy/.rbenv/versions/2.6.1/bin/rake:23:in `load'
/Users/deploy/.rbenv/versions/2.6.1/bin/rake:23:in `<top (required)>'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:63:in `load'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:63:in `kernel_load'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:28:in `run'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/cli.rb:476:in `exec'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor.rb:399:in `dispatch'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/cli.rb:30:in `dispatch'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/base.rb:476:in `start'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/cli.rb:24:in `start'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/exe/bundle:46:in `block in <top (required)>'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/friendly_errors.rb:123:in `with_friendly_errors'
/Users/deploy/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/exe/bundle:34:in `<top (required)>'
/Users/deploy/.rbenv/versions/2.6.1/bin/bundle:23:in `load'
/Users/deploy/.rbenv/versions/2.6.1/bin/bundle:23:in `<main>'
It seems you are using rails 5 or above.
As of rails version 5 or above accessing Mime types through Mime::JSON is deprecated, We need to access it as Mime[:json]
Please find the following references for the same - Release Note and Pull request
Deprecated accessing mime types via constants (eg. Mime::HTML). Use the subscript operator with a symbol instead (eg. Mime[:html])
As per the backtrace of the exception you have given, the gem jbuilder is causing the issue, which accesses Mime types as Mime::JSON which is deprecated.
Please find the reference of the line which causes the error on the gem jbuilder - Jubilder - Github.
You are using the older version of the jbuilder(1.5.3), please upgrade this gem to the latest version and try
Try the below version:
Gemfile
gem 'jbuilder', '~> 2.10'

Error installing rails api with postgresql

I am trying to build a skeleton rails-api to use for future use but keep coming across an error. So i am in a folder call Rails_API_Skeleton and i run..
gem install rails-api
Which runs fine.
I then run...
rails-api new Skeleton_App -d postgresql -T
Which also runs without any issues. So i...
cd Skeleton_App/
then run...
bin/rake db:create
And get the following error, which after much googling i cant figure out how to resolve.
/Users/username/.rvm/gems/ruby-2.2.2/gems/bundler-1.12.5/lib/bundler/runtime.rb:89:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'rails-api'.
Gem Load Error is: uninitialized constant ActionController::API::RackDelegation
Backtrace for gem load error is:
/Users/username/.rvm/gems/ruby-2.2.2/gems/rails-api-0.4.0/lib/rails-api/action_controller/api.rb:131:in `<class:API>'
/Users/username/.rvm/gems/ruby-2.2.2/gems/rails-api-0.4.0/lib/rails-api/action_controller/api.rb:85:in `<module:ActionController>'
/Users/username/.rvm/gems/ruby-2.2.2/gems/rails-api-0.4.0/lib/rails-api/action_controller/api.rb:5:in `<top (required)>'
/Users/username/.rvm/gems/ruby-2.2.2/gems/rails-api-0.4.0/lib/rails-api.rb:3:in `require'
/Users/username/.rvm/gems/ruby-2.2.2/gems/rails-api-0.4.0/lib/rails-api.rb:3:in `<top (required)>'
/Users/username/.rvm/gems/ruby-2.2.2/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in `require'
/Users/username/.rvm/gems/ruby-2.2.2/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in `block (2 levels) in require'
/Users/username/.rvm/gems/ruby-2.2.2/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `each'
/Users/username/.rvm/gems/ruby-2.2.2/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `block in require'
/Users/username/.rvm/gems/ruby-2.2.2/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `each'
/Users/username/.rvm/gems/ruby-2.2.2/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `require'
/Users/username/.rvm/gems/ruby-2.2.2/gems/bundler-1.12.5/lib/bundler.rb:102:in `require'
/Users/username/Desktop/Apple_tv_movies_and_stuff/skeletons/Rails_API_Skeleton/Skeleton_App/config/application.rb:17:in `<top (required)>'
/Users/username/.rvm/gems/ruby-2.2.2/gems/spring-1.7.2/lib/spring/application.rb:82:in `require'
/Users/username/.rvm/gems/ruby-2.2.2/gems/spring-1.7.2/lib/spring/application.rb:82:in `preload'
/Users/username/.rvm/gems/ruby-2.2.2/gems/spring-1.7.2/lib/spring/application.rb:143:in `serve'
/Users/username/.rvm/gems/ruby-2.2.2/gems/spring-1.7.2/lib/spring/application.rb:131:in `block in run'
/Users/username/.rvm/gems/ruby-2.2.2/gems/spring-1.7.2/lib/spring/application.rb:125:in `loop'
/Users/username/.rvm/gems/ruby-2.2.2/gems/spring-1.7.2/lib/spring/application.rb:125:in `run'
/Users/username/.rvm/gems/ruby-2.2.2/gems/spring-1.7.2/lib/spring/application/boot.rb:19:in `<top (required)>'
/Users/username/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Users/username/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
-e:1:in `<main>'
Bundler Error Backtrace:
(Bundler::GemRequireError)
from /Users/username/.rvm/gems/ruby-2.2.2/gems/bundler-1.12.5/lib/bundler/runtime.rb:85:in `block (2 levels) in require'
from /Users/username/.rvm/gems/ruby-2.2.2/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `each'
from /Users/username/.rvm/gems/ruby-2.2.2/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `block in require'
from /Users/username/.rvm/gems/ruby-2.2.2/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `each'
from /Users/username/.rvm/gems/ruby-2.2.2/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `require'
from /Users/username/.rvm/gems/ruby-2.2.2/gems/bundler-1.12.5/lib/bundler.rb:102:in `require'
from /Users/username/Desktop/Apple_tv_movies_and_stuff/skeletons/Rails_API_Skeleton/Skeleton_App/config/application.rb:17:in `<top (required)>'
from /Users/username/.rvm/gems/ruby-2.2.2/gems/spring-1.7.2/lib/spring/application.rb:82:in `require'
from /Users/username/.rvm/gems/ruby-2.2.2/gems/spring-1.7.2/lib/spring/application.rb:82:in `preload'
from /Users/username/.rvm/gems/ruby-2.2.2/gems/spring-1.7.2/lib/spring/application.rb:143:in `serve'
from /Users/username/.rvm/gems/ruby-2.2.2/gems/spring-1.7.2/lib/spring/application.rb:131:in `block in run'
from /Users/username/.rvm/gems/ruby-2.2.2/gems/spring-1.7.2/lib/spring/application.rb:125:in `loop'
from /Users/username/.rvm/gems/ruby-2.2.2/gems/spring-1.7.2/lib/spring/application.rb:125:in `run'
from /Users/username/.rvm/gems/ruby-2.2.2/gems/spring-1.7.2/lib/spring/application/boot.rb:19:in `<top (required)>'
from /Users/username/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/username/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from -e:1:in `<main>'
Thanks for any help in advance
I suspect something changed with the gem in response to Rails 5.
Maybe its use is deprecated now?
Anyway, the new Rails API way seems to be
http://edgeguides.rubyonrails.org/api_app.html
rails new skeleton_api --api

Getting error with ancestry gem

I am trying to add ancestry to an Event_Tags model that I have. Right now that model only has a name. I added 'ancestry' to the gemfile and bundled. Now when I go to run the following command:
rails g migration AddAncestryToEventTags ancestry:string
I get the following error:
/Users/stevenbrooks1111/.rvm/gems/ruby-1.9.3-p429/gems/ancestry- 2.0.0/lib/ancestry/has_ancestry.rb:7:in `block in has_ancestry': Unknown option for has_ancestry: :hierarchy_class_name => "TagHierarchy". (Ancestry::AncestryException)
Not sure why why this is coming up. I have been following the Ancestry railscast episode as well as the documentation.
This is also the same error I am getting when simply trying to run the rails console.
Here is the entire message:
/Users/stevenbrooks1111/.rvm/gems/ruby-1.9.3-p429/gems/ancestry-2.0.0/lib/ancestry/has_ancestry.rb:7:in `block in has_ancestry': Unknown option for has_ancestry: :hierarchy_class_name => "TagHierarchy". (Ancestry::AncestryException)
from /Users/stevenbrooks1111/.rvm/gems/ruby-1.9.3-p429/gems/ancestry-2.0.0/lib/ancestry/has_ancestry.rb:5:in `each'
from /Users/stevenbrooks1111/.rvm/gems/ruby-1.9.3-p429/gems/ancestry-2.0.0/lib/ancestry/has_ancestry.rb:5:in `has_ancestry'
from /Users/stevenbrooks1111/Code/freelance/GRN-Auth/config/initializers/tag_patch.rb:3:in `<class:Tag>'
from /Users/stevenbrooks1111/Code/freelance/GRN-Auth/config/initializers/tag_patch.rb:2:in `<module:ActsAsTaggableOn>'
from /Users/stevenbrooks1111/Code/freelance/GRN-Auth/config/initializers/tag_patch.rb:1:in `<top (required)>'
from /Users/stevenbrooks1111/.rvm/gems/ruby-1.9.3-p429/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:245:in `load'
from /Users/stevenbrooks1111/.rvm/gems/ruby-1.9.3-p429/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:245:in `block in load'
from /Users/stevenbrooks1111/.rvm/gems/ruby-1.9.3-p429/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:236:in `load_dependency'
from /Users/stevenbrooks1111/.rvm/gems/ruby-1.9.3-p429/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:245:in `load'
from /Users/stevenbrooks1111/.rvm/gems/ruby-1.9.3-p429/gems/railties-3.2.11/lib/rails/engine.rb:588:in `block (2 levels) in <class:Engine>'
from /Users/stevenbrooks1111/.rvm/gems/ruby-1.9.3-p429/gems/railties-3.2.11/lib/rails/engine.rb:587:in `each'
from /Users/stevenbrooks1111/.rvm/gems/ruby-1.9.3-p429/gems/railties-3.2.11/lib/rails/engine.rb:587:in `block in <class:Engine>'
from /Users/stevenbrooks1111/.rvm/gems/ruby-1.9.3-p429/gems/railties-3.2.11/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/stevenbrooks1111/.rvm/gems/ruby-1.9.3-p429/gems/railties-3.2.11/lib/rails/initializable.rb:30:in `run'
from /Users/stevenbrooks1111/.rvm/gems/ruby-1.9.3-p429/gems/railties-3.2.11/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/stevenbrooks1111/.rvm/gems/ruby-1.9.3-p429/gems/railties-3.2.11/lib/rails/initializable.rb:54:in `each'
from /Users/stevenbrooks1111/.rvm/gems/ruby-1.9.3-p429/gems/railties-3.2.11/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/stevenbrooks1111/.rvm/gems/ruby-1.9.3-p429/gems/railties-3.2.11/lib/rails/application.rb:136:in `initialize!'
from /Users/stevenbrooks1111/.rvm/gems/ruby-1.9.3-p429/gems/railties-3.2.11/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/stevenbrooks1111/Code/freelance/GRN-Auth/config/environment.rb:14:in `<top (required)>'
from /Users/stevenbrooks1111/.rvm/gems/ruby-1.9.3-p429/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'
from /Users/stevenbrooks1111/.rvm/gems/ruby-1.9.3-p429/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `block in require'
from /Users/stevenbrooks1111/.rvm/gems/ruby-1.9.3-p429/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:236:in `load_dependency'
from /Users/stevenbrooks1111/.rvm/gems/ruby-1.9.3-p429/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'
from /Users/stevenbrooks1111/.rvm/gems/ruby-1.9.3-p429/gems/railties-3.2.11/lib/rails/application.rb:103:in `require_environment!'
from /Users/stevenbrooks1111/.rvm/gems/ruby-1.9.3-p429/gems/railties-3.2.11/lib/rails/commands.rb:40:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
One possible reason, which in my case was true, there are two different engines using ancestry and acts_as_tree.
Engine1, requires ancestry in gemspec.
Engine2, requires acts_as_tree in gemspec.
If engine1 is placed above engine2 in gemfile, ancestry gem is loaded first. In which case, this code executes and overrides acts_as_tree function. One way to fix this is put Engine2 over Engine1 in gemfile.
I haven't been able to figure out a better way to fix this, please let me know if you become aware of any.

deprecated_mass_assignment_security.rb:14:in `attr_accessible' [voting gem][rails 4]

So, when running
[leap_staging]$rails g reputation_system
After including the gem 'activerecord-reputation-system', require: 'reputation_system' in my Gemfile I get the below error:
/usr/local/rvm/gems/ruby-2.0.0-p195/gems/activemodel-4.0.0/lib/active_model/deprecated_mass_assignment_security.rb:14:in `attr_accessible': `attr_accessible` is extracted out of Rails into a gem. Please use new recommended protection model for params(strong_parameters) or add `protected_attributes` to your Gemfile to use old one. (RuntimeError)
from /usr/local/rvm/gems/ruby-2.0.0-p195/gems/activerecord-reputation-system-2.0.2/lib/reputation_system/models/evaluation.rb:25:in `<class:Evaluation>'
from /usr/local/rvm/gems/ruby-2.0.0-p195/gems/activerecord-reputation-system-2.0.2/lib/reputation_system/models/evaluation.rb:18:in `<module:ReputationSystem>'
from /usr/local/rvm/gems/ruby-2.0.0-p195/gems/activerecord-reputation-system-2.0.2/lib/reputation_system/models/evaluation.rb:17:in `<top (required)>'
from /usr/local/rvm/gems/ruby-2.0.0-p195/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
from /usr/local/rvm/gems/ruby-2.0.0-p195/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `block in require'
from /usr/local/rvm/gems/ruby-2.0.0-p195/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
from /usr/local/rvm/gems/ruby-2.0.0-p195/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
from /usr/local/rvm/gems/ruby-2.0.0-p195/gems/activerecord-reputation-system-2.0.2/lib/reputation_system.rb:25:in `<top (required)>'
from /usr/local/rvm/gems/ruby-2.0.0-p195#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
from /usr/local/rvm/gems/ruby-2.0.0-p195#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
from /usr/local/rvm/gems/ruby-2.0.0-p195#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
from /usr/local/rvm/gems/ruby-2.0.0-p195#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
from /usr/local/rvm/gems/ruby-2.0.0-p195#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
from /usr/local/rvm/gems/ruby-2.0.0-p195#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
from /usr/local/rvm/gems/ruby-2.0.0-p195#global/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
from /Users/apane/Downloads/leap_staging/leap_staging/config/application.rb:7:in `<top (required)>'
from /usr/local/rvm/gems/ruby-2.0.0-p195/gems/railties-4.0.0/lib/rails/commands.rb:44:in `require'
from /usr/local/rvm/gems/ruby-2.0.0-p195/gems/railties-4.0.0/lib/rails/commands.rb:44:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
It's clear to me that this had to with Rails 4 and the new Strong Params. However, I'd like to get this workin'. So, how can I get this to work or convert it to strong_params if I can't even generate the files?
See the full app here if necessary for easy troubleshooting: www.github.com/apane/leap (gem not included)
Have you tried adding the protected_attributes Gem into your Gemfile like the message says?
activerecord-reputation-system gem now supports Rails 4 (since version 3.0).

Tests are running on my Ubuntu pc, but not on my Mac OS X Lion 10.7.3, Ruby 1.9.3, Rails 3.2.1

I have project in Dropbox and two running laptops: one with Ubuntu and one with Mac OS X Lion 10.7.3. When I try to run either rspec or cucumber on ubuntu they are running well, but when I try to run tests on Mac I have the same errors in
config/application.rb:13: Bundler.require(*Rails.groups(:assets => %w(development test)))
For cucumber:
Using the default profile...
undefined method `gsub' for nil:NilClass (NoMethodError)
/Users/sergey/.rvm/gems/ruby-1.9.3-p125#global/gems/bundler-1.1.1/lib/bundler/runtime.rb:77:in `rescue in rescue in block in require'
/Users/sergey/.rvm/gems/ruby-1.9.3-p125#global/gems/bundler-1.1.1/lib/bundler/runtime.rb:72:in `rescue in block in require'
/Users/sergey/.rvm/gems/ruby-1.9.3-p125#global/gems/bundler-1.1.1/lib/bundler/runtime.rb:62:in `block in require'
/Users/sergey/.rvm/gems/ruby-1.9.3-p125#global/gems/bundler-1.1.1/lib/bundler/runtime.rb:55:in `each'
/Users/sergey/.rvm/gems/ruby-1.9.3-p125#global/gems/bundler-1.1.1/lib/bundler/runtime.rb:55:in `require'
/Users/sergey/.rvm/gems/ruby-1.9.3-p125#global/gems/bundler-1.1.1/lib/bundler.rb:119:in `require'
/Users/sergey/Dropbox/rails_projects/payforapps/config/application.rb:13:in `<top (required)>'
/Users/sergey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/Users/sergey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/Users/sergey/Dropbox/rails_projects/payforapps/config/environment.rb:2:in `<top (required)>'
/Users/sergey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/Users/sergey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/Users/sergey/Dropbox/rails_projects/payforapps/features/support/env.rb:11:in `block in <top (required)>'
/Users/sergey/.rvm/gems/ruby-1.9.3-p125#payforapps321/gems/spork-0.9.0/lib/spork.rb:24:in `prefork'
/Users/sergey/Dropbox/rails_projects/payforapps/features/support/env.rb:6:in `<top (required)>'
/Users/sergey/.rvm/gems/ruby-1.9.3-p125#payforapps321/gems/cucumber-1.1.9/lib/cucumber/rb_support/rb_language.rb:129:in `load'
/Users/sergey/.rvm/gems/ruby-1.9.3-p125#payforapps321/gems/cucumber-1.1.9/lib/cucumber/rb_support/rb_language.rb:129:in `load_code_file'
/Users/sergey/.rvm/gems/ruby-1.9.3-p125#payforapps321/gems/cucumber-1.1.9/lib/cucumber/runtime/support_code.rb:171:in `load_file'
/Users/sergey/.rvm/gems/ruby-1.9.3-p125#payforapps321/gems/cucumber-1.1.9/lib/cucumber/runtime/support_code.rb:83:in `block in load_files!'
/Users/sergey/.rvm/gems/ruby-1.9.3-p125#payforapps321/gems/cucumber-1.1.9/lib/cucumber/runtime/support_code.rb:82:in `each'
/Users/sergey/.rvm/gems/ruby-1.9.3-p125#payforapps321/gems/cucumber-1.1.9/lib/cucumber/runtime/support_code.rb:82:in `load_files!'
/Users/sergey/.rvm/gems/ruby-1.9.3-p125#payforapps321/gems/cucumber-1.1.9/lib/cucumber/runtime.rb:175:in `load_step_definitions'
/Users/sergey/.rvm/gems/ruby-1.9.3-p125#payforapps321/gems/cucumber-1.1.9/lib/cucumber/runtime.rb:40:in `run!'
/Users/sergey/.rvm/gems/ruby-1.9.3-p125#payforapps321/gems/cucumber-1.1.9/lib/cucumber/cli/main.rb:43:in `execute!'
/Users/sergey/.rvm/gems/ruby-1.9.3-p125#payforapps321/gems/cucumber-1.1.9/lib/cucumber/cli/main.rb:20:in `execute'
/Users/sergey/.rvm/gems/ruby-1.9.3-p125#payforapps321/gems/cucumber-1.1.9/bin/cucumber:14:in `<top (required)>'
/Users/sergey/.rvm/gems/ruby-1.9.3-p125#payforapps321/bin/cucumber:19:in `load'
/Users/sergey/.rvm/gems/ruby-1.9.3-p125#payforapps321/bin/cucumber:19:in `<main>'
For rspec:
No DRb server is running. Running in local process instead ...
/Users/sergey/.rvm/gems/ruby-1.9.3-p125#global/gems/bundler-1.1.1/lib/bundler/runtime.rb:77:in `rescue in rescue in block in require': undefined method `gsub' for nil:NilClass (NoMethodError)
from /Users/sergey/.rvm/gems/ruby-1.9.3-p125#global/gems/bundler-1.1.1/lib/bundler/runtime.rb:72:in `rescue in block in require'
from /Users/sergey/.rvm/gems/ruby-1.9.3-p125#global/gems/bundler-1.1.1/lib/bundler/runtime.rb:62:in `block in require'
from /Users/sergey/.rvm/gems/ruby-1.9.3-p125#global/gems/bundler-1.1.1/lib/bundler/runtime.rb:55:in `each'
from /Users/sergey/.rvm/gems/ruby-1.9.3-p125#global/gems/bundler-1.1.1/lib/bundler/runtime.rb:55:in `require'
from /Users/sergey/.rvm/gems/ruby-1.9.3-p125#global/gems/bundler-1.1.1/lib/bundler.rb:119:in `require'
from /Users/sergey/Dropbox/rails_projects/payforapps/config/application.rb:13:in `<top (required)>'
from /Users/sergey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/sergey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/sergey/Dropbox/rails_projects/payforapps/config/environment.rb:2:in `<top (required)>'
from /Users/sergey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/sergey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/sergey/Dropbox/rails_projects/payforapps/spec/spec_helper.rb:10:in `block in <top (required)>'
from /Users/sergey/.rvm/gems/ruby-1.9.3-p125#payforapps321/gems/spork-0.9.0/lib/spork.rb:24:in `prefork'
from /Users/sergey/Dropbox/rails_projects/payforapps/spec/spec_helper.rb:4:in `<top (required)>'
from /Users/sergey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/sergey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/sergey/Dropbox/rails_projects/payforapps/spec/controllers/static_pages_controller_spec.rb:1:in `<top (required)>'
from /Users/sergey/.rvm/gems/ruby-1.9.3-p125#payforapps321/gems/rspec-core-2.9.0/lib/rspec/core/configuration.rb:746:in `load'
from /Users/sergey/.rvm/gems/ruby-1.9.3-p125#payforapps321/gems/rspec-core-2.9.0/lib/rspec/core/configuration.rb:746:in `block in load_spec_files'
from /Users/sergey/.rvm/gems/ruby-1.9.3-p125#payforapps321/gems/rspec-core-2.9.0/lib/rspec/core/configuration.rb:746:in `map'
from /Users/sergey/.rvm/gems/ruby-1.9.3-p125#payforapps321/gems/rspec-core-2.9.0/lib/rspec/core/configuration.rb:746:in `load_spec_files'
from /Users/sergey/.rvm/gems/ruby-1.9.3-p125#payforapps321/gems/rspec-core-2.9.0/lib/rspec/core/command_line.rb:22:in `run'
from /Users/sergey/.rvm/gems/ruby-1.9.3-p125#payforapps321/gems/rspec-core-2.9.0/lib/rspec/core/runner.rb:66:in `rescue in run'
from /Users/sergey/.rvm/gems/ruby-1.9.3-p125#payforapps321/gems/rspec-core-2.9.0/lib/rspec/core/runner.rb:62:in `run'
from /Users/sergey/.rvm/gems/ruby-1.9.3-p125#payforapps321/gems/rspec-core-2.9.0/lib/rspec/core/runner.rb:10:in `block in autorun'
How can I fix it? Any help appreciated. Thank you.
The problem was in two gems in my Gemfile:
gem 'rb-inotify', '0.8.8'
gem 'libnotify', '0.5.9'
These gems are compatible only with Ubuntu as I understand.
UPD:
You should OS-specific gems to groups. Add all OS X specific gems to a darwin group in the Gemfile, and all Linux specific gems to a linux group:
# Gemfile
group :darwin do
gem 'rb-fsevent'
gem 'growl'
end
group :linux do
gem 'rb-inotify'
end
To require the appropriate gems in the right environment, add the following to config/application.rb:
platform = RUBY_PLATFORM.match(/(linux|darwin)/)[0].to_sym
Bundler.require(platform)
See https://github.com/bbatsov/rails-style-guide#bundler for more info about bundler here.
There was a problem with my gem .
update the bundler
Read the error properly, it will tell you which gem is the culprit.
Thing is that not all gems are compatible with OS .

Resources