Notifications
You’re not receiving notifications from this thread.
Rails for Beginners Part 11: Creating the User model Discussion
Nicely done. User.all , User.first, User.last, User.create({hash:"hash"})
Hi
I get an error on User.all
Object doesn't support #inspect
my console output
ubuntu@LAPTOP-MIO8EIGO:~/projects/scheduled_tweets$ rails c
Loading development environment (Rails 6.1.4.1)
irb(main):001:0> User
=> User (call 'User.connection' to establish a connection)
irb(main):002:0> User.all
(51.7ms) SELECT sqlite_version()
User Load (1.2ms) SELECT "users". FROM "users"
(Object doesn't support #inspect)
=>
I had the same error and I was also getting
PG::UndefinedTable: ERROR: relation "users" does not exist (ActiveRecord::StatementInvalid)
LINE 9: WHERE a.attrelid = '"users"'::regclass
when I was running User.create...
. I had missed the command rails db:migrate
😫
I don't know why I can't install the bcrypt. I tried several versions and lots of uninstalling and reinstalling the gem. At first I had the error about the .gemrc file but after that I created the file manually I can successfully run the bundle command but every time I can't run the rails server command and a long log appear.
This line is already in the Gemfile at around line 37:
gem "bcrypt", "~> 3.1.7"
You just need to uncomment it and then run bundle. Did you try this? : )