Environment different over SSH

This forum is for topics specific to the Raspberry Pi and Arch Linux ARM

Environment different over SSH

Postby pepijndevos » Fri Sep 14, 2012 9:47 am

I installed Jekyll via Ruby, but I'm having a lot of problems.

First of all, Ruby is not on the path, so I added $this->bbcode_second_pass_code('', 'export PATH="$PATH:~/.gem/ruby/1.9.1/bin"') to my .bashrc.

So I wrote a commit hook an tried it out interactively over SSH, and all is fine.

Next, I tried to actually push to git, and it says Jekyll is not found. I tried to print the path like so

$this->bbcode_second_pass_code('', '$ ssh 192.168.1.234 "echo \$PATH"
pepijndevos@192.168.1.234's password:
/usr/bin:/bin:/usr/sbin:/sbin')

Completely different path! When running interactively, it says

$this->bbcode_second_pass_code('', '$ ssh 192.168.1.234
pepijndevos@192.168.1.234's password:
Last login: Fri Sep 14 09:54:31 2012 from pepijns-imac.lan
[pepijndevos@alarmpi ~]$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/bin/core_perl:~/.gem/ruby/1.9.1/bin')

I played with it for a bit, but finally just added the full path to Jekyll to my git hook.

Now when I push, I get this error: $this->bbcode_second_pass_code('', 'convertible.rb:29:in `read_yaml': invalid byte sequence in US-ASCII (ArgumentError)')

I read this might be because my locale is different. Indeed, interactively:

$this->bbcode_second_pass_code('', 'LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=')
non-interactively:
$this->bbcode_second_pass_code('', 'LANG=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=')

But even copying the whole locale into my post-receive hook did not fix that. I'm out of ideas, and I could use some help making my non-interactive shell sane.
pepijndevos
 
Posts: 8
Joined: Fri Sep 14, 2012 9:26 am

Re: Environment different over SSH

Postby pepijndevos » Fri Sep 14, 2012 12:54 pm

Adding LC_ALL="en_US.UTF-8 to /etc/environment solved the last issue. It kinda works now.
pepijndevos
 
Posts: 8
Joined: Fri Sep 14, 2012 9:26 am


Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 50 guests