Database 'db/production/production.sqlite3' already exists
>>> Database migration
rake aborted!
Database 'db/production/production.sqlite3' already exists
>>> Database migration
500 Internal Server Error If you are the administrator of this website, then please read this web application's log file and/or the web server's log file to find out what went wrong.
$ docker exec -it custom bash
bash-4.4# bundle exec rails c
User.all.each do |user|
user.add_role(:user) if user.roles.blank?
end
Loading production environment (Rails 5.2.3)
irb(main):001:0> User.all.each do |user|
irb(main):002:1* user.add_role(:user) if user.roles.blank?
irb(main):003:1> end
Traceback (most recent call last):
3: from (irb):1
2: from (irb):2:in `block in irb_binding'
1: from app/models/user.rb:200:in `add_role'
NoMethodError (undefined method `strip' for :user:Symbol)
irb(main):004:0>
User.all.each do |user|
user.add_role("user") if user.roles.blank?
end
$ docker exec -it custom bash
bash-4.4# bundle exec rails c
Loading production environment (Rails 5.2.3)
irb(main):001:0> User.all.each do |user|
irb(main):002:1* user.add_role("user") if user.roles.blank?
irb(main):003:1> end
Traceback (most recent call last):
2: from (irb):1
1: from (irb):2:in `block in irb_binding'
NameError (undefined local variable or method ` user' for main:Object)
irb(main):004:0>
$ docker exec -it custom bash
bash-4.4# bundle exec rails c
Loading production environment (Rails 5.2.3)
irb(main):001:0> User.all.each do |user|
irb(main):002:1* user.add_role("user") if user.roles.blank?
irb(main):003:1> end
=> [#<
User id: 1, room_id: 1, provider: "greenlight", uid: "gl-abvmcxjuftfz", name: "carldgosselin", username: nil, email: "rem...@email.com", social_uid: nil, image: "", password_digest: "sdfkjsdlkjdslfjdlskfjlksdjflsdjsdlfj...", accepted_terms: false, created_at: "2019-04-02 20:07:37", updated_at: "2020-03-18 00:18:38", email_verified: true, language: "default", reset_digest: "dsfjlsdjfldskjflkdsjflkdsjfldsf...", reset_sent_at: "2020-03-18 00:18:38", activation_digest: "lskdjflkdsjfldsjfldskfsd...", activated_at: "2019-04-02 20:07:37", deleted: false>, #<User id: 2, ...