ながら、次のコマンドにより、レールコンソールからデータベースを更新:私は使用してそれを更新し私はnilのオブジェクト参照を取得-ror
user=User.first
User Load (0.4ms) SELECT "users".* FROM "users" LIMIT 1
=> nil
そして
user.update_attributes(:email => "[email protected]", :password => "foobar", :password_confirmation => "foobar")`
私が手このエラー:
NoMethodError: You have a nil object when you didn't expect it!
You might have expected an instance of ActiveRecord::Base.
The error occurred while evaluating nil.update_attributes
私はmhartlチュートリアルからRORを学習しようとしています。これはチュートリアルに関連しています。私はサイト上ですでに同様の質問をしていましたが、何もできませんでした。ここに私の特定のエラーを投稿する。
したがって、明らかにデータベースにユーザーはいません。 –