由于Nokogiri而错误装载Devise Gem

时间:2015-07-25 03:59:51

标签: ruby-on-rails ruby ruby-on-rails-3 devise gem

我在加载设计gem时遇到错误:

Boot Error

Something went wrong while loading config.ru

Bundler::GemNotFound: Could not find gem 'devise (~> 3.5.1) ruby' in any of the gem sources listed in your Gemfile or available on this
     

机。

/Library/Ruby/Gems/2.0.0/gems/bundler-1.10.5/lib/bundler/resolver.rb:347:in
     

block in verify_gemfile_dependencies_are_found!' /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.5/lib/bundler/resolver.rb:325:in 每个”   /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.5/lib/bundler/resolver.rb:325:in   verify_gemfile_dependencies_are_found!' /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.5/lib/bundler/resolver.rb:198:in 开始”   /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.5/lib/bundler/resolver.rb:182:in   resolve' /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.5/lib/bundler/definition.rb:200:in 解决”   /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.5/lib/bundler/definition.rb:140:in   specs' /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.5/lib/bundler/definition.rb:185:in specs_for”   /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.5/lib/bundler/definition.rb:174:in   requested_specs' /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.5/lib/bundler/environment.rb:18:in requested_specs'   /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.5/lib/bundler/runtime.rb:13:in   setup' /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.5/lib/bundler.rb:127:in 设定”   /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.5/lib/bundler.rb:134:in   require' /Users/Pabi/code/fwitter/config/environment.rb:2:in”   /Users/Pabi/code/fwitter/app/controllers/application_controller.rb:3:in   require_relative' /Users/Pabi/code/fwitter/app/controllers/application_controller.rb:3:in 'config.ru:1:in require_relative' config.ru:1:in 阻止在inner_app中   /Library/Ruby/Gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in   instance_eval' /Library/Ruby/Gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in 初始化'config.ru:1:new' config.ru:1:in inner_app'   /Library/Ruby/Gems/2.0.0/gems/shotgun-0.9/lib/shotgun/loader.rb:112:in   eval' /Library/Ruby/Gems/2.0.0/gems/shotgun-0.9/lib/shotgun/loader.rb:112:in inner_app”   /Library/Ruby/Gems/2.0.0/gems/shotgun-0.9/lib/shotgun/loader.rb:102:in   assemble_app' /Library/Ruby/Gems/2.0.0/gems/shotgun-0.9/lib/shotgun/loader.rb:86:in proceed_as_child”   /Library/Ruby/Gems/2.0.0/gems/shotgun-0.9/lib/shotgun/loader.rb:31:in   call!' /Library/Ruby/Gems/2.0.0/gems/shotgun-0.9/lib/shotgun/loader.rb:18:in 称之为”   /Library/Ruby/Gems/2.0.0/gems/shotgun-0.9/lib/shotgun/favicon.rb:12:in   call' /Library/Ruby/Gems/2.0.0/gems/shotgun-0.9/lib/shotgun/static.rb:14:in 称之为”   /Library/Ruby/Gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:138:in   call' /Library/Ruby/Gems/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in 服务”   /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/webrick/httpserver.rb:138:in   service' /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/webrick/httpserver.rb:94:in 运行”   /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/webrick/server.rb:295:in   `start in start_thread'

这就是我在我的宝石文件中所拥有的:

source "https://rubygems.org"

gem "sinatra"
gem "activerecord"
gem "sinatra-activerecord"
gem "rake"
gem 'devise', '~> 3.5.1'
gem "rack-ssl-enforcer"
gem "haml"


group :development do
  gem "pry"
  gem "shotgun"
  gem "tux"
  gem "sqlite3"
end

我不知道它会是什么。我做了捆绑安装,并安装了设计宝石。当我删除设计一切正常。

3 个答案:

答案 0 :(得分:3)

您是否尝试过使用gem'depaise'?如:

gem 'devise'

Ver 3.5.1是最新版本(截至本文撰写时),因此默认情况下应该安装最新版本(除非你有理由这样做我错过了)。

答案 1 :(得分:1)

config.ru是错误的 Bundler无法找到宝石设计3.5.1 因此,请尝试运行bundle update

答案 2 :(得分:0)

修正:

问题在于安装了devise的一个依赖项:nokogiri。

我跟着this guide安装了nokogiri和故障排除,现在已经解决了。