Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7622221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:23:52+00:00 2026-05-31T04:23:52+00:00

New to Ruby on Rails and having a problem when following Michael Hartl’s tutorial.I’m

  • 0

New to Ruby on Rails and having a problem when following Michael Hartl’s tutorial.I’m using Rails 3.2.2 with Ruby 1.9.3. The issue looks very similar to another question that was raised but was unanswered:
Rails Error NoMethodError in UsersController#show error

I get the following error when attempting to add a new user via /signup

Gem::LoadError in UsersController#new
bcrypt-ruby is not part of the bundle. Add it to Gemfile.

Reloading the page gives the error:

NoMethodError in UsersController#new
undefined method `key?' for nil:NilClass

The problem seems to be related to the inclusion of the bcrypt-ruby gem, and the usage of the has_secure_password method in user.rb . Removing the call to has_secure_password in user.rb gets rid of the error and it goes to the signup page successfully.

user.rb:

# == Schema Information
#
# Table name: users
#
#  id              :integer         not null, primary key
#  name            :string(255)
#  email           :string(255)
#  created_at      :datetime        not null
#  updated_at      :datetime        not null
#  password_digest :string(255)
#

class User < ActiveRecord::Base
  attr_accessible :name, :email, :password, :password_confirmation
  has_secure_password

  validates :name, presence: true, length: { maximum: 50 }
  valid_email_regex = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
  validates :email, presence:   true,
                    format:     { with: valid_email_regex },
                    uniqueness: { case_sensitive: false }
  validates :password, length: { minimum: 6}
end

users_controller.rb:

class UsersController < ApplicationController
  def new
    @user = User.new
  end
def create
    @user = User.new(params[:user])
    if @user.save
        flash[:success] = "Welcome!"
      redirect_to @user
    else
      render 'new'
    end
  end
end

However, I cant find anything wrong with the inclusion of the bcrypt-ruby gem. In the Gemfile I have:

gem 'bcrypt-ruby', '3.0.1'

and the gem has also been generated in Gemfile.lock :

DEPENDENCIES
  annotate (~> 2.4.1.beta)
  bcrypt-ruby (= 3.0.1)

I’ve also added password_digest to the database via migration:

class AddPasswordDigestToUsers < ActiveRecord::Migration
  def change
    add_column :users, :password_digest, :string

  end
end

Any ideas ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T04:23:54+00:00Added an answer on May 31, 2026 at 4:23 am

    Did you tried the ‘bundle update’ command, usually the bundler will take care of gems if you specified in the Gemfile. If you want to check the gem dependency please check http://rubygems.org/gems.

    And if you are using windows(I know its strange- but some of our app works in windows only) there is some tricks to install bcrypt

    Steps to install bcrypt.

    1 Download Devkit and extract

    you can download it from here http://rubyinstaller.org/downloads/

    2 Place devkit it your jruby folder (in my case C:\applications\jruby\devkit)

    3 You need to install ruby as well either 1.8.7 or 1.9(some times needs a system restart)

    4 CD into devkit directory

    5 Run ruby dk.rb init

    6 Open config.yml and make sure that both your jruby installtion is listed. If not, ADD them. Save and close config.yml after you’re done.

    example:- C:/applications/jruby

    7 Run ruby dk.rb install

    8 jruby -S gem install bcrypt-ruby

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to Ruby on Rails and am following a tutorial to create
i developed a project using Ruby on Rails and i having a huge problem
I'm using Jquery with Ruby on Rails (3.1) and am having some problem with
I'm still new to Ruby on Rails and I'm currently having a issue with
I am new to Ruby on Rails, I have completed the Blog Tutorial .
I'm very new to Ruby on Rails so please go easy! I've uploaded the
I am quite new to rails... I am having an issue with displaying of
I am having a ruby on rails application.I added a new section called reports
I am running Rails 3.0.1 and Rspec 2.0.1. I am following M. Hartl's Ruby
I'm using ruby 1.9.2 and rails 3 and I think I'm having a moderately

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.