git-up icon indicating copy to clipboard operation
git-up copied to clipboard

git up not working in Ubuntu

Open jamespsterling opened this issue 10 years ago • 7 comments

Ran the gem install and when I run the git up command I get:

/usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in gem_original_require': /var/lib/gems/1.8/gems/posix-spawn-0.3.9/lib/posix/spawn.rb:243: syntax error, unexpected tSYMBEG, expecting tAMPER (SyntaxError) ::Kernel::exec(*argv, :close_others=>false) ^ /var/lib/gems/1.8/gems/posix-spawn-0.3.9/lib/posix/spawn.rb:274: syntax error, unexpected tIDENTIFIER, expecting tAMPER ...(*system_command_prefixes, cmd, :out => w, r => :close) ^ /var/lib/gems/1.8/gems/posix-spawn-0.3.9/lib/posix/spawn.rb:274: syntax error, unexpected tASSOC, expecting tCOLON2 or '[' or '.' ...command_prefixes, cmd, :out => w, r => :close) ^ /var/lib/gems/1.8/gems/posix-spawn-0.3.9/lib/posix/spawn.rb:274: syntax error, unexpected tASSOC, expecting '=' ...prefixes, cmd, :out => w, r => :close) ^ /var/lib/gems/1.8/gems/posix-spawn-0.3.9/lib/posix/spawn.rb:526: syntax error, unexpected ',', expecting ']' [*system_command_prefixes, args[0]] ^ /var/lib/gems/1.8/gems/posix-spawn-0.3.9/lib/posix/spawn.rb:526: syntax error, unexpected ']', expecting kEND from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:inrequire' from /var/lib/gems/1.8/gems/posix-spawn-0.3.9/lib/posix-spawn.rb:1 from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in gem_original_require' from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:inrequire' from /var/lib/gems/1.8/gems/grit-2.5.0/lib/grit/git.rb:2 from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in gem_original_require' from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:inrequire' from /var/lib/gems/1.8/gems/grit-2.5.0/lib/grit.rb:34 from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in gem_original_require' from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:inrequire' from /var/lib/gems/1.8/gems/git-up-0.5.12/lib/git-up.rb:2 from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in gem_original_require' from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:inrequire' from /var/lib/gems/1.8/gems/git-up-0.5.12/bin/git-up:3 from /usr/local/bin/git-up:19:in `load' from /usr/local/bin/git-up:19

jamespsterling avatar Oct 20 '14 16:10 jamespsterling

Me too!
Ubuntu 12.04 git version 1.7.9.5

RichDickClark avatar Dec 30 '14 17:12 RichDickClark

It didn't even get installed in my case.

[zzzz@q2s3 tt_dev]$ gem install git-up

fWARNING:  Installing to ~/.gem since /usr/lib64/ruby/gems/1.8 and
          /usr/bin aren't both writable.
WARNING:  You don't have /home/zzzz/.gem/ruby/1.8/bin in your PATH,
          gem executables will not run.
Building native extensions.  This could take a while...
Successfully installed colored-1.2
Successfully installed posix-spawn-0.3.9
Successfully installed mime-types-1.25.1
Successfully installed diff-lcs-1.2.5
Successfully installed grit-2.5.0
Successfully installed git-up-0.5.12
6 gems installed
Installing ri documentation for colored-1.2...
Installing ri documentation for posix-spawn-0.3.9...
Installing ri documentation for mime-types-1.25.1...
Installing ri documentation for diff-lcs-1.2.5...
Installing ri documentation for grit-2.5.0...
Installing ri documentation for git-up-0.5.12...
Installing RDoc documentation for colored-1.2...
Installing RDoc documentation for posix-spawn-0.3.9...
Installing RDoc documentation for mime-types-1.25.1...
Installing RDoc documentation for diff-lcs-1.2.5...
Installing RDoc documentation for grit-2.5.0...
Installing RDoc documentation for git-up-0.5.12...
[zzzz@q2s3 tt_dev]$
[zzzz@q2s3 tt_dev]$ git up
git: 'up' is not a git command. See 'git --help'.

Did you mean one of these?
        pull
        push

unoexperto avatar Jan 21 '15 18:01 unoexperto

@cppexpert I think you need to add your ruby gems bin directory to your PATH.

$ export PATH="$PATH:~/.gem/ruby/1.8/bin"

Put that in your ~/.bashrc file if you don't want to run it on start.

gepoch avatar Feb 02 '15 20:02 gepoch

Forgot to mention: I'm also seeing this issue with @jamespsterling's traceback :smiley:

Reproduced with formatting here:

/usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require': /var/lib/gems/1.8/gems/posix-spawn-0.3.9/lib/posix/spawn.rb:243: syntax error, unexpected tSYMBEG, expecting tAMPER (SyntaxError)
          ::Kernel::exec(*argv, :close_others=>false)
                                 ^
/var/lib/gems/1.8/gems/posix-spawn-0.3.9/lib/posix/spawn.rb:274: syntax error, unexpected tIDENTIFIER, expecting tAMPER
...(*system_command_prefixes, cmd, :out => w, r => :close)
                              ^
/var/lib/gems/1.8/gems/posix-spawn-0.3.9/lib/posix/spawn.rb:274: syntax error, unexpected tASSOC, expecting tCOLON2 or '[' or '.'
...command_prefixes, cmd, :out => w, r => :close)
                              ^
/var/lib/gems/1.8/gems/posix-spawn-0.3.9/lib/posix/spawn.rb:274: syntax error, unexpected tASSOC, expecting '='
...prefixes, cmd, :out => w, r => :close)
                              ^
/var/lib/gems/1.8/gems/posix-spawn-0.3.9/lib/posix/spawn.rb:526: syntax error, unexpected ',', expecting ']'
        [*system_command_prefixes, args[0]]
                                  ^
/var/lib/gems/1.8/gems/posix-spawn-0.3.9/lib/posix/spawn.rb:526: syntax error, unexpected ']', expecting kEND
    from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `require'
    from /var/lib/gems/1.8/gems/posix-spawn-0.3.9/lib/posix-spawn.rb:1
    from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
    from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `require'
    from /var/lib/gems/1.8/gems/grit-2.5.0/lib/grit/git.rb:2
    from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
    from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `require'
    from /var/lib/gems/1.8/gems/grit-2.5.0/lib/grit.rb:34
    from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
    from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `require'
    from /var/lib/gems/1.8/gems/git-up-0.5.12/lib/git-up.rb:2
    from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
    from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `require'
    from /var/lib/gems/1.8/gems/git-up-0.5.12/bin/git-up:3
    from /usr/local/bin/git-up:23:in `load'
    from /usr/local/bin/git-up:23

gepoch avatar Feb 02 '15 20:02 gepoch

@gepoch I added to my path just like you wrote, but my ruby gems directory does not have a bin directory.

$ echo $PATH
/home/amedee/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/amedee/.rvm/bin:/home/amedee/cov-analysis/bin:/home/amedee/.rvm/bin:~/.gem/ruby/1.8/bin

$ ls ~/.gem/ruby/1.8/
cache

amedee avatar May 21 '15 13:05 amedee

@amedee yeah.. I'm not much of a ruby person, actually..

I eventually ended up switching to the python port, which works perfectly for me.

gepoch avatar May 21 '15 13:05 gepoch

@gepoch I uninstalled ruby and I am currently installing it as described on https://coolaj86.com/articles/installing-ruby-on-ubuntu-12-04.html With one change:

curl -L https://get.rvm.io | bash -s stable

should be

curl -L https://get.rvm.io | bash -s stable --ruby --auto-dotfiles

amedee avatar May 21 '15 13:05 amedee