views:

1760

answers:

3

$> jruby -v

jruby 1.1.4 (ruby 1.8.6 patchlevel 114) (2008-08-28 rev 7570) [x86-java]

$> gem install rspec

JRuby limited openss loaded. gem install jruby-openssl for full support.
http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
Succesfully installed rspec-1.1.12
1 gem installed
Installing ri documentation for rspec-1.1.12...
Installing RDoc documentation for rspec-1.1.12...

$> spec --help

.../jruby/1.1.4/lib/ruby/site_ruby/1.8/rubygems.rb:578:in `report_activate_error': Could not find RubyGem cucumber (>= 0.1.13) (Gem::LoadError)

from .../jruby/1.1.4/lib/ruby/site_ruby/1.8/rubygems.rb:134: in activate'
from .../jruby/1.1.4/lib/ruby/site_ruby/1.8/rubygems.rb:158: in
activate'
from .../jruby/1.1.4/lib/ruby/site_ruby/1.8/rubygems.rb:157: in each
from .../jruby/1.1.4/lib/ruby/site_ruby/1.8/rubygems.rb:157: in activate'
from .../jruby/1.1.4/lib/ruby/site_ruby/1.8/rubygems.rb:49: in
gem'
from .../jruby/1.1.4/bin/spec:18

$> gem install cucumber

(installed cucumber-0.1.16 and dependencies term-ansicolor-1.0.3, polyglot-0.2.5, treettop-1.2.4, diff-lcs-1.1.2)

$> spec --help

.../jruby/1.1.4/lib/ruby/site_ruby/1.8/rubygems.rb:578:in `report_activate_error': Could not find RubyGem hoe (>= 1.8.0) (Gem::LoadError)

from .../jruby/1.1.4/lib/ruby/site_ruby/1.8/rubygems.rb:134: in activate'
from .../jruby/1.1.4/lib/ruby/site_ruby/1.8/rubygems.rb:158: in
activate'
from .../jruby/1.1.4/lib/ruby/site_ruby/1.8/rubygems.rb:157: in each'
from .../jruby/1.1.4/lib/ruby/site_ruby/1.8/rubygems.rb:157: in
activate'
from .../jruby/1.1.4/lib/ruby/site_ruby/1.8/rubygems.rb:158: in activate'
from .../jruby/1.1.4/lib/ruby/site_ruby/1.8/rubygems.rb:157: in
each'
from .../jruby/1.1.4/lib/ruby/site_ruby/1.8/rubygems.rb:157: in activate'
from .../jruby/1.1.4/lib/ruby/site_ruby/1.8/rubygems.rb:158: in
activate'
from .../jruby/1.1.4/lib/ruby/site_ruby/1.8/rubygems.rb:157: in each'
from .../jruby/1.1.4/lib/ruby/site_ruby/1.8/rubygems.rb:157: in
activate'
from .../jruby/1.1.4/lib/ruby/site_ruby/1.8/rubygems.rb:158: in activate'
from .../jruby/1.1.4/lib/ruby/site_ruby/1.8/rubygems.rb:157: in
each'
from .../jruby/1.1.4/lib/ruby/site_ruby/1.8/rubygems.rb:157: in activate'
from .../jruby/1.1.4/lib/ruby/site_ruby/1.8/rubygems.rb:49: in
gem'
from .../jruby/1.1.4/bin/spec:18

$> gem install hoe

(installed hoe-1.10.0 and dependency rubyforge-1.0.3)

$> spec --help

Usage: spec (FILE|DIRECTORY|GLOB)+ [options]
(etc., etc., etc.)

Seems like "gem install rspec" does not install the dependencies.
Not sure if it is exclusive to JRuby on Windows... other OSes not tested.

A: 

Does gem install rspec --include-dependencies help? It wasn't default until a later version of Rubygems, perhaps jruby isn't quite up to snuff.

August Lilleaas
"gem install rspec --include-dependencies" did not seem to help =(
Denis
A: 

Works for me with JRuby trunk:

$ jruby -v
jruby 1.3.0 (ruby 1.8.6p287) (2009-03-15 r9415) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_07) [x86_64-java]
$ jruby -S gem install rspec
**************************************************

  Thank you for installing rspec-1.2.2

  Please be sure to read History.rdoc and Upgrade.rdoc
  for useful information about this release.

**************************************************
Successfully installed rspec-1.2.2
1 gem installed
Installing ri documentation for rspec-1.2.2...
Installing RDoc documentation for rspec-1.2.2...
Could not find main page README.rdoc
Could not find main page README.rdoc
Could not find main page README.rdoc
Could not find main page README.rdoc
$ jruby -S spec --help
Usage: spec (FILE|DIRECTORY|GLOB)+ [options]
   ...
Kjetil Ødegaard
did you have the dependecies already installed before running "gem install rspec"?
Denis
+3  A: 

Did you try:

gem install rspec --development

Bob Aman
Aha! Adding the "--development" switch did the trick.Is it normal for "gem install foo" to only install foo without any of it's dependencies?
Denis
There are two types of gem dependencies -- development and runtime dependencies. Older versions of RubyGems that didn't distinguish between them will install all dependencies by default. Current versions only install runtime dependencies unless the "--development" is set. The cucumber and hoe gems are development dependencies in this case, since neither are strictly necessary to run RSpec.
Bob Aman