Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Ruby

Hitting a road block on the Ruby videos

Hi there everyone, I have tried almost everything to fix this issue I'm having. I have just started to learn about ruby and found out about these videos, I have gotten as far as "Generating the user model", as far as I'm aware devise installed properly without spitting any errors, everything else is installed and I followed the exact steps on the video.

This is the error that it spits out when I do rake db:migrate--trace, but it doesn't really make much sense to me, hopefully someone can help me out, I don't have much time on my hands to do the course so hopefully I don't have to start all over again.

C:\Sites\projects\treebook>rake db:migrate --trace
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
cannot load such file -- 1.9/bcrypt_ext
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/dependencies.rb:251:in `require'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/dependencies.rb:251:in `block in require'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/dependencies.rb:234:in `block in load_dependency'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/dependencies.rb:639:in `new_constants_in'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/dependencies.rb:234:in `load_dependency'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/dependencies.rb:251:in `require'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bcrypt-ruby-3.1.0-x86-mingw
32/lib/bcrypt_ext.rb:2:in `<top (required)>'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/dependencies.rb:251:in `require'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/dependencies.rb:251:in `block in require'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/dependencies.rb:234:in `block in load_dependency'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/dependencies.rb:639:in `new_constants_in'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/dependencies.rb:234:in `load_dependency'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/dependencies.rb:251:in `require'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bcrypt-ruby-3.1.0-x86-mingw
32/lib/bcrypt.rb:12:in `<top (required)>'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/dependencies.rb:251:in `require'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/dependencies.rb:251:in `block in require'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/dependencies.rb:234:in `block in load_dependency'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/dependencies.rb:639:in `new_constants_in'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/dependencies.rb:234:in `load_dependency'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/dependencies.rb:251:in `require'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/devise-2.2.4/lib/devise/mod
els/database_authenticatable.rb:2:in `<top (required)>'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/devise-2.2.4/lib/devise/mod
els.rb:97:in `const_get'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/devise-2.2.4/lib/devise/mod
els.rb:97:in `block (2 levels) in devise'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/devise-2.2.4/lib/devise/mod
els.rb:92:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/devise-2.2.4/lib/devise/mod
els.rb:92:in `block in devise'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/devise-2.2.4/lib/devise/mod
els.rb:123:in `devise_modules_hook!'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/devise-2.2.4/lib/devise/mod
els.rb:90:in `devise'
C:/Sites/projects/treebook/app/models/user.rb:5:in `<class:User>'
C:/Sites/projects/treebook/app/models/user.rb:1:in `<top (required)>'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/dependencies.rb:469:in `load'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/dependencies.rb:469:in `block in load_file'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/dependencies.rb:639:in `new_constants_in'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/dependencies.rb:468:in `load_file'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/dependencies.rb:353:in `require_or_load'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/dependencies.rb:502:in `load_missing_constant'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/dependencies.rb:192:in `block in const_missing'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/dependencies.rb:190:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/dependencies.rb:190:in `const_missing'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/inflector/methods.rb:230:in `block in constantize'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/inflector/methods.rb:229:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/inflector/methods.rb:229:in `constantize'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/dependencies.rb:554:in `get'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/dependencies.rb:588:in `constantize'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/devise-2.2.4/lib/devise.rb:
272:in `get'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/devise-2.2.4/lib/devise/map
ping.rb:77:in `to'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/devise-2.2.4/lib/devise/map
ping.rb:72:in `modules'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/devise-2.2.4/lib/devise/map
ping.rb:89:in `routes'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/devise-2.2.4/lib/devise/map
ping.rb:156:in `default_used_route'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/devise-2.2.4/lib/devise/map
ping.rb:66:in `initialize'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/devise-2.2.4/lib/devise.rb:
306:in `new'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/devise-2.2.4/lib/devise.rb:
306:in `add_mapping'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/devise-2.2.4/lib/devise/rai
ls/routes.rb:208:in `block in devise_for'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/devise-2.2.4/lib/devise/rai
ls/routes.rb:207:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/devise-2.2.4/lib/devise/rai
ls/routes.rb:207:in `devise_for'
C:/Sites/projects/treebook/config/routes.rb:2:in `block in <top (required)>'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.2.13/lib/actio
n_dispatch/routing/route_set.rb:289:in `instance_exec'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.2.13/lib/actio
n_dispatch/routing/route_set.rb:289:in `eval_block'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.2.13/lib/actio
n_dispatch/routing/route_set.rb:267:in `draw'
C:/Sites/projects/treebook/config/routes.rb:1:in `<top (required)>'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/dependencies.rb:245:in `load'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/dependencies.rb:245:in `block in load'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/dependencies.rb:236:in `load_dependency'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/dependencies.rb:245:in `load'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/a
pplication/routes_reloader.rb:40:in `block in load_paths'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/a
pplication/routes_reloader.rb:40:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/a
pplication/routes_reloader.rb:40:in `load_paths'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/a
pplication/routes_reloader.rb:16:in `reload!'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/a
pplication/routes_reloader.rb:26:in `block in updater'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/file_update_checker.rb:78:in `call'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/file_update_checker.rb:78:in `execute'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/a
pplication/routes_reloader.rb:27:in `updater'
C:in `execute_if_updated'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/a
pplication/finisher.rb:66:in `block in <module:Finisher>'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/i
nitializable.rb:30:in `instance_exec'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/i
nitializable.rb:30:in `run'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/i
nitializable.rb:55:in `block in run_initializers'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/i
nitializable.rb:54:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/i
nitializable.rb:54:in `run_initializers'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/a
pplication.rb:136:in `initialize!'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/r
ailtie/configurable.rb:30:in `method_missing'
C:/Sites/projects/treebook/config/environment.rb:5:in `<top (required)>'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/dependencies.rb:251:in `require'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/dependencies.rb:251:in `block in require'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/dependencies.rb:236:in `load_dependency'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/dependencies.rb:251:in `require'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/a
pplication.rb:103:in `require_environment!'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/a
pplication.rb:297:in `block (2 levels) in initialize_tasks'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.r
b:236:in `call'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.r
b:236:in `block in execute'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.r
b:231:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.r
b:231:in `execute'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.r
b:175:in `block in invoke_with_call_chain'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.r
b:168:in `invoke_with_call_chain'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.r
b:197:in `block in invoke_prerequisites'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.r
b:195:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.r
b:195:in `invoke_prerequisites'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.r
b:174:in `block in invoke_with_call_chain'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.r
b:168:in `invoke_with_call_chain'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.r
b:161:in `invoke'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/applic
ation.rb:149:in `invoke_task'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/applic
ation.rb:106:in `block (2 levels) in top_level'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/applic
ation.rb:106:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/applic
ation.rb:106:in `block in top_level'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/applic
ation.rb:115:in `run_with_threads'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/applic
ation.rb:100:in `top_level'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/applic
ation.rb:78:in `block in run'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/applic
ation.rb:165:in `standard_exception_handling'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/applic
ation.rb:75:in `run'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/bin/rake:33:in
`<top (required)>'
C:/RailsInstaller/Ruby1.9.3/bin/rake:23:in `load'
C:/RailsInstaller/Ruby1.9.3/bin/rake:23:in `<main>'
Tasks: TOP => db:migrate => environment

2 Answers

Bowen Smith
Bowen Smith
15,223 Points

I stole this from staffer Andrew Chalkley's post in a similar thread but I had the exact same problem and it worked for me.

add

gem 'bcrypt-ruby', '~> 3.0.0', :require => "bcrypt"

to your Gemfile

Thank you for this, I tried it and it spat something about a wrong file, I restarted the project through the commit from git and it's worked perfectly.

Brandon Barrette
Brandon Barrette
20,485 Points

Can you paste your user model file (user.rb)?

from treebook > app > models >

class User < ActiveRecord::Base
  # Include default devise modules. Others available are:
  # :token_authenticatable, :confirmable,
  # :lockable, :timeoutable and :omniauthable
  devise :database_authenticatable, :registerable,
         :recoverable, :rememberable, :trackable, :validatable

  # Setup accessible (or protected) attributes for your model
  attr_accessible :email, :password, :password_confirmation, :remember_me
  # attr_accessible :title, :body
end

Sorry about the wait. Should check my emails more often...