Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NameError: uninitialized constant Order::AASM

I am implement a order system with AASM, but when I use rails c to check the function, but something wrong happen. NameError: uninitialized constant Order::AASM

Bug showed in console

There is gem 'aasm' in the Gemfile. I have searched Google and StackOverflow with NameError: uninitialized constant Order::AASM, but got nothing that did work.

I have reload bundle install and rails s, even reboot the computer. This is my code.

enter image description here

order's gist is here.

How to fix this? And if I can't find the right question, or you need more information, could you point it?

like image 302
张泽栋 Avatar asked Apr 13 '26 20:04

张泽栋


1 Answers

Try this:

  1. Comment out gem 'spring'and gem 'spring-watcher-listen', '~> 2.0.0'

  2. Run bundle install

Or try upgrading spring in your project:

  1. In your gemfile gem 'spring', '~> 2.0', '>= 2.0.2'
  2. Run bundle update spring
like image 148
wilton wung Avatar answered Apr 16 '26 12:04

wilton wung



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!