wayne.simacek-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2009-Apr-24 23:27 UTC
git-rails init can''t find HOME environment
I''m trying to teach myself version control using GIT on a Windows machine for my ROR development. I downloaded and ran the cygwin and it created the following files: ''./.bashrc'' -> ''/home/Wayne//.bashrc'' ''./.bach_profile'' -> ''/home/Wayne//.bash_profile'' ''./.inputrc'' -> ''/home/Wayne//.inputrc'' Wayne@Gateway ~ $ I also installed the gem git-rails I''ve created a project and did a cd to that project. Now when I run get-rails init I receive what looks like an error finding my HOME path as follows: C:/ruby/lib/ruby/gems/1.8/gems/git-rails-0.2.1/bin/git- rails:12:in `expand_path'': couldn''t find HOME environment -- expanding `~'' (ArgumentError) from C:/ruby/lib/ruby/gems/1.8/gems/git-rails-0.2.1/bin/git-rails:12 from C:/ruby/bin/git-rails:19:in `load'' from C:/ruby/bin/git-rails:19 Any ideas?
wayne.simacek-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> I''m trying to teach myself version control using GIT on a Windows > machine for my ROR development. I downloaded and ran the cygwin and it > created the following files: > ''./.bashrc'' -> ''/home/Wayne//.bashrc'' > ''./.bach_profile'' -> ''/home/Wayne//.bash_profile'' > ''./.inputrc'' -> ''/home/Wayne//.inputrc'' > > Wayne@Gateway ~ > $ > > I also installed the gem git-rails > > I''ve created a project and did a cd to that project. > > Now when I run get-rails init I receive what looks like an error > finding my HOME path as follows: > > C:/ruby/lib/ruby/gems/1.8/gems/git-rails-0.2.1/bin/git- > rails:12:in `expand_path'': couldn''t find HOME environment -- > expanding `~'' (ArgumentError) > from C:/ruby/lib/ruby/gems/1.8/gems/git-rails-0.2.1/bin/git-rails:12 > from C:/ruby/bin/git-rails:19:in `load'' > from C:/ruby/bin/git-rails:19 > > Any ideas?There doesn''t seem to be much information about the git-rails gem on google. That fact alone would have persuaded me to go a different route. Why not actually download and install git? I am in the same position as you: I am learing git(as of 3 days ago) but on a mac. But you installed cygwin, so that means you should have a unix like environment to work with, and we should be in the same boat. I downloaded git itself and installed it. I used this tutorial to start: Starting with git using just 10 commands (I''m only using 5 so far) http://blog.xkoder.com/2008/08/13/git-tutorial-starting-with-git-using-just-10-commands/ But it was hard to find a tutorial that actually tells you how to rollback to a previous version of your code. This one does: http://www-cs-students.stanford.edu/~blynn/gitmagic/ch02.html#_saving_state (see section Advanced Undo/Redo--I''m not sure why it''s titled "Advanced" since it''s so basic.) -- Posted via http://www.ruby-forum.com/.
wayne.simacek-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> Now when I run get-rails init I receive what looks like an error > finding my HOME path as follows: > > C:/ruby/lib/ruby/gems/1.8/gems/git-rails-0.2.1/bin/git- > rails:12:in `expand_path'': couldn''t find HOME environment -- > expanding `~'' (ArgumentError) > from C:/ruby/lib/ruby/gems/1.8/gems/git-rails-0.2.1/bin/git-rails:12 > from C:/ruby/bin/git-rails:19:in `load'' > from C:/ruby/bin/git-rails:19 > > Any ideas?Oh, yeah. In unix, the ''~'' is shorthand for your the directory your account has been assigned to, e.g. /Users/joe blow So whenever you want to use that path, you can use ''~'' instead of typing that out by hand. That path is also the value of the $HOME environment variable on my computer. Maybe when you write "~", unix substitutes in the value of $HOME. The error message indicates that the gem is using "~" in its code somewhere, and that it couldn''t find $HOME to substitute in a path for ''~''. To check if an environment variable is set in cygwin, do this: <some prompt here> $HOME ...that is type $HOME after your prompt in cygwin. I get this result: ~/2testing/dir1$ $HOME -bash: /Users/myname: is a directory To see all the environment variables that are set, do this: <some prompt here> set -- Posted via http://www.ruby-forum.com/.
7stud -- wrote:> To check if an environment variable is set in > cygwin, do this: > > <some prompt here> $HOME >That should read:> To check if the $HOME environment variable is set, do this:> <some prompt here> $HOME-- Posted via http://www.ruby-forum.com/.
And another thing... To permanently set an environment variable for bash, set the environment variable in the .bash_profile file: HOME="/home/Wayne" You might also want to add a comment to any change you make to .bash_profile, so that in the future you will know why you made the change that you did. Comments are preceded by: # Spaces are not superfluous, so write the assignment exactly as written above. -- Posted via http://www.ruby-forum.com/.