Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config_check.rb issue with Git #48

Open
XhmikosR opened this issue Sep 10, 2014 · 10 comments
Open

config_check.rb issue with Git #48

XhmikosR opened this issue Sep 10, 2014 · 10 comments
Assignees
Milestone

Comments

@XhmikosR
Copy link
Contributor

Pasting from the IRC since I'm lazy :P

[18:17] <XhmikosR> also emachnic there's an issue with config_check.rb which fails when Git isn't installed via Railsinstaller
[18:17] <XhmikosR> it's looking for Git in Railsinstaller/Git
[18:18] <XhmikosR> but I have Git installed already in Program Files
[18:18] <XhmikosR> that's an old issue btw
[18:18] <XhmikosR> # Rails Environment Configuration.
[18:18] <XhmikosR> C:/RailsInstaller/scripts/config_check.rb:28:in ``': No such file or directory -
[18:18] <XhmikosR>  C:/RailsInstaller/Git/bin/git.exe config --global user.name (Errno::ENOENT)
[18:18] <XhmikosR>         from C:/RailsInstaller/scripts/config_check.rb:28:in `run'
[18:18] <XhmikosR>         from C:/RailsInstaller/scripts/config_check.rb:40:in `git_config'
[18:18] <XhmikosR>         from C:/RailsInstaller/scripts/config_check.rb:49:in `block in <main>'
[18:18] <XhmikosR>         from C:/RailsInstaller/scripts/config_check.rb:48:in `each'
[18:18] <XhmikosR>         from C:/RailsInstaller/scripts/config_check.rb:48:in `<main>'
[18:18] <XhmikosR> C:\Sites>
[18:19] <XhmikosR> I mean, git.exe is even in my PATH already
[18:20] <emachnic> I guess line 17 in that file is the issue then
[18:21] <emachnic> Alright. Let's save the Git config issue for the 3.0 release. Probably can just add a check for it and only set it if it doesn't exist
@emachnic emachnic self-assigned this Sep 10, 2014
@XhmikosR XhmikosR added this to the Version 3.0.0 milestone Sep 11, 2014
@emachnic
Copy link
Contributor

@XhmikosR What's the location for your installed Git?

@XhmikosR
Copy link
Contributor Author

@emachnic: the default one C:\Program Files\Git but it shouldn't matter where it's installed since it's my PATH already.

@emachnic
Copy link
Contributor

@XhmikosR I've tried adding a check for it but even with the path correct, it doesn't seem to work when called from the config_check.rb file. Any ideas?

@XhmikosR
Copy link
Contributor Author

@emachnic: you mean the ssh-keygen issue? Because there's a built in way to do this, see /cmd/start-ssh-agent.cmd.

@danbrellis
Copy link

@XhmikosR Every get this sorted? I just ran railsinstaller.exe and declined to include GIT because I already had it. I'm getting your same error message. Thanks!

ruby 2.1.6p336
rails 4.2.5

@binlabs
Copy link

binlabs commented Aug 13, 2016

@danbrellis Still getting this same error on Windows 10, no solution found yet. I too decided to decline Git install because I already have it installed..

@sho-h
Copy link

sho-h commented Jan 10, 2017

I met same problem with 3.3.0 when starting Command Prompt with Ruby and Rails.

# Rails Environment Configuration.
C:/RailsInstaller/scripts/config_check.rb:28:in ``': No such file or directory - C:/RailsInstaller/Git/bin/git.exe config --global user.name (Errno::ENOENT)
        from C:/RailsInstaller/scripts/config_check.rb:28:in `run'
        from C:/RailsInstaller/scripts/config_check.rb:40:in `git_config'
        from C:/RailsInstaller/scripts/config_check.rb:49:in `block in <main>'
        from C:/RailsInstaller/scripts/config_check.rb:48:in `each'
        from C:/RailsInstaller/scripts/config_check.rb:48:in `<main>'

I am very happy if user config is prior to the default config like below.

+path = File.join(ENV["HOMEDRIVE"], ENV["HOMEPATH"]), ".railsinstaller.yml")
 Config =
   {
     ...
-    :git => File.join(File.dirname(File.dirname($0)), "Git", "bin", "git.exe"),
+    :git => (YAML.load_file(path) rescue {})[:git] || File.join(File.dirname(File.dirname($0)), "Git", "bin", "git.exe"),
     ...
  }

@bjornarhagen
Copy link

Got exactly the same issue as sho-h with the 3.3.0 installer. (Running windows 10)

@emachnic
Copy link
Contributor

@sho-h Have you tried testing that change on your local computer?

@vhanla
Copy link

vhanla commented Apr 11, 2017

To find GIT on global environment I modified config_check.rb as follows:

#<— just above Config = line
gitpath = "\"" + `where git`.strip! + "\""
gitfound = gitpath.index('git.exe')
if gitfound.nil?
  gitpath = File.join(File.dirname(File.dirname($0)), "Git", "bin", "git.exe")
end

Config =
  {
   #just modify the :git
    :git         => gitpath,
   #leave the other unmodified
  }
#ignore this comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants