Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save iseitz/aa0454da3fa4916d52dd2c4d2ebce575 to your computer and use it in GitHub Desktop.
Save iseitz/aa0454da3fa4916d52dd2c4d2ebce575 to your computer and use it in GitHub Desktop.
Since it is a second time that I spend 2 hours on the same problem I'll leave the solution here
In case where you run the bundle exec rake db:create for the first time and get the error:
$ "rake aborted!
$ NoMethodError: undefined method 'name' in 'campsite' factory"
The problem is the Deprecation of static attributes in factory_bot 4.11 and up.
In your Gemfile you need to downgrade manually the factory_bot_rails from the latest version to something between 4.8.2 and 4.11
For example it can be: gem 'factory_bot_rails', '~> 4.8.2'
It solved the problem for me ) twice )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment