生成模型后Ruby gem设计错误

我从昨天开始就一直坚持这个问题,我已经在互联网上搜索了,看来很多人在运行’rails generate devise User’之后也遇到了同样的错误

我正在运行我认为是最新版本的Devise(3.0.0.rc),当我尝试运行’rails server’时,我收到以下错误消息。 (我遵循安装时设计给出的规定)

我无法破坏模型,我无法迁移我的数据库,我必须删除整个项目,每次都重新开始。

请帮忙!

C:\Sites\blogbar>rails server => Booting WEBrick => Rails 4.0.0 application starting in development on http://0.0.0.0:3000 => Run `rails server -h` for more startup options => Ctrl-C to shutdown server Exiting C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.0.0/lib/act ive_support/dependencies.rb:228:in `require': cannot load such file -- 1.9/bcryp t_ext (LoadError) from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport- 4.0.0/lib/active_support/dependencies.rb:228:in `block in require' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport- 4.0.0/lib/active_support/dependencies.rb:211:in `block in load_dependency' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport- 4.0.0/lib/active_support/dependencies.rb:615:in `new_constants_in' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport- 4.0.0/lib/active_support/dependencies.rb:211:in `load_dependency' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport- 4.0.0/lib/active_support/dependencies.rb:228:in `require' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bcrypt-ruby-3. 1.0-x86-mingw32/lib/bcrypt_ext.rb:2:in `' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport- 4.0.0/lib/active_support/dependencies.rb:228:in `require' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport- 4.0.0/lib/active_support/dependencies.rb:228:in `block in require' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport- 4.0.0/lib/active_support/dependencies.rb:211:in `block in load_dependency' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport- 4.0.0/lib/active_support/dependencies.rb:615:in `new_constants_in' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport- 4.0.0/lib/active_support/dependencies.rb:211:in `load_dependency' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport- 4.0.0/lib/active_support/dependencies.rb:228:in `require' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bcrypt-ruby-3. 1.0-x86-mingw32/lib/bcrypt.rb:12:in `' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport- 4.0.0/lib/active_support/dependencies.rb:228:in `require' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport- 4.0.0/lib/active_support/dependencies.rb:228:in `block in require' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport- 4.0.0/lib/active_support/dependencies.rb:211:in `block in load_dependency' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport- 4.0.0/lib/active_support/dependencies.rb:615:in `new_constants_in' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport- 4.0.0/lib/active_support/dependencies.rb:211:in `load_dependency' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport- 4.0.0/lib/active_support/dependencies.rb:228:in `require' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/bundler/gems/devise -3c519b13ff94/lib/devise/models/database_authenticatable.rb:2:in `' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/bundler/gems/devise -3c519b13ff94/lib/devise/models.rb:97:in `const_get' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/bundler/gems/devise -3c519b13ff94/lib/devise/models.rb:97:in `block (2 levels) in devise' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/bundler/gems/devise -3c519b13ff94/lib/devise/models.rb:92:in `each' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/bundler/gems/devise -3c519b13ff94/lib/devise/models.rb:92:in `block in devise' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/bundler/gems/devise -3c519b13ff94/lib/devise/models.rb:123:in `devise_modules_hook!' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/bundler/gems/devise -3c519b13ff94/lib/devise/models.rb:90:in `devise' from C:/Sites/blogbar/app/models/user.rb:5:in `' from C:/Sites/blogbar/app/models/user.rb:1:in `' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport- 4.0.0/lib/active_support/dependencies.rb:423:in `load' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport- 4.0.0/lib/active_support/dependencies.rb:423:in `block in load_file' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport- 4.0.0/lib/active_support/dependencies.rb:615:in `new_constants_in' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport- 4.0.0/lib/active_support/dependencies.rb:422:in `load_file' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport- 4.0.0/lib/active_support/dependencies.rb:323:in `require_or_load' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport- 4.0.0/lib/active_support/dependencies.rb:462:in `load_missing_constant' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport- 4.0.0/lib/active_support/dependencies.rb:183:in `const_missing' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport- 4.0.0/lib/active_support/inflector/methods.rb:226:in `const_get' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport- 4.0.0/lib/active_support/inflector/methods.rb:226:in `block in constantize' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport- 4.0.0/lib/active_support/inflector/methods.rb:224:in `each' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport- 4.0.0/lib/active_support/inflector/methods.rb:224:in `inject' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport- 4.0.0/lib/active_support/inflector/methods.rb:224:in `constantize' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport- 4.0.0/lib/active_support/dependencies.rb:534:in `get' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport- 4.0.0/lib/active_support/dependencies.rb:565:in `constantize' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/bundler/gems/devise -3c519b13ff94/lib/devise.rb:274:in `get' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/bundler/gems/devise -3c519b13ff94/lib/devise/mapping.rb:77:in `to' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/bundler/gems/devise -3c519b13ff94/lib/devise/mapping.rb:72:in `modules' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/bundler/gems/devise -3c519b13ff94/lib/devise/mapping.rb:89:in `routes' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/bundler/gems/devise -3c519b13ff94/lib/devise/mapping.rb:156:in `default_used_route' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/bundler/gems/devise -3c519b13ff94/lib/devise/mapping.rb:66:in `initialize' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/bundler/gems/devise -3c519b13ff94/lib/devise.rb:308:in `new' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/bundler/gems/devise -3c519b13ff94/lib/devise.rb:308:in `add_mapping' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/bundler/gems/devise -3c519b13ff94/lib/devise/rails/routes.rb:208:in `block in devise_for' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/bundler/gems/devise -3c519b13ff94/lib/devise/rails/routes.rb:207:in `each' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/bundler/gems/devise -3c519b13ff94/lib/devise/rails/routes.rb:207:in `devise_for' from C:/Sites/blogbar/config/routes.rb:3:in `block in ' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-4.0 .0/lib/action_dispatch/routing/route_set.rb:316:in `instance_exec' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-4.0 .0/lib/action_dispatch/routing/route_set.rb:316:in `eval_block' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-4.0 .0/lib/action_dispatch/routing/route_set.rb:294:in `draw' from C:/Sites/blogbar/config/routes.rb:1:in `' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport- 4.0.0/lib/active_support/dependencies.rb:222:in `load' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport- 4.0.0/lib/active_support/dependencies.rb:222:in `block in load' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport- 4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport- 4.0.0/lib/active_support/dependencies.rb:222:in `load' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0 /lib/rails/application/routes_reloader.rb:40:in `block in load_paths' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0 /lib/rails/application/routes_reloader.rb:40:in `each' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0 /lib/rails/application/routes_reloader.rb:40:in `load_paths' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0 /lib/rails/application/routes_reloader.rb:16:in `reload!' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0 /lib/rails/application/routes_reloader.rb:26:in `block in updater' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport- 4.0.0/lib/active_support/file_update_checker.rb:75:in `call' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport- 4.0.0/lib/active_support/file_update_checker.rb:75:in `execute' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0 /lib/rails/application/routes_reloader.rb:27:in `updater' from C:65535:in `execute_if_updated' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0 /lib/rails/application/finisher.rb:69:in `block in ' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0 /lib/rails/initializable.rb:30:in `instance_exec' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0 /lib/rails/initializable.rb:30:in `run' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0 /lib/rails/initializable.rb:55:in `block in run_initializers' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:150:in `block i n tsort_each' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:183:in `block ( 2 levels) in each_strongly_connected_component' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:219:in `each_st rongly_connected_component_from' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:182:in `block i n each_strongly_connected_component' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:180:in `each' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:180:in `each_st rongly_connected_component' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:148:in `tsort_e ach' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0 /lib/rails/initializable.rb:54:in `run_initializers' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0 /lib/rails/application.rb:215:in `initialize!' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0 /lib/rails/railtie/configurable.rb:30:in `method_missing' from C:/Sites/blogbar/config/environment.rb:5:in `' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport- 4.0.0/lib/active_support/dependencies.rb:228:in `require' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport- 4.0.0/lib/active_support/dependencies.rb:228:in `block in require' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport- 4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport- 4.0.0/lib/active_support/dependencies.rb:228:in `require' from C:/Sites/blogbar/config.ru:3:in `block in ' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib /rack/builder.rb:55:in `instance_eval' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib /rack/builder.rb:55:in `initialize' from C:/Sites/blogbar/config.ru:in `new' from C:/Sites/blogbar/config.ru:in `' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib /rack/builder.rb:49:in `eval' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib /rack/builder.rb:49:in `new_from_string' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib /rack/builder.rb:40:in `parse_file' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib /rack/server.rb:277:in `build_app_and_options_from_config' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib /rack/server.rb:199:in `app' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0 /lib/rails/commands/server.rb:48:in `app' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib /rack/server.rb:314:in `wrapped_app' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0 /lib/rails/commands/server.rb:75:in `start' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0 /lib/rails/commands.rb:78:in `block in ' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0 /lib/rails/commands.rb:73:in `tap' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0 /lib/rails/commands.rb:73:in `' from bin/rails:4:in `require' from bin/rails:4:in `' 

看起来没有安装’bcrypt_ext’gem。 添加这个gem和\或做

 bundle install