Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Gem.path is undefined when rack1.9.1 gems:unpack

#3755

config/environment.rb:

  config.gem "thoughtbot-clearance",
   :lib     => 'clearance',
   :source  => 'http://gems.github.com',
   :version => '0.8.2'
   $> rake1.9.1 gems:install

works fine - it installs clearance into ~/.gem , but

   $> rake1.9.1 gems:unpack

fails with error:

$ rake1.9.1 gems:unpack
(in /home/dp/rails/web )
ERROR:  While executing gem ... (NoMethodError)
    undefined method `path' for Gem:Module
$

ruby-debug says, that Gem.path became undefined on line

activesupport-2.3.5/lib/active_support/dependencies.rb:437
435         # return constants from from_mod's parents.
436         begin
437           return parent.const_missing(const_name)
438         rescue NameError => e

Some lines before, at line 423 Gem.path is correct ( ["/home/dp/.gem/ruby/1.9.1", "/var/lib/gems/1.9.1"] )
but search_for_file returns nil

423       file_path = search_for_file(path_suffix)

But if I do unpack by gem command - everything OK:

$ ls -dl thoughtbot-clearance-0.8.2
ls: cannot access thoughtbot-clearance-0.8.2: No such file or directory
$ gem unpack thoughtbot-clearance
Unpacked gem: '/home/dp/thoughtbot-clearance-0.8.2'
$ ls -dl thoughtbot-clearance-0.8.2
drwxr-xr-x 8 dp dp 4096 2010-01-20 17:02 thoughtbot-clearance-0.8.2
$

Reported by dp · January 20th, 2010 @ 04:15 PM

State: stale
Milestone: 2.3.10
Assigned to: nobody
Importance: Low

Activity

  1. Tyler Rick
    Tyler Rick
    • Title changed from Gem.path is nil when rack1.9.1 gems:unpack to Gem.path is undefined when rack1.9.1 gems:unpack

    March 9th, 2010 @ 12:21 AM

  2. Tyler Rick
    Tyler Rick

    I ran into the same problem. Attached is the patch I used to work around it (invoking gem command directly, like you did).

    Then I ran into the same problem with rake rails:freeze:gems. Here was my workaround for that:

    --- /var/lib/gems/1.9.1/gems/rails-2.3.5.orig/lib/tasks/framework.rake   2010-03-08 16:06:40.000000000 -0800
    +++ /var/lib/gems/1.9.1/gems/rails-2.3.5/lib/tasks/framework.rake   2010-03-08 16:35:25.000000000 -0800
    @@ -24,11 +24,18 @@
           begin
             chdir("vendor/rails") do
               rails.dependencies.select { |g| deps.include? g.name }.each do |g|
    -            Gem::GemRunner.new.run(["unpack", g.name, "--version", g.version_requirements.to_s])
    +            #Gem::GemRunner.new.run(["unpack", g.name, "--version", g.version_requirements.to_s])
    +            command = ['gem', "unpack", g.name, "--version", g.version_requirements.to_s].map{|a| a.gsub(/= /, '=')}.join(' ')
    +            puts command
    +            system command
    +
                 mv(Dir.glob("#{g.name}*").first, g.name)
               end
     
    -          Gem::GemRunner.new.run(["unpack", "rails", "--version", "=#{version}"])
    +          #Gem::GemRunner.new.run(["unpack", "rails", "--version", "=#{version}"])
    +          command = ['gem', "unpack", 'rails', "--version", version.to_s].map{|a| a.gsub(/= /, '=')}.join(' ')
    +          puts command
    +          system command
               FileUtils.mv(Dir.glob("rails*").first, "railties")
             end
           rescue Exception
    

    March 9th, 2010 @ 12:35 AM

  3. Yehuda Katz (wycats)
  4. Rizwan Reza
    Rizwan Reza
    • Tag changed from rake gems activesupport to rake gems activesupport, bugmash

    May 16th, 2010 @ 02:41 AM

  5. Jeremy Kemper
    Jeremy Kemper
    • Milestone changed from 2.3.6 to 2.3.7

    May 23rd, 2010 @ 05:54 PM

  6. Jeremy Kemper
    Jeremy Kemper
    • Milestone changed from 2.3.7 to 2.3.8

    May 24th, 2010 @ 09:40 AM

  7. Jeremy Kemper
    Jeremy Kemper
    • Milestone changed from 2.3.8 to 2.3.9

    May 25th, 2010 @ 11:45 PM

  8. Jeremy Kemper
    Jeremy Kemper
    • Milestone changed from 2.3.9 to 2.3.10
    • Importance changed from to Low

    August 30th, 2010 @ 02:28 AM

  9. Santiago Pastorino
    Santiago Pastorino
    • State changed from new to open

    This issue has been automatically marked as stale because it has not been commented on for at least three months.

    The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

    Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

    February 2nd, 2011 @ 04:50 PM

  10. Santiago Pastorino
    Santiago Pastorino
    • State changed from open to stale

    February 2nd, 2011 @ 04:50 PM