{"id":544,"date":"2021-08-26T13:57:20","date_gmt":"2021-08-26T03:57:20","guid":{"rendered":"https:\/\/www.samontab.com\/web\/?p=544"},"modified":"2021-08-26T13:58:28","modified_gmt":"2021-08-26T03:58:28","slug":"install-jekyll-without-sudo","status":"publish","type":"post","link":"https:\/\/www.samontab.com\/web\/2021\/08\/install-jekyll-without-sudo\/","title":{"rendered":"Install Jekyll without sudo"},"content":{"rendered":"\n<p>When using the default installation of jekyll it will ask for sudo access when creating a new project:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nYour user account is not allowed to install to the system RubyGems.\nYou can cancel this installation and run:\n\n    bundle install --path vendor\/bundle\n\nto install the gems into .\/vendor\/bundle\/, or you can enter your password\nand install the bundled gems to RubyGems using sudo.\n\nPassword:\n\n<\/pre><\/div>\n\n\n<p>That&#8217;s not good. Here&#8217;s how you can install Jekyll without requiring sudo access.<\/p>\n\n\n\n<p>First, make sure that you have installed ruby with this command:<\/p>\n\n\n\n<p><strong><code>bundle env<\/code><\/strong><\/p>\n\n\n\n<p>By default Gem Home is set to a directory that requires sudo access. You can change it by adding these two lines to <strong>~\/.bashrc<\/strong> (or equivalent)<\/p>\n\n\n\n<p><strong>export GEM_HOME=$HOME\/gems<br>export PATH=$HOME\/gems\/bin:$PATH<\/strong><\/p>\n\n\n\n<p>Now open a new console, restart, or login again, and run the same command again:<\/p>\n\n\n\n<p><strong>bundle env<\/strong><\/p>\n\n\n\n<p>If it&#8217;s showing the changes you just did, then you&#8217;ll be able to install jekyll locally:<\/p>\n\n\n\n<p><strong>gem install bundle jekyll<\/strong><\/p>\n\n\n\n<p>And now you can proceed to use jekyll as usual:<\/p>\n\n\n\n<p><strong>jekyll new blog<\/strong><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>When using the default installation of jekyll it will ask for sudo access when creating a new project: That&#8217;s not good. Here&#8217;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 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[57,58,59],"class_list":["post-544","post","type-post","status-publish","format-standard","hentry","category-programming","tag-jekill","tag-sudo","tag-without"],"_links":{"self":[{"href":"https:\/\/www.samontab.com\/web\/wp-json\/wp\/v2\/posts\/544","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.samontab.com\/web\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.samontab.com\/web\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.samontab.com\/web\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.samontab.com\/web\/wp-json\/wp\/v2\/comments?post=544"}],"version-history":[{"count":0,"href":"https:\/\/www.samontab.com\/web\/wp-json\/wp\/v2\/posts\/544\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.samontab.com\/web\/wp-json\/wp\/v2\/media?parent=544"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.samontab.com\/web\/wp-json\/wp\/v2\/categories?post=544"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.samontab.com\/web\/wp-json\/wp\/v2\/tags?post=544"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}