2017-03-17 128 views
0

当我尝试启动我的本地服务器的轨道,我得到了以下错误:Rails的错误时启动服务器

C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/bcrypt-3.1.11-x86-mingw32/lib/bcrypt.rb:16:in `require': cannot load such file -- bcrypt_ext (LoadError) 
    from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/bcrypt-3.1.11-x86-mingw32/lib/bcrypt.rb:16:in `rescue in <top (required)>' 
    from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/bcrypt-3.1.11-x86-mingw32/lib/bcrypt.rb:12:in `<top (required)>' 
    from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.14.6/lib/bundler/runtime.rb:91:in `require' 
    from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.14.6/lib/bundler/runtime.rb:91:in `block (2 levels) in require' 
    from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.14.6/lib/bundler/runtime.rb:86:in `each' 
    from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.14.6/lib/bundler/runtime.rb:86:in `block in require' 
    from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.14.6/lib/bundler/runtime.rb:75:in `each' 
    from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.14.6/lib/bundler/runtime.rb:75:in `require' 
    from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.14.6/lib/bundler.rb:107:in `require' 
    from C:/Users/Frank/Dropbox/DePaul/Year 2/Winter/IT 232/divdev232/config/application.rb:7:in `<top (required)>' 
    from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:88:in `require' 
    from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:88:in `block in server' 
    from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:85:in `tap' 
    from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:85:in `server' 
    from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:49:in `run_command!' 
    from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands.rb:18:in `<top (required)>' 
    from bin/rails:4:in `require' 
    from bin/rails:4:in `<main>' 

我在什么任何的意思只是困惑,或如何解决它,因为我我仍然对铁轨很熟悉。这里是我当前的Gemfile:

source 'https://rubygems.org' 

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 
gem 'rails', '~> 5.0.0', '>= 5.0.0.1' 

# Use sqlite3 as the database for Active Record 
gem 'sqlite3' 

# Use Puma as the app server 
gem 'puma', '~> 3.0' 

# Use SCSS for stylesheets 
gem 'sass-rails', '~> 5.0' 

# Use Uglifier as compressor for JavaScript assets 
gem 'uglifier', '>= 1.3.0' 

# Use CoffeeScript for .coffee assets and views 
gem 'coffee-rails', '~> 4.2' 

# See https://github.com/rails/execjs#readme for more supported runtimes 
# gem 'therubyracer', platforms: :ruby 

# Use jquery as the JavaScript library 
gem 'jquery-rails' 

# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks 
gem 'turbolinks', '~> 5' 

# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 
gem 'jbuilder', '~> 2.5' 

# Use Redis adapter to run Action Cable in production 
# gem 'redis', '~> 3.0' 

# Use ActiveModel has_secure_password 
gem 'bcrypt', '~> 3.1.7' 

# Use Capistrano for deployment 
# gem 'capistrano-rails', group: :development 

group :development, :test do 
# Call 'byebug' anywhere in the code to stop execution and get a debugger console 
gem 'byebug', platform: :mri 
end 

group :development do 
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code. 
gem 'web-console' 
end 

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem 
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] 

回答

1

这里是我的解决方案:

首先卸载bcrypt和bcrypt-ruby的运行这两个命令:

  1. gem uninstall bcryptgem uninstall bcrypt-ruby
  2. 与重新安装gem install bcrypt --platform=ruby
  3. 在您的Gemfile中写入gem 'bcrypt-ruby', '3.1.5', :require => 'bcrypt'

  4. 运行bundle install

+0

难道我只是在新行添加到我的Gemfile还是我替换当前bcrypt线 – Frank

+0

变更线的Gemfile和运行'捆绑安装' – Sajin

+0

遐,没有一个固定它 – Frank

1

更新的Gemfile到:

gem 'bcrypt-ruby', '3.1.1.rc1', :require => 'bcrypt' 
+0

这是否替换当前bcrypt行?: 宝石“bcrypt”,“〜> 3.1.7” – Frank

+0

是,尝试用我的代码 – puneet18

+0

来取代它,我仍然得到错误 – Frank