From: Carl Youngblood Date: 2004-10-09T04:43:30+09:00 Subject: Re: net-ssh help Thanks for the tips. I'm not in front of my mac now, but my ruby setup was installed from CVS about 6 months ago and has accumulated a lot of cruft over time. I've been wanting to clean things up for a while now, so I think maybe I'll kill it and start from scratch again, this time with a stable release. On Fri, 8 Oct 2004 23:18:44 +0900, Jamis Buck wrote: > Carl Youngblood wrote: > > Hello, > > I'm trying to use net-ssh for the first time and having some trouble. > > Any help would be greatly appreciated. > > > > In a simple script I'm running with the first few lines like so: > > > > Net::SSH.start('myhost, 'user', 'pass') do |session| > > Net::SSH::SFTP.session(session) do |sftp| > > if not sftp.put_file(domainfile, "blocks/#{domainfile}") > > raise "Couldn't upload domain file" > > end > > if not sftp.put_file(actionfile, "blocks/#{actionfile}") > > raise "Couldn't upload action file" > > end > > end > > end > > > > I get the following error: > > > > could not load public key file '/Users/carl/.ssh/id_rsa.pub' > > (uninitialized constant OpenSSL::PKey::PKey::Base64 [NameError]) > > Carl, > > A few questions: what version of Ruby are you using? Do you get a > backtrace with the error? If so, could you post it? > > The problem, it looks like, is that the Base64 library cannot be found, > which is worrisome, since it's part of the standard library. If that > can't be found, then either (a) you're using a pre-1.8 version of Ruby, > or (b) you're Ruby installation is incorrect or incomplete. > > > > > I'm wondering why it fails trying to load the public key file when A) > > it's there and it's readable by the current user, and B) I've already > > specified the username and password explicitly, so it doesn't matter > > if it succeeds in reading the public key file. > > The failure isn't because the file couldn't be opened, its because the > Base64 module couldn't be found while the key was being processed. > > > > > I figured maybe there was something special in rb-keygen beyond what > > was in ssh-keygen, so I ran it, but I got the following error when I > > did that: > > > > /usr/local/bin/rb-keygen:25:in `require': No such file to load -- > > net/ssh/transport/buffer (LoadError) > > from /usr/local/bin/rb-keygen:25 > > This seems to indicate a borked installation as well... perhaps your > Ruby load paths are wrong? Try this: > > ruby -e 'p $:' > > Could you send me the paths that it emits? Also: > > ruby -rnet/ssh -e 'p $"' > > Could you send me that output of that command? > > - Jamis