Bugs item #26792, was opened at 2009-07-29 16:59
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=575&aid=26792&group_id=126

Category: None
Group: v1.3.x
>Status: Closed
Resolution: Accepted
Priority: 3
Submitted By: Roger Pack (rogerdpack)
Assigned to: Evan Phoenix (evan)
Summary: uses gem even when an install fails

Initial Comment:
Appears that in 1.9, at least

if you install a gem, and the installation fails

then you run 
require 'gemname'
it still loads it--in its very broken state.

At least that's about what I figure from scratching my head at this 
circumstance:

C:\dev\ruby\downloads\ruby-debug\pkg>gem search linecache -b

*** LOCAL GEMS ***

mark-moseley-linecache (0.5.2)
# note the lack of linecache -- removing mark-moseley-linecache seems to not 
affect the results, either

*** REMOTE GEMS ***

linecache (0.43)
mark-moseley-linecache (0.5.2)

C:\dev\ruby\downloads\ruby-debug\pkg>gem install linecache
Building native extensions.  This could take a while...
ERROR:  Error installing linecache:
        ERROR: Failed to build gem native extension.

c:/installs/ruby_trunk_installed/bin/ruby.exe extconf.rb
Can't handle 1.9.x yet
*** extconf.rb failed ***
...

C:\dev\ruby\downloads\ruby-debug\pkg>gem search linecache

*** LOCAL GEMS ***

mark-moseley-linecache (0.5.2)

C:\dev\ruby\downloads\ruby-debug\pkg>irb
irb(main):001:0> require 'ruby-debug'
LoadError: no such file to load -- 
c:/installs/ruby_trunk_installed/lib/ruby/gems/1.9.1/gems/linecache-0.43/lib/../lib/trace_nums
 # note that it's using the linecache-0.43 that just failed
        from 
c:/installs/ruby_trunk_installed/lib/ruby/gems/1.9.1/gems/linecache-0.43/lib/tracelines.rb:12:in
 `require'
        from 
c:/installs/ruby_trunk_installed/lib/ruby/gems/1.9.1/gems/linecache-0.43/lib/tracelines.rb:12:in
 `rescue in <module:TraceLineNumbers>'
        from 
c:/installs/ruby_trunk_installed/lib/ruby/gems/1.9.1/gems/linecache-0.43/lib/tracelines.rb:8:in
 `<module:TraceLineNumbers>'
        from 
c:/installs/ruby_trunk_installed/lib/ruby/gems/1.9.1/gems/linecache-0.43/lib/tracelines.rb:6:in
 `<top (required)>'
        from 
c:/installs/ruby_trunk_installed/lib/ruby/gems/1.9.1/gems/linecache-0.43/lib/linecache.rb:63:in
 `require'
        from 
c:/installs/ruby_trunk_installed/lib/ruby/gems/1.9.1/gems/linecache-0.43/lib/linecache.rb:63:in
 `<top (required)>'
        from 
c:/installs/ruby_trunk_installed/lib/ruby/gems/1.9.1/gems/mark-moseley-ruby-debug-base-0.11.6/lib/ruby-debug-base.rb:3:in
 `require'
        from 
c:/installs/ruby_trunk_installed/lib/ruby/gems/1.9.1/gems/mark-moseley-ruby-debug-base-0.11.6/lib/ruby-debug-base.rb:3:in
 `<top (required)>'
        from 
c:/installs/ruby_trunk_installed/lib/ruby/gems/1.9.1/gems/ruby-debug-0.11/cli/ruby-debug.rb:5:in
 `require'
        from 
c:/installs/ruby_trunk_installed/lib/ruby/gems/1.9.1/gems/ruby-debug-0.11/cli/ruby-debug.rb:5:in
 `<top (required)>'
        from (irb):1:in `require'
        from (irb):1
        from c:/installs/ruby_trunk_installed/bin/irb.bat:20:in `<main>'

Thanks!

[gem v 1.3.5, ruby 1.9.2 trunk]

----------------------------------------------------------------------

Comment By: Ryan Davis (zenspider)
Date: 2010-11-12 14:46

Message:
This ticket has been deemed stale and we're closing it in order to catch up 
with our ticket list. If you think it is still valid, please reopen.

----------------------------------------------------------------------

Comment By: James Tucker (raggi)
Date: 2010-07-13 08:33

Message:
`gem list` cannot reproduce the issue.

It's gem_prelude requires not using the installed spec list that's the problem.

Assigning to Evan.

----------------------------------------------------------------------

Comment By: Roger Pack (rogerdpack)
Date: 2010-02-09 07:56

Message:
It doesn't show up as a gem list, however it still gets
assigned to the load path thanks to gem prelude.

How to reproduce:

c:\dev_old\digitalarchive_trunk>gem install linecache
Building native extensions.  This could take a while...
ERROR:  Error installing linecache:
        ERROR: Failed to build gem native extension.

...
c:\dev_old\digitalarchive_trunk>gem search linecache

*** LOCAL GEMS ***


c:\dev_old\digitalarchive_trunk>gem which linecache
E:/installs/ruby191p376/lib/ruby/gems/1.9.1/gems/linecache-0.43/lib/linecache.rb

(and you can require it--require 'linecache' even though the
install failed, which was unexpected to me since 1.8 doesn't
do this).
-r

----------------------------------------------------------------------

Comment By: Eric Hodel (drbrain)
Date: 2010-02-08 21:38

Message:
I believe this was fixed prior to 1.3.5 as 1.8 and 1.9.2 trunk give me the same:

$ ruby19 -Ilib bin/gem install mysql -i ~/tmp/gems

mysql 2.8.1 is 100% verified 1.9
Update http://isitruby19.com/mysql with your experiences!

Building native extensions.  This could take a while...
ERROR:  Error installing mysql:
        ERROR: Failed to build gem native extension.
[...]
$ GEM_HOME=~/tmp/gems GEM_PATH=~/tmp/gems ruby19 -Ilib bin/gem list

*** LOCAL GEMS ***


$

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=575&aid=26792&group_id=126
_______________________________________________
Rubygems-developers mailing list
http://rubyforge.org/projects/rubygems
Rubygems-developers@rubyforge.org
http://rubyforge.org/mailman/listinfo/rubygems-developers

Reply via email to