Installing Jekyll without root

I want to set up a jekyll blog on a shared server. When I try to install Jekyll I get "You don't have write permissions". How do I fix this without root or sudo?

More detail:

I have space on a shared server and don't have root access. I couldn't install Ruby, though the hosting company installed it upon my request.

When I try to install Jekyll I use

[email protected] [~]# gem install jekyll

and this is the response I get:

ERROR:  While executing gem ... (Gem::FilePermissionError)
You don't have write permissions into the /usr/lib/ruby/gems/1.8 directory.

I have seen different suggestions for changing the GEMPATH which I have tried including

export GEM_PATH=/home/user/something

But even after doing so

gem env 

still results in

GEM PATHS:
- /usr/lib/ruby/gems/1.8
- /home/user/.gem/ruby/1.8

Any tips? Is it possible to install jekyll without root or sudo priviliges or am I just making some rookie PATH error?


Solution 1:

I didn't find the answer for a while. on the #jekyll IRC a user pointed me at the Arch wiki and I discovered that the thing is to force the install as a single user:

gem install jekyll --user-install

Solution 2:

This worked for me in MAC

1.Place the gems in user's home folder.Add below commands in .bashrc or .zshrc

export GEM_HOME=$HOME/gems
export PATH=$HOME/gems/bin:$PATH

2.Use installation command

gem install jekyll bundler

3.Verify Installation

 jekyll -v

Use the documentation for detailed reference

https://jekyllrb.com/docs/troubleshooting/#no-sudo