gems error on windows - “openpath: pathname too long”

I recently started getting this error while running gems or bundler. The only thing i can recall that I changed recently was upgrade my git version.

I am using MINGW32 as the shell, and this has been working perfectly for over a year.

I have made sure that git is in my PATH and am now not sure what to look for next.

What would be the next thing I could to to troubleshoot this issue?

Here is an example of the output i get. This example shows the heroku gem, but I get the same results when running bundle install

$ heroku console
openpath: pathname too long (ignored)
        Directory ""
        File "chcp"
openpath: pathname too long (ignored)
        Directory ""
        File "git"
c:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.14.0/lib/heroku/helpers.rb:111:in ``': No such file or directory -  git --version  (Errno::ENOENT)
        from c:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.14.0/lib/heroku/helpers.rb:111:in `has_git?'
        from c:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.14.0/lib/heroku/helpers.rb:116:in `git'
        from c:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.14.0/lib/heroku/command/base.rb:192:in `git_remotes'
        from c:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.14.0/lib/heroku/command/base.rb:170:in `extract_app_in_dir'
        from c:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.14.0/lib/heroku/command/base.rb:162:in `extract_app'
        from c:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.14.0/lib/heroku/command/run.rb:72:in `console'
        from c:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.14.0/lib/heroku/command.rb:114:in `run'
        from c:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.14.0/bin/heroku:14:in `<top (required)>'
        from c:/Ruby192/bin/heroku:19:in `load'
        from c:/Ruby192/bin/heroku:19:in `<main>'

and here is the line 111 in helpers.rb referenced above.

def has_git?
  %x{ git --version } #this is 111


This error message comes from the dln_find.c file in Ruby, which throws this error when it tries to generate a path that's longer than the MAXPATHLEN value on the system.

As per this MSDN reference, the maximum path length for a number of functions in the Windows API is only 248 characters -- thus, I would guess that MAXPATHLEN is defined as 248 in the Ruby-for-Windows sources. (Alternately, the dln_find.c sources define it as 1024 if it is not otherwise defined.)

There are a number of ways you might be able to solve this within the program if you were the programmer, but the solution at the user level is probably that you have to use a directory with a shorter name.

(So, what directory needs to be shorter? Well, there's the clue that the error message tells you what file it's trying to load, which is chcp and git. Perhaps your git upgrade changed its directory name to something excessively long, and you need to move it somewhere with a shorter name? Or ... it looks like this find code may be iterating over each entry in your PATH environment variable and checking in it and throwing a "too long" error if any given possibility is too long -- perhaps your PATH is corrupt or has a new very long entry?)

Need Your Help

Javascript code alteration for a novice

javascript jquery

I have included my entire code in jsfiddle but can't get the jquery script to load properly in jsfiddle.

Add a paragraph using Control.Add on

c# html label web-controls

So i have a Div, and on that div i add a label, i do some operations and then i add another, the problem is that the "paragraph" using the method Control.Add doesnt occur..