English 中文(简体)
无法装入此文件 -- -- 网/ ssh/ 认证/ 试剂/ 套件( LoadError)
原标题:cannot load such file -- net/ssh/authentication/agent/socket (LoadError)

如果我运行 rails s

/Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `require : cannot load such file -- net/ssh/authentication/agent/socket (LoadError)
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `block in require 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:236:in `load_dependency 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `require 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/net-ssh-2.5.0/lib/net/ssh/authentication/agent.rb:22:in `<top (required)> 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `require 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `block in require 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:236:in `load_dependency 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `require 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/net-ssh-2.5.0/lib/net/ssh/authentication/key_manager.rb:4:in `<top (required)> 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `require 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `block in require 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:236:in `load_dependency 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `require 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/net-ssh-2.5.0/lib/net/ssh/authentication/session.rb:4:in `<top (required)> 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `require 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `block in require 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:236:in `load_dependency 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `require 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/net-ssh-2.5.0/lib/net/ssh.rb:11:in `<top (required)> 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `require 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `block in require 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:236:in `load_dependency 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `require 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/net-ssh-gateway-1.1.0/lib/net/ssh/gateway.rb:2:in `<top (required)> 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `require 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `block in require 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:236:in `load_dependency 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `require 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.12.0/lib/capistrano/configuration/connections.rb:2:in `<top (required)> 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `require 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `block in require 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:236:in `load_dependency 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `require 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.12.0/lib/capistrano/configuration.rb:5:in `<top (required)> 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `require 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `block in require 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:236:in `load_dependency 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `require 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.12.0/lib/capistrano.rb:3:in `<top (required)> 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0@global/gems/bundler-1.1.3/lib/bundler/runtime.rb:68:in `require 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0@global/gems/bundler-1.1.3/lib/bundler/runtime.rb:68:in `block (2 levels) in require 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0@global/gems/bundler-1.1.3/lib/bundler/runtime.rb:66:in `each 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0@global/gems/bundler-1.1.3/lib/bundler/runtime.rb:66:in `block in require 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0@global/gems/bundler-1.1.3/lib/bundler/runtime.rb:55:in `each 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0@global/gems/bundler-1.1.3/lib/bundler/runtime.rb:55:in `require 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0@global/gems/bundler-1.1.3/lib/bundler.rb:119:in `require 
    from /Users/frankie/projects/unitedfreelance/config/application.rb:13:in `<top (required)> 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.0/lib/rails/commands.rb:53:in `require 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.0/lib/rails/commands.rb:53:in `block in <top (required)> 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.0/lib/rails/commands.rb:50:in `tap 
    from /Users/frankie/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.0/lib/rails/commands.rb:50:in `<top (required)> 
    from script/rails:6:in `require 
    from script/rails:6:in `<main> 

< 强 > Gemfile

source  http://rubygems.org 

gem  rails ,  3.2.0 

# Bundle edge Rails instead:
# gem  rails ,     :git =>  git://github.com/rails/rails.git 

gem  pg 
gem "cocoon"
gem  nokogiri 
gem  hpricot 
gem "formtastic", "~> 2.1.1"
gem "activeadmin", "~> 0.4.4"
gem  omniauth 
gem  country-select 
gem "paperclip", "~> 3.0"
gem  cancan 
gem  rolify 

gem "meta_search",     >= 1.1.0.pre 
gem  bourbon , "~> 2.0.0.rc1"
gem "rails-boilerplate"
gem  geocoder 
gem  httparty 
gem  hashie 
gem  will_paginate , :git => "git://github.com/mislav/will_paginate.git"
gem  thinking-sphinx ,  2.0.10 
gem  sanitize 
gem  feedzirra 
gem "crypt19", "~> 1.2.1"
gem  wicked_pdf 
gem  forem , :git => "git://github.com/radar/forem.git"
gem  thin 
gem  whenever , :require => false
gem "ckeditor", "3.7.1"
# gem  sisow 

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem  sass-rails ,    ~> 3.2.3 
  gem  coffee-rails ,  ~> 3.2.1 
  gem  uglifier ,  >= 1.0.3 
end

gem  haml-rails  
gem  jquery-rails 

group :development do
    gem  ruby_parser 
end

# To use ActiveModel has_secure_password
# gem  bcrypt-ruby ,  ~> 3.0.0 

# Use unicorn as the web server
gem  unicorn 

# Deploy with Capistrano
gem  capistrano 

# To use debugger
# gem  ruby-debug19 , :require =>  ruby-debug 

一秒钟它工作, 下一秒它没有。

I stopped working after I tried to fix the CKeditor integration following this guide: https://github.com/galetahub/ckeditor

<强 > 更新

发生这一错误是因为我使用Capistrano, 宝石需要 net- ssh net- ssh 宝石是从2.4 - & gt; 2. 5. 0上更新的,导致问题。

更新我的Gemfile:

gem  rails ,  3.2.0 
gem "net-ssh", "~> 2.4.0"

然后运行 $$ 宝石更新 net-ssh

铁路命令的错误已经消失。 还没有使用 Capistrano 来进行部署, 所以无法说明是否使用部署出现错误 。

<强 > 更新2

Capistrano 无法部署, 因而混乱了 。 使用 < code> cap 部署 时, 我收到您在文章开头看到的错误信息 。

<强 > 更新3

Upgraded net-ssh to 2.5.1 because in the comments someone mentioned 2.5.0 was broken. After the upgrade the require issue was solved, however, Capistrano still will not deploy.

[deploy:update_code] exception while rolling back: Capistrano::ConnectionError, connection failed for: 85.xxx.xxx.xxx (NameError: uninitialized constant Net::SSH::KnownHosts::SUPPORTED_TYPE)
connection failed for: 85.xxx.xxx.xxx (NameError: uninitialized constant Net::SSH::KnownHosts::SUPPORTED_TYPE)

<强>更新4(加工作变通)

在下文的评论中张贴了一个变通办法。

  • Keep your net-ssh version on 2.5.1
  • Before you deploy with Capistrano, delete the line with your server from the ~/.ssh/known_hosts file
  • You can now deploy once. Repeat before every deploy.
问题回答

向2.4.0的降格允许 rails s 工作,但 cap 命令失败 。

通过发布此命令确保您使用 2.5.1 :

bundle update net-ssh

您也可以在您的 Gem 文件中添加此内容 :

gem "net-ssh", "~> 2.5.1"

我认为这是Capistrano宝石的一个错误。我刚刚为我的项目执行了捆绑更新, 并且有同样的错误, 但如果我把Capistrano从Gemfile删除, 一切都会成功的。

UPD:Capistrano宝石使用网状宝石, 这是一小时前更新的。

Gem 2.5.2版本 解决这个问题对我来说。





相关问题
rails collection_select vs. select

collection_select and select Rails helpers: Which one should I use? I can t see a difference in both ways. Both helpers take a collection and generates options tags inside a select tag. Is there a ...

SSL slowness in EC2

We ve deployed our rails app to EC2. In our setup, we have two proxies on small instances behind round-robin DNS. These run nginx load balancers for a dynamically growing and shrinking farm of web ...

Auth-code with A-Za-z0-9 to use in an URL parameter

As part of a web application I need an auth-code to pass as a URL parameter. I am currently using (in Rails) : Digest::SHA1.hexdigest((object_id + rand(255)).to_s) Which provides long strings like : ...

RubyCAS-Client question: Rails

I ve installed RubyCAS-Client version 2.1.0 as a plugin within a rails app. It s working, but I d like to remove the ?ticket= in the url. Is this possible?

activerecord has_many :through find with one sql call

I have a these 3 models: class User < ActiveRecord::Base has_many :permissions, :dependent => :destroy has_many :roles, :through => :permissions end class Permission < ActiveRecord::...

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

Text Editor for Ruby-on-Rails

guys which text editor is good for Rubyonrails? i m using Windows and i was using E-Texteditor but its not free n its expired now can anyone plese tell me any free texteditor? n which one is best an ...

How to get SQL queries for each user where env is production

I’m developing an application dedicated to generate statistical reports, I would like that user after saving their stat report they save sql queries too. To do that I wrote the following module: ...

热门标签