Sunday, April 28, 2024
46
rated 0 times [  46] [ 0]  / answers: 1 / hits: 16514  / 2 Years ago, fri, may 27, 2022, 8:18:02

According to the jekyll site, this is how you make a new website with jekyll:



~ $ gem install jekyll
~ $ jekyll new myblog
~ $ cd myblog
~/myblog $ jekyll serve


gem install jekyll didn't work, nor did sudo gem install jekyll:



└─>gem install jekyll
ERROR: While executing gem ... (Errno::EACCES)
Permission denied - /var/lib/gems/1.9.1/gems/fast-stemmer-1.0.2/LICENSE
┌─[Sat Jun 08][jon@jon-MacMini:~/Web]
└─>sudo !!
sudo gem install jekyll
Building native extensions. This could take a while...
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.

/usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from extconf.rb:1:in `<main>'


Gem files will remain installed in /var/lib/gems/1.9.1/gems/fast-stemmer-1.0.2 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/fast-stemmer-1.0.2/ext/gem_make.out


I also tried following the answer here, but that doesn't help. sudo apt-get install jekyll works. Even then, though, running jekyll new myblog returns this error:



└─>jekyll new myblog
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': iconv will be deprecated in the future, use String#encode instead.
WARNING: Could not read configuration. Using defaults (and options).
No such file or directory - new/_config.yml
Building site: new -> myblog
/usr/lib/ruby/vendor_ruby/jekyll/site.rb:126:in `chdir': No such file or directory - /home/jon/Web/new/ (Errno::ENOENT)
from /usr/lib/ruby/vendor_ruby/jekyll/site.rb:126:in `read_directories'
from /usr/lib/ruby/vendor_ruby/jekyll/site.rb:98:in `read'
from /usr/lib/ruby/vendor_ruby/jekyll/site.rb:38:in `process'
from /usr/bin/jekyll:250:in `<main>'


Anyone know what's causing this?


More From » software-installation

 Answers
7

On my 13.04 and 14.04 systems, things worked for me after installing the ruby-dev package, then running the gem install:




  • sudo apt-get install ruby1.9.1-dev (or try: ruby-dev instead)


  • gem install jekyll # if this fails then sudo gem install jekyll




After that, jekyll was installed correctly.



Note that for the gem install instruction, it is better not to use sudo.*****



It's better to use something like RVM, so that sudo isn't required. On some systems it may be necessary to use sudo, if for instance permissions were set by previous sudo commands or root-level configuration.



See this stackoverflow question -- how to install gems without sudo for more information and for help on getting permissions set to user instead of root.



***** Credit to @iguarav for this best practices advice as well as the link to rvm.io.


[#30813] Saturday, May 28, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
itchlos

Total Points: 486
Total Questions: 115
Total Answers: 110

Location: Macau
Member since Fri, Apr 28, 2023
1 Year ago
;