[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

gem installations getting Killed

ptkwt

11/1/2004 5:57:00 AM

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>



Phil



3 Answers

Stephan Kämper

11/1/2004 8:19:00 AM

0

Phil Tomson wrote:
> ...
> Next I downloaded and installed ruby-gems.
>
> 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).

Happy rubying

Stephan

gabriele renzi

11/1/2004 9:36:00 AM

0

Stephan Kämper ha scritto:


> 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.

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.

ptkwt

11/1/2004 5:24:00 PM

0

In article <2um9rbF2d68u8U1@uni-berlin.de>,
Stephan Kämper <Stephan.Kaemper@Schleswig-Holstein.de> wrote:
>Phil Tomson wrote:
> > ...
>
>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.

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