bootstrappers
bootstrappers copied to clipboard
undefined local variable or method `current_user' for
installed latest gem (4.2). under ruby 2.0.0, rails 4 error occur when first "rails s"
same problem.
have you guys run " rake db:migrate " after generating?
Problem solved after several steps. But I forget the details. Kind of things like what you say. @Unayung
it's problem of database,
come to config/database.yml
back to default set:
development: adapter: sqlite3 database: db/development.sqlite3 pool: 5 timeout: 5000
test: adapter: sqlite3 database: db/test.sqlite3 pool: 5 timeout: 5000
production: adapter: sqlite3 database: db/production.sqlite3 pool: 5 timeout: 5000
and go to gemfile add : gem "sqlite3"
$ rake db:migrate
I found the error is because devise, you can run the following command: rails g devise:install rails g devise user rake db:migrate
I followed instructions from rails-101, generated the group model in exercise 1 and encountered the same problem, I tried " rake db:migrate " after generating, and the same problem still exists.
you need install devise, try
$ rails g devise:install
$ rails g devise user
Finally solved the problem, after running "rails g devise:install", make sure the following steps are completed: