Error stones in windows - "openpath: pathname too long"

I recently started getting this error when starting a gem or binder. The only thing I can remember, I recently changed, updated the version of git.

I have been using MINGW32 as a shell, and it has been working fine for over a year now.

I made sure git is in my PATH, and now I'm not sure what to look for next.

What will be the following that I could fix this problem?

Here is an example of the output I get. This example shows a stone to a hero, but I get the same results when I start the installation of the package

$ 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 line 111 in helpers.rb mentioned above.

 def has_git? %x{ git --version } #this is 111 $?.success? end 
+4
source share
1 answer

This error message appears from the dln_find.c file in Ruby, which throws this error when it tries to create a path that is longer than MAXPATHLEN on the system.

According to this MSDN link , the maximum path length for a number of functions in the Windows API is only 248 characters - so, I would assume that MAXPATHLEN is defined as 248 in Ruby sources for Windows. (Alternatively, dln_find.c sources define it as 1024 unless otherwise specified.)

There are several ways to solve this problem in the program if you are a programmer, but the solution at the user level is probably due to the fact that you need to use a directory with a shorter name.

(So, which directory should be shorter? Well, there is a hint that the error message tells you which file it is trying to download, and that is chcp and git . Perhaps your git upgrade changed its directory name something too long, and you do you need to move it somewhere with a shorter name? Or ... it looks like this search code can iterate over each entry in your PATH environment variable and check it and throw it β€œtoo long” if any given feature is too long - maybe your PATH corrupted or has a very long record?)

+4
source

Source: https://habr.com/ru/post/1384159/


All Articles