How to set up my Jekyll site locally?

Hi,

I would like to get a local preview of my Jekyll site, The Hornery. Now you may say “Install the ruby2.x-rubygem-jekyll using zypper”. Well I have tried doing that but that doesn’t work as when I run:


jekyll serve -I -D --future

from the root of my site I get errors related to the fact I have a few dependencies listed in my _config.yml file that cannot be installed using zypper. Namely this is my _config.yml file. Notice the lines:


gems:
  - jekyll-feed
  - jekyll-gist
  - jekyll-redirect-from

I usually use bundler to set up my Jekyll site on Linux but on openSUSE Tumbleweed it fails with the error:

Fetching gem metadata from https://rubygems.org/..........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Using rake 12.0.0
Using RedCloth 4.3.2
Using i18n 0.7.0
Using json 1.8.3
Using minitest 5.10.1
Using thread_safe 0.3.5
Using public_suffix 2.0.4
Using charlock_holmes 0.7.3
Using coffee-script-source 1.11.1
Using execjs 2.7.0
Using colorator 1.1.0
Using commonjs 0.2.7
Using multi_json 1.12.1
Using multipart-post 2.0.0
Using escape_utils 1.1.1
Using ffi 1.9.14
Using forwardable-extended 2.6.0
Using gemoji 2.1.0
Using mime-types-data 3.2016.0521
Installing rugged 0.25.0b10 with native extensions
Using highline 1.7.8
Using nuggets 1.0.0
Using safe_yaml 1.0.4
Using mini_portile2 2.1.0
Using sass 3.4.23
Using rb-fsevent 0.9.8
Using kramdown 1.13.1
Using liquid 3.0.6
Using mercenary 0.3.6
Using rouge 1.11.1
Using jekyll-paginate 1.1.0
Using maruku 0.7.2
Using rdiscount 2.2.0.1
Using unicode-display_width 1.1.2
Using bundler 1.14.3
Using tzinfo 1.2.2
Using addressable 2.5.0
Using coffee-script 2.4.1
Using less 2.6.0
Using elasticsearch-api 1.0.18
Using pygments.rb 1.1.0
Using faraday 0.10.0
Using rb-inotify 0.9.7
Using pathutil 0.14.0
Using mime-types 3.1
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.


    /usr/bin/ruby.ruby2.2 -r ./siteconf20170210-10372-q4neqq.rb extconf.rb 
checking for gmake... yes
checking for cmake... yes
checking for pkg-config... yes
-- cmake .. -DBUILD_CLAR=OFF -DTHREADSAFE=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS=-fPIC
-DCMAKE_BUILD_TYPE=RelWithDebInfo
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.


Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib64
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/usr/bin/$(RUBY_BASE_NAME).ruby2.2
        --use-system-libraries
extconf.rb:13:in `sys': ERROR: 'cmake .. -DBUILD_CLAR=OFF -DTHREADSAFE=ON -DBUILD_SHARED_LIBS=OFF
-DCMAKE_C_FLAGS=-fPIC -DCMAKE_BUILD_TYPE=RelWithDebInfo ' failed (RuntimeError)
        from extconf.rb:72:in `block (2 levels) in <main>'
        from extconf.rb:69:in `chdir'
        from extconf.rb:69:in `block in <main>'
        from extconf.rb:66:in `chdir'
        from extconf.rb:66:in `<main>'


extconf failed, exit code 1


Gem files will remain installed in /tmp/bundler20170210-10372-lot9morugged-0.25.0b10/gems/rugged-0.25.0b10 for
inspection.
Results logged to
/tmp/bundler20170210-10372-lot9morugged-0.25.0b10/extensions/x86_64-linux/2.2.0/rugged-0.25.0b10/gem_make.out


An error occurred while installing rugged (0.25.0b10), and Bundler cannot continue.
Make sure that `gem install rugged -v '0.25.0b10'` succeeds before bundling. 

running:


sudo gem install rugged -v '0.25.0b10'

also fails returning the error:


Building native extensions.  This could take a while...
ERROR:  Error installing rugged:
        ERROR: Failed to build gem native extension.


    /usr/bin/ruby.ruby2.2 -r ./siteconf20170210-12205-1k1krht.rb extconf.rb
checking for gmake... yes
checking for cmake... yes
checking for pkg-config... yes
 -- cmake .. -DBUILD_CLAR=OFF -DTHREADSAFE=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS=-fPIC -DCMAKE_BUILD_TYPE=RelWithDebInfo 
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.


Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib64
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/usr/bin/$(RUBY_BASE_NAME).ruby2.2
        --use-system-libraries
extconf.rb:13:in `sys': ERROR: 'cmake .. -DBUILD_CLAR=OFF -DTHREADSAFE=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS=-fPIC -DCMAKE_BUILD_TYPE=RelWithDebInfo ' failed (RuntimeError)
        from extconf.rb:72:in `block (2 levels) in <main>'
        from extconf.rb:69:in `chdir'
        from extconf.rb:69:in `block in <main>'
        from extconf.rb:66:in `chdir'
        from extconf.rb:66:in `<main>'


extconf failed, exit code 1


Gem files will remain installed in /usr/lib64/ruby/gems/2.2.0/gems/rugged-0.25.0b10 for inspection.
Results logged to /usr/lib64/ruby/gems/2.2.0/extensions/x86_64-linux/2.2.0/rugged-0.25.0b10/gem_make.out

where /usr/lib64/ruby/gems/2.2.0/extensions/x86_64-linux/2.2.0/rugged-0.25.0b10/gem_make.out had the contents:


/usr/bin/ruby.ruby2.2 -r ./siteconf20170210-12205-1k1krht.rb extconf.rb
checking for gmake... yes
checking for cmake... yes
checking for pkg-config... yes
 -- cmake .. -DBUILD_CLAR=OFF -DTHREADSAFE=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS=-fPIC -DCMAKE_BUILD_TYPE=RelWithDebInfo 
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.


Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib64
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/usr/bin/$(RUBY_BASE_NAME).ruby2.2
        --use-system-libraries
extconf.rb:13:in `sys': ERROR: 'cmake .. -DBUILD_CLAR=OFF -DTHREADSAFE=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS=-fPIC -DCMAKE_BUILD_TYPE=RelWithDebInfo ' failed (RuntimeError)
        from extconf.rb:72:in `block (2 levels) in <main>'
        from extconf.rb:69:in `chdir'
        from extconf.rb:69:in `block in <main>'
        from extconf.rb:66:in `chdir'
        from extconf.rb:66:in `<main>'


extconf failed, exit code 1

I have tried doing the same with ruby2.3 instead of ruby2.2 but I still get the same errors.

Any ideas?

Thanks for your time,
Brenton

I haven’t reviewed what I wrote for a long time(was written for 13.2),
But you can take a look at the following which describes first how to set up Ruby (you will likely want to use later versions than the defaults I describe) and then Jekyl.

https://en.opensuse.org/User:Tsu2/Install_Ruby

Or,
If you think you’ve already set up Ruby properly, then can skip the above and go straight to setting up your free Jekyl based website on Github using what I wrote

http://putztzu.github.io/testweb/

If you have questions adapting what I wrote to your current openSUSE version (eg Tumbleweed), ask here.

HTH,
TSU

I found that the only version which would install and run without problems on LEAP was ruby2.1-rubygem-jekyll Of course, that may not apply to Tumbleweed.

I have been maintaining this Jekyll site for two years now, I know how to set up Ruby and Jekyll themselves under normal circumstances! On most distros I don’t need any help setting up both. The reason I use Bundler to set up Jekyll instead of gem is because of dependency issues. I will demonstrate these issues by telling you what happened when I followed your guide! Running:


sudo gem install jekyll

with ruby2.2 and executing:


/usr/bin/jekyll.ruby2.2 serve -I -D --future

returns:


/usr/lib64/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- bundler (LoadError)
        from /usr/lib64/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from /usr/lib64/ruby/gems/2.2.0/gems/jekyll-3.4.0/lib/jekyll/plugin_manager.rb:34:in `require_from_bundler'
        from /usr/lib64/ruby/gems/2.2.0/gems/jekyll-3.4.0/exe/jekyll:9:in `<top (required)>'
        from /usr/bin/jekyll.ruby2.2:23:in `load'
        from /usr/bin/jekyll.ruby2.2:23:in `<main>'


due to missing bundler dep. You might think “Oh, that’s simple, just install bundler”. Well let’s see what happened when I installed bundler and re-ran


/usr/bin/jekyll.ruby2.2 serve -I -D --future

, namely this is what I got:


/usr/lib64/ruby/gems/2.2.0/gems/bundler-1.14.3/lib/bundler/spec_set.rb:87:in `block in materialize': Could not find rake-12.0.0 in any of the sources (Bundler::GemNotFound)
        from /usr/lib64/ruby/gems/2.2.0/gems/bundler-1.14.3/lib/bundler/spec_set.rb:80:in `map!'
        from /usr/lib64/ruby/gems/2.2.0/gems/bundler-1.14.3/lib/bundler/spec_set.rb:80:in `materialize'
        from /usr/lib64/ruby/gems/2.2.0/gems/bundler-1.14.3/lib/bundler/definition.rb:176:in `specs'
        from /usr/lib64/ruby/gems/2.2.0/gems/bundler-1.14.3/lib/bundler/definition.rb:235:in `specs_for'
        from /usr/lib64/ruby/gems/2.2.0/gems/bundler-1.14.3/lib/bundler/definition.rb:224:in `requested_specs'
        from /usr/lib64/ruby/gems/2.2.0/gems/bundler-1.14.3/lib/bundler/runtime.rb:118:in `block in definition_method'
        from /usr/lib64/ruby/gems/2.2.0/gems/bundler-1.14.3/lib/bundler/runtime.rb:19:in `setup'
        from /usr/lib64/ruby/gems/2.2.0/gems/bundler-1.14.3/lib/bundler.rb:100:in `setup'
        from /usr/lib64/ruby/gems/2.2.0/gems/jekyll-3.4.0/lib/jekyll/plugin_manager.rb:36:in `require_from_bundler'
        from /usr/lib64/ruby/gems/2.2.0/gems/jekyll-3.4.0/exe/jekyll:9:in `&lt;top (required)&gt;'
        from /usr/bin/jekyll.ruby2.2:23:in `load'
        from /usr/bin/jekyll.ruby2.2:23:in `&lt;main&gt;'

of course you may think, “Oh that’s simple now install rake”, well I did that now what do I get when I run


/usr/bin/jekyll.ruby2.2 serve -I -D --future

:


/usr/lib64/ruby/gems/2.2.0/gems/bundler-1.14.3/lib/bundler/spec_set.rb:87:in `block in materialize': Could not find RedCloth-4.3.2 in any of the sources (Bundler::GemNotFound)
        from /usr/lib64/ruby/gems/2.2.0/gems/bundler-1.14.3/lib/bundler/spec_set.rb:80:in `map!'
        from /usr/lib64/ruby/gems/2.2.0/gems/bundler-1.14.3/lib/bundler/spec_set.rb:80:in `materialize'
        from /usr/lib64/ruby/gems/2.2.0/gems/bundler-1.14.3/lib/bundler/definition.rb:176:in `specs'
        from /usr/lib64/ruby/gems/2.2.0/gems/bundler-1.14.3/lib/bundler/definition.rb:235:in `specs_for'
        from /usr/lib64/ruby/gems/2.2.0/gems/bundler-1.14.3/lib/bundler/definition.rb:224:in `requested_specs'
        from /usr/lib64/ruby/gems/2.2.0/gems/bundler-1.14.3/lib/bundler/runtime.rb:118:in `block in definition_method'
        from /usr/lib64/ruby/gems/2.2.0/gems/bundler-1.14.3/lib/bundler/runtime.rb:19:in `setup'
        from /usr/lib64/ruby/gems/2.2.0/gems/bundler-1.14.3/lib/bundler.rb:100:in `setup'
        from /usr/lib64/ruby/gems/2.2.0/gems/jekyll-3.4.0/lib/jekyll/plugin_manager.rb:36:in `require_from_bundler'
        from /usr/lib64/ruby/gems/2.2.0/gems/jekyll-3.4.0/exe/jekyll:9:in `&lt;top (required)&gt;'
        from /usr/bin/jekyll.ruby2.2:23:in `load'
        from /usr/bin/jekyll.ruby2.2:23:in `&lt;main&gt;'

Then after installing RedCloth I get the error from


/usr/bin/jekyll.ruby2.2 serve -I -D --future

:


/usr/lib64/ruby/gems/2.2.0/gems/bundler-1.14.3/lib/bundler/spec_set.rb:87:in `block in materialize': Could not find i18n-0.7.0 in any of the sources (Bundler::GemNotFound)
        from /usr/lib64/ruby/gems/2.2.0/gems/bundler-1.14.3/lib/bundler/spec_set.rb:80:in `map!'
        from /usr/lib64/ruby/gems/2.2.0/gems/bundler-1.14.3/lib/bundler/spec_set.rb:80:in `materialize'
        from /usr/lib64/ruby/gems/2.2.0/gems/bundler-1.14.3/lib/bundler/definition.rb:176:in `specs'
        from /usr/lib64/ruby/gems/2.2.0/gems/bundler-1.14.3/lib/bundler/definition.rb:235:in `specs_for'
        from /usr/lib64/ruby/gems/2.2.0/gems/bundler-1.14.3/lib/bundler/definition.rb:224:in `requested_specs'
        from /usr/lib64/ruby/gems/2.2.0/gems/bundler-1.14.3/lib/bundler/runtime.rb:118:in `block in definition_method'
        from /usr/lib64/ruby/gems/2.2.0/gems/bundler-1.14.3/lib/bundler/runtime.rb:19:in `setup'
        from /usr/lib64/ruby/gems/2.2.0/gems/bundler-1.14.3/lib/bundler.rb:100:in `setup'
        from /usr/lib64/ruby/gems/2.2.0/gems/jekyll-3.4.0/lib/jekyll/plugin_manager.rb:36:in `require_from_bundler'
        from /usr/lib64/ruby/gems/2.2.0/gems/jekyll-3.4.0/exe/jekyll:9:in `&lt;top (required)&gt;'
        from /usr/bin/jekyll.ruby2.2:23:in `load'
        from /usr/bin/jekyll.ruby2.2:23:in `&lt;main&gt;'

and it goes on and on after that. Now do you see why I use Bundler? Eventually, using gem to install all dependencies, one gets to this stage of install rugged 0.25.0b10 with gem at which point one gets the error:


Building native extensions.  This could take a while...
ERROR:  Error installing rugged:
        ERROR: Failed to build gem native extension.


    /usr/bin/ruby.ruby2.2 -r ./siteconf20170211-7332-2bx8h9.rb extconf.rb
checking for gmake... yes
checking for cmake... yes
checking for pkg-config... yes
 -- cmake .. -DBUILD_CLAR=OFF -DTHREADSAFE=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS=-fPIC -DCMAKE_BUILD_TYPE=RelWithDebInfo 
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.


Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib64
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/usr/bin/$(RUBY_BASE_NAME).ruby2.2
        --use-system-libraries
extconf.rb:13:in `sys': ERROR: 'cmake .. -DBUILD_CLAR=OFF -DTHREADSAFE=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS=-fPIC -DCMAKE_BUILD_TYPE=RelWithDebInfo ' failed (RuntimeError)
        from extconf.rb:72:in `block (2 levels) in <main>'
        from extconf.rb:69:in `chdir'
        from extconf.rb:69:in `block in <main>'
        from extconf.rb:66:in `chdir'
        from extconf.rb:66:in `<main>'


extconf failed, exit code 1


Gem files will remain installed in /usr/lib64/ruby/gems/2.2.0/gems/rugged-0.25.0b10 for inspection.
Results logged to /usr/lib64/ruby/gems/2.2.0/extensions/x86_64-linux/2.2.0/rugged-0.25.0b10/gem_make.out

and /usr/lib64/ruby/gems/2.2.0/extensions/x86_64-linux/2.2.0/rugged-0.25.0b10/gem_make.out contains:


/usr/bin/ruby.ruby2.2 -r ./siteconf20170211-7332-2bx8h9.rb extconf.rb 
checking for gmake... yes
checking for cmake... yes
checking for pkg-config... yes
 -- cmake .. -DBUILD_CLAR=OFF -DTHREADSAFE=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS=-fPIC -DCMAKE_BUILD_TYPE
=RelWithDebInfo  
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib64
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/usr/bin/$(RUBY_BASE_NAME).ruby2.2
        --use-system-libraries
extconf.rb:13:in `sys': ERROR: 'cmake .. -DBUILD_CLAR=OFF -DTHREADSAFE=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FL
AGS=-fPIC -DCMAKE_BUILD_TYPE=RelWithDebInfo ' failed (RuntimeError)
        from extconf.rb:72:in `block (2 levels) in <main>'
        from extconf.rb:69:in `chdir'
        from extconf.rb:69:in `block in <main>'
        from extconf.rb:66:in `chdir'
        from extconf.rb:66:in `<main>'

extconf failed, exit code 1

exactly the error I started this question with!

mkmf.log contains the contents:


find_executable: checking for gmake... -------------------- yes


--------------------


find_executable: checking for cmake... -------------------- yes


--------------------


find_executable: checking for pkg-config... -------------------- yes


--------------------


"cmake .. -DBUILD_CLAR=OFF -DTHREADSAFE=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS=-fPIC -DCMAKE_BUILD_TYPE=RelWithDebInfo "
cmake: symbol lookup error: /usr/lib64/libssh2.so.1: undefined symbol: EVP_aes_256_ctr

I was able to fix this issue by removing some unneeded gems from my Gemfile. For details see this commit.

Congrats on finding causes for your troubles, but skimming through your posts and your commit…

  • It looks like you may have skipped over a comment I made in my Ruby install instructions, the gem “bundler” has to explicitly be installed from the OSS, trying to install and run from the Ruby repos fails. I don’t know why, I just noted this and made it an “openSUSE specific” issue. In other words, just because you know how to set up Ruby generally speaking, that’s not sufficient setting up on openSUSE (You need to follow my instructions, at least the early steps).

And, just missing that one step (installing bundler as I describe) may have been your problem.

  • I’m surprised if removing things like coffeescript, less, elasticsearch, etc support are substantive. I’ve always thought of the various scripting components you removed as enhancements that don’t affect basic functionality. SASS is a maybe. Ordinarily style sheets are about appearance only, although nowadays you can do some functional tricks with CSS but I’ve only run into that in demos. I doubt <removing> SASS should affect code that doesn’t use its specific capability.

Beyond the above,
Your website looks like it’s likely a very mature site with a very large number of components, which makes your site far beyond a “Jekyll bootstap,” I’d consider your site highly customized. Congrats. The amount of components you’re using is a sure indication of the amount of work you’ve put into it.

TSU