Ruby Forum JRuby > jruby -S gem which rails fails ?

Posted by Mike Herrick (mherrick66)
on 06.05.2008 18:42
(Received via mailing list)
Random observation on 2 machines today (running jruby 1.1.1).

gem which works for all gems except rails?

Mike


mike@mike-laptop:~/opt/jruby-1.1.1/lib/ruby/gems/1.8/gems$ ll
total 88K
drwxr-xr-x  3 mike mike 4.0K 2008-04-22 12:26 sources-0.0.1
drwxr-xr-x 11 mike mike 4.0K 2008-04-30 17:18 rspec-1.1.3
drwxr-xr-x  6 mike mike 4.0K 2008-04-30 17:18 rake-0.8.1
drwxr-xr-x  3 mike mike 4.0K 2008-04-30 17:22 activesupport-2.0.2
drwxr-xr-x  5 mike mike 4.0K 2008-04-30 17:22 activerecord-2.0.2
drwxr-xr-x  4 mike mike 4.0K 2008-04-30 17:22 actionpack-2.0.2
drwxr-xr-x  4 mike mike 4.0K 2008-04-30 17:22 actionmailer-2.0.2
drwxr-xr-x  4 mike mike 4.0K 2008-04-30 17:22 activeresource-2.0.2
drwxr-xr-x 11 mike mike 4.0K 2008-04-30 17:22 rails-2.0.2
drwxr-xr-x  4 mike mike 4.0K 2008-04-30 17:22 jruby-openssl-0.2.2
drwxr-xr-x  5 mike mike 4.0K 2008-04-30 17:22 rubyforge-0.4.5
drwxr-xr-x  5 mike mike 4.0K 2008-04-30 17:22 hoe-1.5.1
drwxr-xr-x  4 mike mike 4.0K 2008-04-30 17:22 chronic-0.2.3
drwxr-xr-x  6 mike mike 4.0K 2008-04-30 17:22 hpricot-0.6-java
drwxr-xr-x  5 mike mike 4.0K 2008-04-30 17:22 mechanize-0.7.5
drwxr-xr-x  3 mike mike 4.0K 2008-04-30 17:22 rest-open-uri-1.0.0
drwxr-xr-x  5 mike mike 4.0K 2008-04-30 17:22 postgres-pr-0.4.0
drwxr-xr-x  5 mike mike 4.0K 2008-04-30 17:22 ci_reporter-1.5.1
drwxr-xr-x  6 mike mike 4.0K 2008-04-30 17:22 builder-2.1.2
drwxr-xr-x  6 mike mike 4.0K 2008-04-30 17:23 hpricot-0.6.161-java
drwxr-xr-x  7 mike mike 4.0K 2008-04-30 17:25 warbler-0.9.5
drwxr-xr-x  4 mike mike 4.0K 2008-05-02 15:19 jruby-openssl-0.2.3
mike@mike-laptop:~/opt/jruby-1.1.1/lib/ruby/gems/1.8/gems$ jruby -S gem
which mechanize
(checking gem mechanize-0.7.5 for mechanize)
/home/mike/opt/jruby-1.1.1/lib/ruby/gems/1.8/gems/mechanize-0.7.5/lib/mechanize.rb
mike@mike-laptop:~/opt/jruby-1.1.1/lib/ruby/gems/1.8/gems$ jruby -S gem
which hoe
(checking gem hoe-1.5.1 for hoe)
/home/mike/opt/jruby-1.1.1/lib/ruby/gems/1.8/gems/hoe-1.5.1/lib/hoe.rb
mike@mike-laptop:~/opt/jruby-1.1.1/lib/ruby/gems/1.8/gems$ jruby -S gem
which rails
Can't find rails

--
Mike Herrick
Program Manager, Collaborative Software Initiative
mike@csinitiative.com
http://www.csinitiative.com

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Posted by Vladimir Sizikov (Guest)
on 06.05.2008 21:45
(Received via mailing list)
Hi Mike,

On Tue, May 6, 2008 at 6:33 PM, Mike Herrick <mike@csinitiative.com> 
wrote:
> Random observation on 2 machines today (running jruby 1.1.1).
>
>  gem which works for all gems except rails?

I don't think that gem which means what you think it means. It doesn't
print the list  of gems. According to the rubygems User's Guide:

"The gemwhich script works much like the unix shell 'which' command.
Given a include file reference, it will locate that file in ruby
libraries and gem repositories and display the file path for the
file."

So, even for MRI, gem which rspec will not return anything, because
the main file is spec.rb, not rspec. But gem which spec will report
the rspec.rb.

With rails, the same thing, there is no rails.rb in rails gem, hence
nothing is returned.

Thanks,
  --Vladimir

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Posted by Mike Herrick (mherrick66)
on 06.05.2008 23:25
(Received via mailing list)
Aha - thanks a lot Vladimir.

Mike


Vladimir Sizikov wrote:
> "The gemwhich script works much like the unix shell 'which' command.
> 
> Thanks,
>   --Vladimir
> 
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
> 
>     http://xircles.codehaus.org/manage_email
> 
> 

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email