All threads / Rails for Beginners Part 11: Creating the User model Discussion
Ask A Question

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"})

Reply

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)
=>

you might have missed out the

"rails db:migrate"

command.

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 😫

Reply

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.

Reply

You can use ANNOTATE gem for the comments in the models

Reply
Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 66,029+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

    © 2022 GoRails, LLC. All rights reserved.