Edit new Git location in scripts/ruby_config.rb

166 views
Skip to first unread message

Paris Ionescu

unread,
Oct 30, 2013, 2:36:42 PM10/30/13
to railsin...@googlegroups.com
Hi,

I have RailsInstaller up and running.  However, the version of Git/Git Bash that came with Railsinstaller never worked for me -- I would click on it from the Startup menu and the computer would hang and tell me sh.exe wasn't responding.
So, I deleted the directory RailsInstaller/Git ... and I installed Git for Windows which now resides in C:\Program Files\Git, and it works correctly with my ssh files.

The problem is that when I load "Command Prompt with Ruby on Rails", also from the Startup Menu, I get the following notices, related to scripts/config_check.rb line 28.

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

When I open config_check.rb I can see that the Git locations are listed like this, from lines 5 to 18:

Config =
  {
    :banner => "\n# Rails Environment Configuration.\n",
    :git_config_incomplete => "\nYour git configuration is incomplete.\nuser.name and user.email are required for properly using git and services such \nas GitHub ( http://github.com/ ).\n",
    :git_name_prompt => "\n Please enter your name, for example mine is: Wayne E. Seguin\nname > ",
    :git_email_prompt => "\n Please enter your email address, for example mine is: waynee...@gmail.com\nemail > ",
    :railsinstaller_path => File.dirname(File.dirname($0)),
    :home        => File.join( ENV["HOMEDRIVE"], ENV["HOMEPATH"] ),
    :ssh_path    => File.join( ENV["HOMEDRIVE"], ENV["HOMEPATH"], ".ssh" ),
    :ssh_key     => File.join( ENV["HOMEDRIVE"], ENV["HOMEPATH"], ".ssh", "id_rsa"),
    :ssh_pub_key => File.join( ENV["HOMEDRIVE"], ENV["HOMEPATH"], ".ssh", "id_rsa.pub"),
    :ssh_keygen  => File.join( File.dirname(File.dirname($0)), "Git", "bin", "ssh-keygen.exe"),
    :git         => File.join( File.dirname(File.dirname($0)), "Git", "bin", "git.exe"),
    :cat         => File.join( File.dirname(File.dirname($0)), "Git", "bin", "cat.exe")
  }

@notes = []

#
# Methods
#
def run(command)
  $stderr.puts "Running #{command}" if Config[:debug]
  %x{#{command}}.chomp
end


The SSH locations are fine, as they are located outside RailsInstaller.  And it appears that Ruby and Rails commands still work on my computer, but I want to know how to tell the RailsInstaller installation that the Git I am using is now in Program Files.
Will Ruby work correctly with my other Git install?  Do I need to delete the registry lines for the old Git that came with RailsInstaller?
Would editing this file take care of things, or is there another place I need to configure?  And finally, how should I edit the :git and :cat paths?  I looked up the Program Files env (here: http://technet.microsoft.com/en-us/library/cc749104(v=ws.10).aspx) and it says PROGRAMFILES is the variable.  

Do I do something like:

    :git         => File.join( PROGRAMFILES, PROGRAMFILES), "Git", "bin", "git.exe"),
    :cat         => File.join( PROGRAMFILES, PROGRAMFILES), "Git", "bin", "cat.exe")

Any help would be appreciated.
Paris

Dilawar Chaudhry

unread,
Oct 24, 2015, 11:55:34 AM10/24/15
to RailsInstaller
Hi Paris

I'm facing the same error. Did you find solution to this problem?

parisi...@gmail.com

unread,
Oct 28, 2015, 3:48:33 PM10/28/15
to railsin...@googlegroups.com

Hi Dilawar,
Glad someone else faces the same issue (although not glad about your inconvenience of course). To be honest I've had other obligations and haven't played with Ruby in a while. Maybe I'll get inspired to try again next week. If you find a solution in the mean time, please do post!

All best,
Paris

--
You received this message because you are subscribed to a topic in the Google Groups "RailsInstaller" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/railsinstaller/vEGtmJlmprc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to railsinstalle...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages