Running as user nobody?

dear jekyllers—I am not a ruby programmer. I have a weird problem. When I run jekyll as myself or as root, it works great. When I run it as user nobody, I get

# sudo -u nobody /usr/local/bin/jekyll build --incremental --source /home/me/mysource --destination /var/www/mydest --watch
Traceback (most recent call last):
	2: from /usr/local/bin/jekyll:23:in `<main>'
	1: from /usr/lib/ruby/2.5.0/rubygems.rb:308:in `activate_bin_path'
/usr/lib/ruby/2.5.0/rubygems.rb:289:in `find_spec_for_exe': 
   can't find gem jekyll (>= 0.a) with executable jekyll (Gem::GemNotFoundException)

I tried bundle but this was not helpful even as me. It always tells me Could not locate Gemfile.

what needs to be rearranged so that nobody can run jekyll, too?

regards,

/iaw

@iaw4 What operating system are you using, and what are the permissions of the files in the jekyll directory?

the user nobody has nologin shell, and no privs, and no home dir (so therefore has no environment, … and therefore no ruby env)

cat /etc/passwd | grep nobody
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin

You need to sort out your login creds etc for the user nobody

2 Likes