MissingSourceFile:无法加载此类文件--net/scp

 筱冬瀦 发布于 2023-02-04 15:44

自从我的Rails(2.3.17)应用程序升级到Ruby 1.9.3后,我丢失了这个ssh.sftp.upload!方法,所以我正在尝试使用net-scp库,但是我似乎无法在Rails中使用它.然而,irb我可以要求文件正常,只是不在rails控制台.

me@app:~/myapp$ script/console myapp
Loading myapp environment (Rails 2.3.17)
>> require 'net/scp'
MissingSourceFile: cannot load such file -- net/scp
  from /path/to/myapp/shared/bundle/ruby/1.9.1/gems/activesupport-2.3.17/lib/active_support/dependencies.rb:184:in `require'
  from /path/to/myapp/shared/bundle/ruby/1.9.1/gems/activesupport-2.3.17/lib/active_support/dependencies.rb:184:in `require'
  from (irb):1
  from /home/me/.rvm/rubies/ruby-1.9.3-p448/bin/irb:16:in `
'

但这似乎有效:

>> require 'net/ssh'
=> false

这是我的相关内容 Gemfile.lock

$ cat Gemfile.lock | grep "net-scp" -n5
30-      nokogiri (>= 1.4.4)
31-      uuidtools (~> 2.1)
32-    builder (2.1.2)
33-    capistrano (2.14.2)
34-      highline
35:      net-scp (>= 1.0.0)
36-      net-sftp (>= 2.0.0)
37-      net-ssh (>= 2.0.14)
38-      net-ssh-gateway (>= 1.1.0)
39-    capistrano-ext (1.2.1)
40-      capistrano (>= 1.0.0)
--
106-    multi_xml (0.5.3)
107-    mysql (2.9.0)
108-    net-http-digest_auth (1.2.1)
109-    net-http-persistent (2.8)
110-    net-ldap (0.3.1)
111:    net-scp (1.1.0)
112-      net-ssh (>= 2.6.5)
113-    net-sftp (2.1.1)
114-      net-ssh (>= 2.6.5)
115-    net-ssh (2.7.0)
116-    net-ssh-gateway (1.2.0)

我该如何解决或绕过这个?

1 个回答
  • 显然它就像包含net-scp在内容中一样简单Gemfile,即使它包含在net-sshcapistrano.

    2023-02-04 15:45 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有