# Jekyll Serve Error (2)

Same as the previous post in this series, except that I ran this command from M$Win* 10. ## Problem Similar to the previous post. Owner@Owner-PC MINGW64 /c/github/blog2 (gh-pages)$ jekyll serve
WARN: Unresolved specs during Gem::Specification.reset:
pygments.rb (~> 0.6.0)
jekyll-watch (~> 1.1)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.7.2/lib/bundler/resolver.rb:35
7:in resolve': Could not find gem 'jekyll (~> 3.1) x64-mingw32' in the gems ava
ilable on this machine. (Bundler::GemNotFound)
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.7.2/lib/bundler/r
esolver.rb:164:in start'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.7.2/lib/bundler/r
esolver.rb:129:in resolve'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.7.2/lib/bundler/d
efinition.rb:193:in resolve'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.7.2/lib/bundler/d
efinition.rb:132:in specs'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.7.2/lib/bundler/d
efinition.rb:177:in specs_for'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.7.2/lib/bundler/d
efinition.rb:166:in requested_specs'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.7.2/lib/bundler/e
nvironment.rb:18:in requested_specs'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.7.2/lib/bundler/r
untime.rb:13:in setup'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.7.2/lib/bundler.r
b:121:in setup'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/jekyll-2.5.3/lib/jekyll/plu
gin_manager.rb:37:in require_from_bundler'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/jekyll-2.5.3/bin/jekyll:16:
in <top (required)>'
from C:/Ruby200-x64/bin/jekyll:23:in load'
from C:/Ruby200-x64/bin/jekyll:23:in <main>'


# Website Preview in Mobile Devices

## Goal

To know the page layout of a website, notably my blogs, on mobile devices before publishing it.

## Problem

I used ifconfig to check the IP address of my desktop where the preview site was hosted. It’s 192.168.1.5. When I typed in this address followed by a colon and the port number 4000, then the browser said “connection timeout” after loading for a while.

# My Host File Edited

## Background

A preview of a blog is often needed before it’s published.

## Problem

However, it is possible that one doesn’t like to type localhost in the address bar, and would like to have other names.

## Solution

The idea is in Local Setup – edit your hosts file in How to test localhost from any device on your network written by Wes Bos. On *nix, the file path is still the same as on OSX, but many users would rather use Vim for editing /etc/hosts. One may even use sed with the -i flag and the sudo privilege in order to directly manipulate this file.

• sudo sed -i "3i127.0.0.1\tblogtest.com" /etc/hosts for insertion of “127.0.0.1        blogtest.com” before the third line.
• sudo sed -i "3c127.0.0.1\tblogtest.com" /etc/hosts for changing the third line to “127.0.0.1        blogtest.com”.

Note that the tab is escaped as \t in these two commands.

# Jekyll Serve Error

## Background

I updated the Jekyll-Bootstrap source code for Blog 2.

## Problem

Then, I wanted to preview it.

[owner@localhost ~/blog2]$jekyll serve /home/owner/.rvm/gems/ruby-2.1.2@global/gems/bundler-1.6.5/lib/bundler/resolver. rb:357:in resolve': Could not find gem 'jekyll (~> 3.1) ruby' in the gems avail able on this machine. (Bundler::GemNotFound) from /home/owner/.rvm/gems/ruby-2.1.2@global/gems/bundler-1.6.5/lib/bund ler/resolver.rb:164:in start' from /home/owner/.rvm/gems/ruby-2.1.2@global/gems/bundler-1.6.5/lib/bund ler/resolver.rb:129:in resolve' from /home/owner/.rvm/gems/ruby-2.1.2@global/gems/bundler-1.6.5/lib/bund ler/definition.rb:203:in resolve' from /home/owner/.rvm/gems/ruby-2.1.2@global/gems/bundler-1.6.5/lib/bund ler/definition.rb:133:in specs' from /home/owner/.rvm/gems/ruby-2.1.2@global/gems/bundler-1.6.5/lib/bund ler/definition.rb:178:in specs_for' from /home/owner/.rvm/gems/ruby-2.1.2@global/gems/bundler-1.6.5/lib/bund ler/definition.rb:167:in requested_specs' from /home/owner/.rvm/gems/ruby-2.1.2@global/gems/bundler-1.6.5/lib/bund ler/environment.rb:18:in requested_specs' from /home/owner/.rvm/gems/ruby-2.1.2@global/gems/bundler-1.6.5/lib/bund ler/runtime.rb:13:in setup' from /home/owner/.rvm/gems/ruby-2.1.2@global/gems/bundler-1.6.5/lib/bund ler.rb:120:in setup' from /home/owner/.rvm/gems/ruby-2.1.2/gems/jekyll-2.5.3/lib/jekyll/plugi n_manager.rb:37:in require_from_bundler' from /home/owner/.rvm/gems/ruby-2.1.2/gems/jekyll-2.5.3/bin/jekyll:16:in <top (required)>' from /home/owner/.rvm/gems/ruby-2.1.2/bin/jekyll:23:in load' from /home/owner/.rvm/gems/ruby-2.1.2/bin/jekyll:23:in <main>' from /home/owner/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in e val' from /home/owner/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in < main>'  How can it be previewed? # Fixed Jekyll-Bootstrap Asset Path (2) | Comments | ## Background I attempted to manually fix a problem in the first post in this series half a year ago. ## Problem I have just updated the Jekyll source code for Blog 2. [owner@localhost ~/blog2]$ git pull jekyll master
remote: Counting objects: 37, done.
remote: Total 37 (delta 10), reused 10 (delta 10), pack-reused 27
Unpacking objects: 100% (37/37), done.
3a34785..8193869  master     -> jekyll/master
Removing sitemap.txt
Auto-merging _includes/JB/setup
CONFLICT (content): Merge conflict in _includes/JB/setup
Auto-merging _config.yml
Automatic merge failed; fix conflicts and then commit the result.


How to repair this failed merge?

# Restore Corrupt Git Repository

## Background

I hadn’t used Vim on my GNU/Linux desktop for a month. When I used it again, an error message was shown on the screen.

[owner@localhost ~]$vi Error detected while processing /home/owner/.vim/bundle/nerdtree/plugin/NERD_tree.vim: line 153: E117: Unknown function: nerdtree#ui_glue#setupCommands Error detected while processing function nerdtree#postSourceActions: line 2: E117: Unknown function: nerdtree#ui_glue#createDefaultBindings Press ENTER or type command to continue  Since I was occupied with another blog, thinking that the problem would be quickly fixed by an update of the NERD tree, a Vim plugin for showing a file tree in a sidebar, I didn’t want to find out the cause. ## Problem During this Vundle update, an exclamation mark with red background was displayed on the LHS of the item Plugin 'scrooloose/nerdtree' in the list contained in the status bar. I then checked Vundle’s update log. [2016-08-12 15:18:40] Plugin scrooloose/nerdtree [2016-08-12 15:18:40]$ cd '/home/owner/.vim/bundle/nerdtree' && git pull && git submodule update --init --recursive
[2016-08-12 15:18:40] > error: object file .git/objects/2e/2b649232d6ae4d02d74793e5da0ee08480ad8d is empty
[2016-08-12 15:18:40] > error: object file .git/objects/2e/2b649232d6ae4d02d74793e5da0ee08480ad8d is empty
[2016-08-12 15:18:40] > fatal: loose object 2e2b649232d6ae4d02d74793e5da0ee08480ad8d (stored in .git/objects/2e/2b649232d6ae4d02d74793e5da0ee08480ad8d) is corrupt
[2016-08-12 15:18:40] > fatal: The remote end hung up unexpectedly
[2016-08-12 15:18:40] >


While I was trying to update this plugin manually by typing in Git commands in bash, the electricity supply of my desktop went off suddenly. After it had been switched on again, I tried typing in the commands again, and I got the same error.

How can the Git repository be restored to its previous state, so that it’s intact?

# $\rm \LaTeX$ French Letter With Signature

## Background

Same as my recent post Writting Letter With Bibliography.

## Problem

How to add a scanned signature to a $\rm \LaTeX$ document for the lettre class?

# $\rm \LaTeX$ French Letter Template

I just include the files here for future references. Since the code are universal, I assume that the source file and the linked PDF file below are in public domain, despite the CC-BY-SA licence at the bottom of this page.

# Writting Letter With Bibliography

## Background

Recently, I need to write letters. Get the formatting for addressee and sender automatically done, I choose $\rm \LaTeX$. I cite a book in my letter, and try to add a bibliography at the end of the letter.

## Problem

During the compilation for the following letter, an error was thrown.

Here’s my compilation procedure.

$xelatex noltrbib.tex$ biber noltrbib
$xelatex noltrbib.tex This is XeTeX, Version 3.1415926-2.5-0.9999.3 (TeX Live 2013/Debian) restricted \write18 enabled. ... ! Undefined control sequence. \\blx@head@bibliography [#1]->\section *{#1}\markboth {\MakeUppercase {#1}}{... l.52 \end {letter} ? ...  I type <Enter> at ?, and get a PDF that seems OK. You may read the log file for this file to know more about this error. However, each time I use$\rm \LaTeX\$-Suite to compile the document inside Vim, a quickfix window pops up. This is quite inconvenient: I need to use <C-w>k to switch to the original buffer or ZQ to close the quickfix window. Therefore, I am motivated to find out a solution for this error.

# I-Search and Reverse I-Search

One knows that long commands can be retrieved by <C-r>. If the search fails, one may cancel it by <C-g>. However, how can one search forward through the command history instead of backword?
The answer is simple: add stty -ixon to your BASHRC.