You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To see the error type:
$ rails c
2.1.5 :001 > Tester.drafting
If you revert the Gemfile back to Mongoid 4, the error goes away.
Here is the error:
NoMethodError: undefined method `aasm' for nil:NilClass
from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/aasm-4.3.0/lib/aasm/persistence/base.rb:72:in `block in state_with_scope'
from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/mongoid-5.0.0/lib/mongoid/scopable.rb:316:in `instance_exec'
from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/mongoid-5.0.0/lib/mongoid/scopable.rb:316:in `block (2 levels) in define_scope_method'
from (irb):1
from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/railties-4.1.13/lib/rails/commands/console.rb:90:in `start'
from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/railties-4.1.13/lib/rails/commands/console.rb:9:in `start'
from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/railties-4.1.13/lib/rails/commands/commands_tasks.rb:69:in `console'
from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/railties-4.1.13/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/railties-4.1.13/lib/rails/commands.rb:17:in `<top (required)>'
from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.13/lib/active_support/dependencies.rb:247:in `require'
from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.13/lib/active_support/dependencies.rb:247:in `block in require'
from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.13/lib/active_support/dependencies.rb:232:in `load_dependency'
from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.13/lib/active_support/dependencies.rb:247:in `require'
from /Users/ryan/src/aasmtest/bin/rails:8:in `<top (required)>'
from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.13/lib/active_support/dependencies.rb:241:in `load'
from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.13/lib/active_support/dependencies.rb:241:in `block in load'
from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.13/lib/active_support/dependencies.rb:232:in `load_dependency'
from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.13/lib/active_support/dependencies.rb:241:in `load'
from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/spring-1.4.0/lib/spring/commands/rails.rb:6:in `call'
from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/spring-1.4.0/lib/spring/command_wrapper.rb:38:in `call'
from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/spring-1.4.0/lib/spring/application.rb:183:in `block in serve'
from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/spring-1.4.0/lib/spring/application.rb:156:in `fork'
from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/spring-1.4.0/lib/spring/application.rb:156:in `serve'
from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/spring-1.4.0/lib/spring/application.rb:131:in `block in run'
from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/spring-1.4.0/lib/spring/application.rb:125:in `loop'
from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/spring-1.4.0/lib/spring/application.rb:125:in `run'
from /Users/ryan/.rvm/gems/ruby-2.1.5/gems/spring-1.4.0/lib/spring/application/boot.rb:18:in `<top (required)>'
from /Users/ryan/.rvm/rubies/ruby-2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/ryan/.rvm/rubies/ruby-2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
The text was updated successfully, but these errors were encountered:
Mongoid 5 is required for MongoDB 3 (the latest version). AASM doesn't seem to work with Mongoid 5.
Here is a test project: https://github.com/rdetert/aasmtest
Use the model
tester.rb
.To see the error type:
$ rails c
2.1.5 :001 > Tester.drafting
If you revert the Gemfile back to Mongoid 4, the error goes away.
Here is the error:
The text was updated successfully, but these errors were encountered: