Skip to content

Install Jekyll without sudo

When using the default installation of jekyll it will ask for sudo access when creating a new project:

Your user account is not allowed to install to the system RubyGems.
You can cancel this installation and run:

    bundle install --path vendor/bundle

to install the gems into ./vendor/bundle/, or you can enter your password
and install the bundled gems to RubyGems using sudo.


That’s not good. Here’s how you can install Jekyll without requiring sudo access.

First, make sure that you have installed ruby with this command:

bundle env

By default Gem Home is set to a directory that requires sudo access. You can change it by adding these two lines to ~/.bashrc (or equivalent)

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

Now open a new console, restart, or login again, and run the same command again:

bundle env

If it’s showing the changes you just did, then you’ll be able to install jekyll locally:

gem install bundle jekyll

And now you can proceed to use jekyll as usual:

jekyll new blog

Posted in Programming.

Tagged with , , .

0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

Some HTML is OK

or, reply to this post via trackback.