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 method `email_autoset=' or Column 'email' cannot be null #3

Open
ghost opened this issue Dec 20, 2010 · 2 comments
Open

undefined method `email_autoset=' or Column 'email' cannot be null #3

ghost opened this issue Dec 20, 2010 · 2 comments

Comments

@ghost
Copy link

ghost commented Dec 20, 2010

Hi. Im trying to run your example and have the first error (undefined method `email_autoset=') in my User model. When I changing 'self_email_autoset' to just 'email_autoset' I have another one - 'Column 'email' cannot be null'.

So as I think, In second case my app doesn't get email from OpenID provider (Google in my case) even if provider send it. There is part of the link to which Google redirect me after validating:

&openid.ext1.type.ext0=http%3A%2F%2Faxschema.org%2Fcontact%2Femail&openid.ext1.value.ext0=myemail%40gmail.com

As you can see 'openid.ext1.value.ext0' is containing my email.

P.s. Im riding Rails 3.0.3 and Ruby 1.9.2. And Im using both lib files from vendor folder (session.rb and acts_as_authentic.rb).

UPD: I forgot to take your version of "open_id_authentication" (dont know where did you take it, current version of it much differs). So now I have another funny error: "uninitialized constant Rack::OpenID" (Yes, I have "rack-openid" installed)

@shripadk
Copy link
Owner

Ok. AFAIK it has something to do with the code not being compatible with Rails 3.0.3. I haven't updated the codebase for quite sometime. Moved from programming in Ruby to Nodejs. So I haven't kept up with updates to Rails. I remember having major issues with rack-openid installation, especially "uninitialized constant Rack::OpenID". :) I suggest using Rails 2.x and Ruby 1.8.7 with the code. However, there might be forks around that may have made it Rails 3.0.3 compatible too.

Also, do you use my version of rack-openid? Even that might have undergone major changes.
config.gem "rack-openid", :lib => 'rack/openid', :version => '>=0.2.1'

@ghost
Copy link
Author

ghost commented Dec 22, 2010

Thanks for the reply! It seems that following line in config/environment.rb solved my problem:

require 'rack/openid'

UPD: I think that is better to use this in Gemfile:

gem 'rack-openid', :require => 'rack/openid'

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

1 participant