It may have been renamed since the example I looked at. I haven't used 4.2 yet. (Okay, just checked, and it is the way you describe -- same version, even -- in 4.1. Sorry for the noise.)
Walter
On Dec 1, 2014, at 10:44 AM, Roelof Wobben <rwobben@hotmail.com> wrote:
> I have exactly what Hartl says.
>
> He says to change my gem file to this :
>
> source 'https://rubygems.org'
>
>
>
> gem 'rails', '4.2.0.rc1'
> gem 'bcrypt', '3.1.7'
>
>
> And there is no mention about bcrypt-rubt
>
> Roelof
>
>
>
> Op maandag 1 december 2014 16:40:41 UTC+1 schreef Walter Lee Davis:
>
> On Dec 1, 2014, at 10:32 AM, Roelof Wobben <rwo...@hotmail.com> wrote:
>
> > Hello,
> >
> > I did all the steps from the Hartl tutorial but as soon as I do this :
> >
> > User.create(name: "Michael Hartl", email: "mha...@example.com",password: "foobar", password_confirmation: "foobar")
> >
> > on the rails console, I see this error message :
>
> Make sure that your Gemfile looks EXACTLY the same as Señor Hartl's. I am betting you are missing the bcrypt library. (It's commented out in a default `rails new` generated site.
>
> # To use ActiveModel has_secure_password
> # gem 'bcrypt-ruby', '~> 3.0.0'
>
>
> Walter
>
> > NoMethodError: undefined method `password_digest=' for #<User:0x00000004489fc8>
> > from /usr/local/rvm/gems/ruby-2.1.4@rails4/gems/activemodel-4.2.0.beta4/lib/active_model/attribute_methods.rb:435:in `method_missing'
> > from /usr/local/rvm/gems/ruby-2.1.4@rails4/gems/activemodel-4.2.0.beta4/lib/active_model/secure_password.rb:125:in `password='
> > from /usr/local/rvm/gems/ruby-2.1.4@rails4/gems/activerecord-4.2.0.beta4/lib/active_record/attribute_assignment.rb:54:in `public_send'
> > from /usr/local/rvm/gems/ruby-2.1.4@rails4/gems/activerecord-4.2.0.beta4/lib/active_record/attribute_assignment.rb:54:in `_assign_attribute'
> > from /usr/local/rvm/gems/ruby-2.1.4@rails4/gems/activerecord-4.2.0.beta4/lib/active_record/attribute_assignment.rb:41:in `block in assign_attributes'
> > from /usr/local/rvm/gems/ruby-2.1.4@rails4/gems/activerecord-4.2.0.beta4/lib/active_record/attribute_assignment.rb:35:in `each'
> > from /usr/local/rvm/gems/ruby-2.1.4@rails4/gems/activerecord-4.2.0.beta4/lib/active_record/attribute_assignment.rb:35:in `assign_attributes'
> > from /usr/local/rvm/gems/ruby-2.1.4@rails4/gems/activerecord-4.2.0.beta4/lib/active_record/core.rb:556:in `init_attributes'
> > from /usr/local/rvm/gems/ruby-2.1.4@rails4/gems/activerecord-4.2.0.beta4/lib/active_record/core.rb:277:in `initialize'
> > from /usr/local/rvm/gems/ruby-2.1.4@rails4/gems/activerecord-4.2.0.beta4/lib/active_record/inheritance.rb:61:in `new'
> > from /usr/local/rvm/gems/ruby-2.1.4@rails4/gems/activerecord-4.2.0.beta4/lib/active_record/inheritance.rb:61:in `new'
> > from /usr/local/rvm/gems/ruby-2.1.4@rails4/gems/activerecord-4.2.0.beta4/lib/active_record/persistence.rb:33:in `create'
> > from (irb):4
> > from /usr/local/rvm/gems/ruby-2.1.4@rails4/gems/railties-4.2.0.beta4/lib/rails/commands/console.rb:110:in `start'
> > from /usr/local/rvm/gems/ruby-2.1.4@rails4/gems/railties-4.2.0.beta4/lib/rails/commands/console.rb:9:in `start'
> > from /usr/local/rvm/gems/ruby-2.1.4@rails4/gems/railties-4.2.0.beta4/lib/rails/commands/commands_tasks.rb:68:in `console'
> > from /usr/local/rvm/gems/ruby-2.1.4@rails4/gems/railties-4.2.0.beta4/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
> > from /usr/local/rvm/gems/ruby-2.1.4@rails4/gems/railties-4.2.0.beta4/lib/rails/commands.rb:17:in `<top (required)>'
> > from /usr/local/rvm/gems/ruby-2.1.4@rails4/gems/activesupport-4.2.0.beta4/lib/active_support/dependencies.rb:252:in `require'
> > from /usr/local/rvm/gems/ruby-2.1.4@rails4/gems/activesupport-4.2.0.beta4/lib/active_support/dependencies.rb:252:in `block in require'
> > from /usr/local/rvm/gems/ruby-2.1.4@rails4/gems/activesupport-4.2.0.beta4/lib/active_support/dependencies.rb:237:in `load_dependency'
> > from /usr/local/rvm/gems/ruby-2.1.4@rails4/gems/activesupport-4.2.0.beta4/lib/active_support/dependencies.rb:252:in `require'
> > from /home/ubuntu/workspace/sample_app/bin/rails:8:in `<top (required)>'
> > from /usr/local/rvm/gems/ruby-2.1.4@rails4/gems/activesupport-4.2.0.beta4/lib/active_support/dependencies.rb:246:in `load'
> > from /usr/local/rvm/gems/ruby-2.1.4@rails4/gems/activesupport-4.2.0.beta4/lib/active_support/dependencies.rb:246:in `block in load'
> > from /usr/local/rvm/gems/ruby-2.1.4@rails4/gems/activesupport-4.2.0.beta4/lib/active_support/dependencies.rb:237:in `load_dependency'
> > from /usr/local/rvm/gems/ruby-2.1.4@rails4/gems/activesupport-4.2.0.beta4/lib/active_support/dependencies.rb:246:in `load'
> > from /usr/local/rvm/rubies/ruby-2.1.4/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
> > from /usr/local/rvm/rubies/ruby-2.1.4/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
> >
> > Roelof
> >
> >
> > --
> > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
> > To post to this group, send email to rubyonra...@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/13a9046e-8e2f-4472-84db-0e06849f3db3%40googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/6cb54d90-22ad-4ae8-a690-ea68289da66d%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/FC407735-623F-4D9A-AFCE-A3696A67F235%40wdstudio.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment