Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined local variable or method `current_user' for #19

Open
xcopter opened this issue Aug 31, 2013 · 8 comments
Open

undefined local variable or method `current_user' for #19

xcopter opened this issue Aug 31, 2013 · 8 comments

Comments

@xcopter
Copy link

xcopter commented Aug 31, 2013

installed latest gem (4.2).
under ruby 2.0.0, rails 4
error occur when first "rails s"

screen shot 2013-08-31 at 5 23 54 pm

@Jeswang
Copy link

Jeswang commented Sep 1, 2013

same problem.

@Unayung
Copy link
Contributor

Unayung commented Sep 5, 2013

have you guys run " rake db:migrate " after generating?

@Jeswang
Copy link

Jeswang commented Sep 5, 2013

Problem solved after several steps. But I forget the details. Kind of things like what you say. @Unayung

@sdlong
Copy link

sdlong commented Dec 12, 2013

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

@beer
Copy link

beer commented Dec 24, 2013

I found the error is because devise, you can run the following command:
rails g devise:install
rails g devise user
rake db:migrate

@yuyueugene84
Copy link

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.

@sdlong
Copy link

sdlong commented Sep 4, 2014

you need install devise, try

$ rails g devise:install

$ rails g devise user

@yuyueugene84
Copy link

Finally solved the problem, after running "rails g devise:install", make sure the following steps are completed:

2014-09-04 9 25 22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants