Gems (1.3.0) not visible from ruby (1.8.7)

Hi,

I’m trying to sftp into another server using net-sftp, but the gems I
install are not visible to ruby interpreter.

I’ve installed the net-sftp gem, and it shows fine in gem listing (see
below), but when I try to run a script, the library is not found (see
below).

Any help would be highly appreciated!

Cheers, Joni

E.g. my script file begins with:

require ‘net/sftp’

gem list

*** LOCAL GEMS ***

builder (2.1.2)
linecache (0.43)
net-scp (1.0.1)
net-sftp (2.0.1)
net-ssh (2.0.4)
net-ssh-gateway (1.0.0)
net-ssh-multi (1.0.0)
ruby-debug-base (0.10.2, 0.10.0)
rubygems-update (1.3.0)

ruby myscript.rb
myscript.rb:1:in `require’: no such file to load – net/sftp (Loa
dError)
from myscript.rb:1

gem environment
D:\dev\engineerize\Reaper\lib>d:\ruby\ruby1.8.7\bin\gem environment
RubyGems Environment:

  • RUBYGEMS VERSION: 1.3.0
  • RUBY VERSION: 1.8.7 (2008-08-11 patchlevel 72) [i386-mswin32]
  • INSTALLATION DIRECTORY: D:/ruby/ruby1.8.7/lib/ruby/gems/1.8
  • RUBY EXECUTABLE: D:/ruby/ruby1.8.7/bin/ruby.exe
  • EXECUTABLE DIRECTORY: D:/ruby/ruby1.8.7/bin
  • RUBYGEMS PLATFORMS:
    • ruby
    • x86-mswin32-60
  • GEM PATHS:
    • D:/ruby/ruby1.8.7/lib/ruby/gems/1.8
    • D:/MyDocuments/.gem/ruby/1.8
  • GEM CONFIGURATION:
    • :update_sources => true
    • :verbose => true
    • :benchmark => false
    • :backtrace => false
    • :bulk_threshold => 1000
  • REMOTE SOURCES:

On Mon, Oct 20, 2008 at 10:49 AM, Joni N. [email protected] wrote:

Cheers, Joni

E.g. my script file begins with:

require ‘net/sftp’

It should begin with

require “rubygems”

On Mon, 20 Oct 2008 09:49:04 -0500, Joni N. wrote:

builder (2.1.2)
myscript.rb:1:in `require’: no such file to load – net/sftp (Loa
dError)
from myscript.rb:1

You need to
require ‘rubygems’
first.

–Ken

Thanks, Ken and Gregory, that worked like a dream! I somehow missed the
bit in the docs…

Cheers,

Joni
n00b :slight_smile: