I just set up my laptop with Debian (via Knoppix - very easy, BTW) and
got Ruby 1.8.2 loaded via apt-get (and a few more libs and packages
that were required such as irb and libyaml-ruby - why isn't there a
Debian Ruby package that just includes most of this stuff? - sorry
differnt topic).
Next I downloaded and installed ruby-gems.
After this I tried using gem to install net-ssh and I got:
# gem install net-ssh
Attempting local installation of 'net-ssh'
Local gem file not found: net-ssh*.gem
Attempting remote installation of 'net-ssh'
Successfully installed net-ssh, version 0.1.0
Installing RDoc documentation for net-ssh-0.1.0...
Killed
What's with the 'Killed'?
I then tried installing session just to see if it might be a problem with
net-ssh:
# gem install session
Attempting local installation of 'session'
Local gem file not found: session*.gem
Attempting remote installation of 'session'
Successfully installed session, version 2.1.9
Installing RDoc documentation for session-2.1.9...
That seemed to work OK, but when I try to require 'session', it's not
found:
# irb
irb(main):001:0> require 'session'
LoadError: No such file to load -- session
from (irb):1:in `require'
from (irb):1
irb(main):002:0>
After this I tried using gem to install net-ssh and I got:
I then tried installing session just to see if it might be a problem with net-ssh:
# gem install session
Attempting local installation of 'session'
Local gem file not found: session*.gem
Attempting remote installation of 'session'
Successfully installed session, version 2.1.9
Installing RDoc documentation for session-2.1.9...
That seemed to work OK, but when I try to require 'session', it's not found:
# irb
irb(main):001:0> require 'session'
LoadError: No such file to load -- session
from (irb):1:in `require'
from (irb):1
irb(main):002:0>
With gems you need to
require 'rubygems'
before
require 'session'
for some reason.
I guess the point is, that this way rubygems is able to install a missing gem.
What I don't like as much is that I have to think whether I installed something as a gem or not. I'd rather my ruby installation would find a gem-installed file even without 'require "rubygems"' (although I might not have the additional service of installing/updating missing and/or outdated gems during runtime).
> I guess the point is, that this way rubygems is able to install a
> missing gem.
the reason is that rubygems uses require_gem to load a gem with a specific version, and that method is not built in.
What I don't like as much is that I have to think whether I installed something as a gem or not. I'd rather my ruby installation would find a gem-installed file even without 'require "rubygems"' (although I might not have the additional service of installing/updating missing and/or outdated gems during runtime).
see the latest announce. Something like setting RUBYOPT="rubygems" should be enough for you to get away ignoring if you're using gems or something else.
for some reason.
I guess the point is, that this way rubygems is able to install a
missing gem.
Oh, right. For some reason I thought that you didn't have to require
'rubygems' anymore.
What I don't like as much is that I have to think whether I installed
something as a gem or not. I'd rather my ruby installation would find a
gem-installed file even without 'require "rubygems"' (although I might
not have the additional service of installing/updating missing and/or
outdated gems during runtime).
Unfortuneatly, until rubygems is part of the Ruby distribution this will
probably be the case.
When running ruby you can say:
$ ruby -rubygems foo.rb
to have rubygems required before running your script (and you can create an
alias so that this gets done for you).
I just added "require 'rubygems'" to my .irbrc file.
Phil
···
Stephan Kämper <Stephan.Kaemper@Schleswig-Holstein.de> wrote: