Same as the background in my previous article.
I uninstalled Ruby 2.0 in the Control Panel, and then installed version 2.3.3 from RubyInstaller for Windows
Gem::InstallError: The 'RedCloth' native gem requires installed build tools.
Please update your PATH to include build tools or download the DevKit
from 'http://rubyinstaller.org/downloads' and follow the instructions
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'
An error occurred while installing RedCloth (4.2.9), and Bundler cannot
continue.
Make sure that `gem install RedCloth -v '4.2.9'` succeeds before bundling.
The error message is similar to Joe’s gem install error. The only difference is that I was installing RedCloth 4.9.
This failure is due to the absence of a valid path to
RubyInstaller Development Kit. I tried manually adding the
path to the folder for binary executables (default to
C:\RubyDevKit\bin
) to PATH
, but it’s unsuccessful. I googled
“Please update your PATH to include build tools” and found
his question, whose third answer explained the function
of devkitvar.bat
. This batch script actually prepended the path of
two folders into PATH
. One is stated above; one is
C:\RubyDevKit\mingw\bin
. Running this batch file changes PATH
temporarily. A manual configuration in the Control Panel allowed
the system to detect DevKit, and this problem was thus
solved.
Name | Version Number |
---|---|
rake | 10.4.2 |
bundler | 1.13.7 |
Name | Version Number | With native extensions? |
---|---|---|
RedCloth | 4.2.9 | ✓ |
wdm | 0.1.0 | ✓ |
blankslate | 2.1.2.4 | ✗ |
chunky_png | 1.3.4 | ✗ |
coffee-script-source | 1.9.1 | ✗ |
colorator | 0.1 | ✗ |
execjs | 2.4.0 | ✗ |
fast-stemmer | 1.0.2 | ✓ |
ffi | 1.9.6 | ✗ |
hitimes | 1.2.2 | ✓ |
jekyll-gist | 1.1.0 | ✗ |
jekyll-paginate | 1.1.0 | ✗ |
jekyll-sitemap | 0.8.0 | ✗ |
kramdown | 1.6.0 | ✗ |
liquid | 2.6.2 | ✗ |
mercenary | 0.3.5 | ✗ |
multi_json | 1.11.0 | ✗ |
posix-spawn | 0.3.10 | ✓ |
rack | 1.6.0 | ✗ |
rb-fsevent | 0.9.4 | ✗ |
redcarpet | 3.2.2 | ✓ |
safe_yaml | 1.0.4 | ✗ |
sass | 3.4.13 | ✗ |
stringex | 1.4.0 | ✗ |
tilt | 1.4.1 | ✗ |
yajl-ruby | 1.2.1 | ✓ |
I put the error message from wdm in a popup dialog.
Owner@Owner-PC MINGW64 /c/github/vincenttam.github.io (source)
$ bundle install
Fetching gem metadata from https://rubygems.org/.........
Fetching version metadata from https://rubygems.org/..
Fetching dependency metadata from https://rubygems.org/.
Using rake 10.4.2
Using RedCloth 4.2.9
Using blankslate 2.1.2.4
Installing hitimes 1.2.2 with native extensions
Using chunky_png 1.3.4
Installing fast-stemmer 1.0.2 with native extensions
Using coffee-script-source 1.9.1
Using execjs 2.4.0
Using colorator 0.1
Using multi_json 1.11.0
Using sass 3.4.13
Using rb-fsevent 0.9.4
Using ffi 1.9.6
Using tilt 1.4.1
Using jekyll-gist 1.1.0
Using jekyll-paginate 1.1.0
Using kramdown 1.6.0
Using liquid 2.6.2
Using mercenary 0.3.5
Installing posix-spawn 0.3.10 with native extensions
Installing yajl-ruby 1.2.1 with native extensions
Installing redcarpet 3.2.2 with native extensions
Using safe_yaml 1.0.4
Using jekyll-sitemap 0.8.0
Using rack 1.6.0
Using stringex 1.4.0
Installing wdm 0.1.0 with native extensions
Using bundler 1.13.7
Installing parslet 1.5.0
Installing timers 4.0.1
Installing classifier-reborn 2.0.3
Installing coffee-script 2.3.0
Installing compass-core 1.0.3
Installing compass-import-once 1.0.5
Installing jekyll-sass-converter 1.3.0
Installing sass-globbing 1.0.0
Installing rb-inotify 0.9.5
Installing haml 4.0.6
Installing pygments.rb 0.6.2
Installing rack-protection 1.5.3
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/wdm-0.1.0/ext/wdm
C:/Ruby23-x64/bin/ruby.exe -r ./siteconf20170109-8020-1n4s35m.rb extconf.rb
checking for main() in -lkernel32... yes
checking for windows.h... yes
checking for ruby.h... yes
checking for HAVE_RUBY_ENCODING_H... yes
creating Makefile
To see why this extension failed to compile, please check the mkmf.log which can
be found here:
current directory: C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/wdm-0.1.0/ext/wdm
make "DESTDIR=" clean
current directory: C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/wdm-0.1.0/ext/wdm
make "DESTDIR="
generating wdm_ext-x64-mingw32.def
compiling entry.c
In file included from entry.c:1:0:
wdm.h:3:0: warning: "WINVER" redefined [enabled by default]
In file included from
4-mingw32/include/crtdefs.h:10:0,
from
4-mingw32/include/stdio.h:9,
from wdm.h:1,
from entry.c:1:
4-mingw32/include/_mingw.h:248:0:
note: this is the location of the previous definition
In file included from entry.c:1:0:
wdm.h:4:0: warning: "_WIN32_WINNT" redefined [enabled by default]
<command-line>:0:0: note: this is the location of the previous definition
In file included from c:/Ruby23-x64/include/ruby-2.3.0/ruby/win32.h:41:0,
from c:/Ruby23-x64/include/ruby-2.3.0/ruby/defines.h:168,
from c:/Ruby23-x64/include/ruby-2.3.0/ruby/ruby.h:36,
from c:/Ruby23-x64/include/ruby-2.3.0/ruby.h:33,
from wdm.h:12,
from entry.c:1:
4-mingw32/include/winsock2.h:15:2:
warning: #warning Please include winsock2.h before windows.h [-Wcpp]
compiling memory.c
In file included from memory.c:1:0:
wdm.h:3:0: warning: "WINVER" redefined [enabled by default]
In file included from
4-mingw32/include/crtdefs.h:10:0,
from
4-mingw32/include/stdio.h:9,
from wdm.h:1,
from memory.c:1:
4-mingw32/include/_mingw.h:248:0:
note: this is the location of the previous definition
In file included from memory.c:1:0:
wdm.h:4:0: warning: "_WIN32_WINNT" redefined [enabled by default]
<command-line>:0:0: note: this is the location of the previous definition
In file included from c:/Ruby23-x64/include/ruby-2.3.0/ruby/win32.h:41:0,
from c:/Ruby23-x64/include/ruby-2.3.0/ruby/defines.h:168,
from c:/Ruby23-x64/include/ruby-2.3.0/ruby/ruby.h:36,
from c:/Ruby23-x64/include/ruby-2.3.0/ruby.h:33,
from wdm.h:12,
from memory.c:1:
4-mingw32/include/winsock2.h:15:2:
warning: #warning Please include winsock2.h before windows.h [-Wcpp]
compiling monitor.c
In file included from monitor.c:1:0:
wdm.h:3:0: warning: "WINVER" redefined [enabled by default]
In file included from
4-mingw32/include/crtdefs.h:10:0,
from
4-mingw32/include/stdio.h:9,
from wdm.h:1,
from monitor.c:1:
4-mingw32/include/_mingw.h:248:0:
note: this is the location of the previous definition
In file included from monitor.c:1:0:
wdm.h:4:0: warning: "_WIN32_WINNT" redefined [enabled by default]
<command-line>:0:0: note: this is the location of the previous definition
In file included from c:/Ruby23-x64/include/ruby-2.3.0/ruby/win32.h:41:0,
from c:/Ruby23-x64/include/ruby-2.3.0/ruby/defines.h:168,
from c:/Ruby23-x64/include/ruby-2.3.0/ruby/ruby.h:36,
from c:/Ruby23-x64/include/ruby-2.3.0/ruby.h:33,
from wdm.h:12,
from monitor.c:1:
4-mingw32/include/winsock2.h:15:2:
warning: #warning Please include winsock2.h before windows.h [-Wcpp]
compiling queue.c
In file included from queue.c:3:0:
wdm.h:3:0: warning: "WINVER" redefined [enabled by default]
In file included from
4-mingw32/include/vadefs.h:13:0,
from
4-mingw32/include/_mingw_stdarg.h:14,
from
4-mingw32/include/stdarg.h:140,
from
c:\rubydevkit\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.2/include/stdarg.h:1,
from queue.c:1:
4-mingw32/include/_mingw.h:248:0:
note: this is the location of the previous definition
In file included from queue.c:3:0:
wdm.h:4:0: warning: "_WIN32_WINNT" redefined [enabled by default]
<command-line>:0:0: note: this is the location of the previous definition
In file included from c:/Ruby23-x64/include/ruby-2.3.0/ruby/win32.h:41:0,
from c:/Ruby23-x64/include/ruby-2.3.0/ruby/defines.h:168,
from c:/Ruby23-x64/include/ruby-2.3.0/ruby/ruby.h:36,
from c:/Ruby23-x64/include/ruby-2.3.0/ruby.h:33,
from wdm.h:12,
from queue.c:3:
4-mingw32/include/winsock2.h:15:2:
warning: #warning Please include winsock2.h before windows.h [-Wcpp]
compiling rb_change.c
In file included from rb_change.c:4:0:
wdm.h:3:0: warning: "WINVER" redefined [enabled by default]
In file included from
4-mingw32/include/crtdefs.h:10:0,
from
4-mingw32/include/stdlib.h:9,
from rb_change.c:1:
4-mingw32/include/_mingw.h:248:0:
note: this is the location of the previous definition
In file included from rb_change.c:4:0:
wdm.h:4:0: warning: "_WIN32_WINNT" redefined [enabled by default]
<command-line>:0:0: note: this is the location of the previous definition
In file included from c:/Ruby23-x64/include/ruby-2.3.0/ruby/win32.h:41:0,
from c:/Ruby23-x64/include/ruby-2.3.0/ruby/defines.h:168,
from c:/Ruby23-x64/include/ruby-2.3.0/ruby/ruby.h:36,
from c:/Ruby23-x64/include/ruby-2.3.0/ruby.h:33,
from wdm.h:12,
from rb_change.c:4:
4-mingw32/include/winsock2.h:15:2:
warning: #warning Please include winsock2.h before windows.h [-Wcpp]
compiling rb_monitor.c
In file included from rb_monitor.c:1:0:
wdm.h:3:0: warning: "WINVER" redefined [enabled by default]
In file included from
4-mingw32/include/crtdefs.h:10:0,
from
4-mingw32/include/stdio.h:9,
from wdm.h:1,
from rb_monitor.c:1:
4-mingw32/include/_mingw.h:248:0:
note: this is the location of the previous definition
In file included from rb_monitor.c:1:0:
wdm.h:4:0: warning: "_WIN32_WINNT" redefined [enabled by default]
<command-line>:0:0: note: this is the location of the previous definition
In file included from c:/Ruby23-x64/include/ruby-2.3.0/ruby/win32.h:41:0,
from c:/Ruby23-x64/include/ruby-2.3.0/ruby/defines.h:168,
from c:/Ruby23-x64/include/ruby-2.3.0/ruby/ruby.h:36,
from c:/Ruby23-x64/include/ruby-2.3.0/ruby.h:33,
from wdm.h:12,
from rb_monitor.c:1:
4-mingw32/include/winsock2.h:15:2:
warning: #warning Please include winsock2.h before windows.h [-Wcpp]
rb_monitor.c: In function 'rb_monitor_run_bang':
rb_monitor.c:508:9: warning: implicit declaration of function
'rb_thread_blocking_region' [-Wimplicit-function-declaration]
compiling utils.c
In file included from utils.c:1:0:
wdm.h:3:0: warning: "WINVER" redefined [enabled by default]
In file included from
4-mingw32/include/crtdefs.h:10:0,
from
4-mingw32/include/stdio.h:9,
from wdm.h:1,
from utils.c:1:
4-mingw32/include/_mingw.h:248:0:
note: this is the location of the previous definition
In file included from utils.c:1:0:
wdm.h:4:0: warning: "_WIN32_WINNT" redefined [enabled by default]
<command-line>:0:0: note: this is the location of the previous definition
In file included from c:/Ruby23-x64/include/ruby-2.3.0/ruby/win32.h:41:0,
from c:/Ruby23-x64/include/ruby-2.3.0/ruby/defines.h:168,
from c:/Ruby23-x64/include/ruby-2.3.0/ruby/ruby.h:36,
from c:/Ruby23-x64/include/ruby-2.3.0/ruby.h:33,
from wdm.h:12,
from utils.c:1:
4-mingw32/include/winsock2.h:15:2:
warning: #warning Please include winsock2.h before windows.h [-Wcpp]
compiling wdm.c
In file included from wdm.c:1:0:
wdm.h:3:0: warning: "WINVER" redefined [enabled by default]
In file included from
4-mingw32/include/crtdefs.h:10:0,
from
4-mingw32/include/stdio.h:9,
from wdm.h:1,
from wdm.c:1:
4-mingw32/include/_mingw.h:248:0:
note: this is the location of the previous definition
In file included from wdm.c:1:0:
wdm.h:4:0: warning: "_WIN32_WINNT" redefined [enabled by default]
<command-line>:0:0: note: this is the location of the previous definition
In file included from c:/Ruby23-x64/include/ruby-2.3.0/ruby/win32.h:41:0,
from c:/Ruby23-x64/include/ruby-2.3.0/ruby/defines.h:168,
from c:/Ruby23-x64/include/ruby-2.3.0/ruby/ruby.h:36,
from c:/Ruby23-x64/include/ruby-2.3.0/ruby.h:33,
from wdm.h:12,
from wdm.c:1:
4-mingw32/include/winsock2.h:15:2:
warning: #warning Please include winsock2.h before windows.h [-Wcpp]
linking shared-object wdm_ext.so
rb_monitor.o: In function `rb_monitor_run_bang':
C:\Ruby23-x64\lib\ruby\gems\2.3.0\gems\wdm-0.1.0\ext\wdm/rb_monitor.c:508:
undefined reference to `rb_thread_blocking_region'
collect2.exe: error: ld returned 1 exit status
make: *** [wdm_ext.so] Error 1
make failed, exit code 2
Gem files will remain installed in
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/wdm-0.1.0 for inspection.
Results logged to
.out
An error occurred while installing wdm (0.1.0), and Bundler cannot continue.
Make sure that `gem install wdm -v '0.1.0'` succeeds before bundling.
From the line
wdm.h:4:0: warning: "_WIN32_WINNT" redefined [enabled by default]
I found wdm issue #18, but I failed to notice that the problem had been resolved. I later knew that from Jekyll issue #3721.
After changing the version number of wdm to 0.1.1, I could proceed further. The system output was fine.
Owner@Owner-PC MINGW64 /c/github/vincenttam.github.io (source)
$ gem install wdm -v '0.1.1'
Building native extensions. This could take a while...
Successfully installed wdm-0.1.1
Parsing documentation for wdm-0.1.1
Installing ri documentation for wdm-0.1.1
Done installing documentation for wdm after 0 seconds
1 gem installed
Owner@Owner-PC MINGW64 /c/github/vincenttam.github.io (source)
$ bundle install
Fetching gem metadata from https://rubygems.org/..........
Fetching version metadata from https://rubygems.org/..
Fetching dependency metadata from https://rubygems.org/.
Resolving dependencies...
Using rake 10.4.2
Using RedCloth 4.2.9
Using blankslate 2.1.2.4
Using hitimes 1.2.2
Using chunky_png 1.3.4
Using fast-stemmer 1.0.2
Using coffee-script-source 1.9.1
Using execjs 2.4.0
Using colorator 0.1
Using multi_json 1.11.0
Using sass 3.4.13
Using rb-fsevent 0.9.4
Using ffi 1.9.6
Using tilt 1.4.1
Using jekyll-gist 1.1.0
Using jekyll-paginate 1.1.0
Using kramdown 1.6.0
Using liquid 2.6.2
Using mercenary 0.3.5
Using posix-spawn 0.3.10
Using yajl-ruby 1.2.1
Using redcarpet 3.2.2
Using safe_yaml 1.0.4
Using jekyll-sitemap 0.8.0
Using rack 1.6.0
Using stringex 1.4.0
Using wdm 0.1.1 (was 0.1.0)
Using bundler 1.13.7
Using parslet 1.5.0
Using timers 4.0.1
Using classifier-reborn 2.0.3
Using coffee-script 2.3.0
Using compass-core 1.0.3
Using compass-import-once 1.0.5
Using jekyll-sass-converter 1.3.0
Using sass-globbing 1.0.0
Using rb-inotify 0.9.5
Using haml 4.0.6
Using pygments.rb 0.6.2
Using rack-protection 1.5.3
Installing toml 0.1.2
Installing celluloid 0.16.0
Installing jekyll-coffeescript 1.0.1
Installing compass 1.0.3
Installing sinatra 1.4.5
Installing listen 2.8.5
Installing jekyll-watch 1.2.1
Installing jekyll 2.5.3
Installing octopress-hooks 2.6.0
Installing octopress-date-format 2.0.2
Bundle complete! 14 Gemfile dependencies, 50 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
Post-install message from compass:
Compass is charityware. If you love it, please donate on our behalf at http:
//umdf.org/compass Thanks!
When I ran rake preview
, the follow line appeared.
bash: /c/Ruby23-x64/bin/rake: C:/Users/Justin/Projects/rubyinstaller/sandbox/rub
y23_mingw/bin/ruby.exe: bad interpreter: No such file or directory
I searched “rake install justin projects” on Google.
You may follow griest’s advice to have this problem
fixed. If this link were unluckily dead in the future, you might
leave a comment below after getting rid of Justin at the first line of
/c/Ruby23-x64/bin/rake
.
Octopress did work on my machine. Then I re-ran bundle install
under the local repository for my another blog, but the
same Celluloid error re-appeared. I don’t know how to
perform a celluloid downgrade to version 16.0 under that
repository. The version number for Celluloid was generated by the
system—I didn’t type it in Gemfile.lock
. As a result, I
switched to Ubuntu on Windows 10.
I pull the Git commits from the origin
of this blog to Git Bash on
M$ Win*. The Gemfile
has changed due to commit fbc3c0b.
I ran bundle install
according to the official documentation, and
got an unexpected error.1
Owner@OWNER-PC /c/github/vincenttam.github.io (source)
$ bundle install
DL is deprecated, please use Fiddle
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Bundler could not find compatible versions for gem "sass":
In snapshot (Gemfile.lock):
sass (3.2.19)
In Gemfile:
compass (~> 1.0.1) x64-mingw32 depends on
sass (< 3.5, >= 3.3.13) x64-mingw32
Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
Without updated gems, even though everything in the source
folder
is correct, one can’t generate an Octopress blog. How can one
get the gems updated?
I then tried to follow the suggestion, but received another error.
Owner@OWNER-PC /c/github/vincenttam.github.io (source)
Owner@OWNER-PC /c/github/vincenttam.github.io (source)
$ bundle update
DL is deprecated, please use Fiddle
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read
server certificate B: certificate verify failed (https://rubygems.org/gems/rake-
10.4.2.gem)
An error occurred while installing rake (10.4.2), and Bundler cannot continue.
Make sure that `gem install rake -v '10.4.2'` succeeds before bundling.
I ran the command in bold in the above message, and got similar messages.
Owner@OWNER-PC /c/github/vincenttam.github.io (source)
$ gem install rake -v '10.4.2'
ERROR: Could not find a valid gem 'rake' (= 10.4.2), here is why:
Unable to download data from https://rubygems.org/ - SSL_connect retur
ned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (
https://rubygems.org/specs.4.8.gz)
I googled “windows unable to download data from https //rubygems.org/ - ssl_connect returned=1”, and clicked on the first Stack Overflow question that I saw. I quickly skimmed through the first answer of this question, and read the last section “Windows note”, which referred interested readers to two places:
I clicked the first webpage, and quickly jumped to Luis Lavena’s response to the issue. Unlike the previous webpages, I read every word from the beginning to the third section this time, and read the Stack Overflow question again, before deciding what to be done.
I followed the instructions in the third section, instead of manually
downloading and inserting the PEM file back to the folder which the
command gem which rubygems
returned.
Owner@OWNER-PC /c/github/vincenttam.github.io (source)
$ gem install --local ~/Downloads/rubygems-update-2.0.15.gem
Successfully installed rubygems-update-2.0.15
Parsing documentation for rubygems-update-2.0.15
Installing ri documentation for rubygems-update-2.0.15
1 gem installed
Owner@OWNER-PC /c/github/vincenttam.github.io (source)
$ update_rubygems --no-ri --no-rdoc
RubyGems 2.0.15 installed
=== 2.0.14 / 2013-11-12
Bug fixes:
* Restore concurrent requires following the fix for ruby bug #8374. Pull
request #637 and issue #640 by Charles Nutter.
* Gem::Specification::remove_spec no longer checks for existence of the spec
to be removed. Issue #698 by Tiago Macedo.
* Restored wildcard handling when installing gems. Issue #697 by Chuck Remes.
* Added DigiCert High Assurance EV Root CA certificate for the cloudfront.net
certificate change.
* The Gem::RemoteFetcher tests now choose the test server port more reliably.
Pull Request #706 by akr.
------------------------------------------------------------------------------
RubyGems installed the following executables:
c:/Ruby200-x64/bin/gem
Owner@OWNER-PC /c/github/vincenttam.github.io (source)
$ gem uninstall rubygems-update -x
Removing update_rubygems
Successfully uninstalled rubygems-update-2.0.15
Then I ran bundle install
again, and I still got the same error
shown at the very beginning of the post. However, I could update the
gems.
Owner@OWNER-PC /c/github/vincenttam.github.io (source)
$ bundle update
DL is deprecated, please use Fiddle
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Installing rake 10.4.2 (was 10.3.2)
Using RedCloth 4.2.9
Using blankslate 2.1.2.4
Installing hitimes 1.2.2
Installing timers 4.0.1 (was 1.1.0)
Installing celluloid 0.16.0 (was 0.15.2)
Installing chunky_png 1.3.3 (was 1.3.1)
Using fast-stemmer 1.0.2
Installing classifier-reborn 2.0.3 (was 2.0.1)
Using coffee-script-source 1.8.0
Installing execjs 2.2.2 (was 2.2.1)
Using coffee-script 2.3.0
Using colorator 0.1
Installing multi_json 1.10.1
Installing sass 3.4.9 (was 3.2.19)
Installing compass-core 1.0.1
Installing compass-import-once 1.0.5
Using rb-fsevent 0.9.4
Installing ffi 1.9.6 (was 1.9.3)
Using rb-inotify 0.9.5
Installing compass 1.0.1 (was 0.12.7)
Using tilt 1.4.1
Installing haml 4.0.6 (was 4.0.5)
Installing jekyll-coffeescript 1.0.1 (was 1.0.0)
Using jekyll-gist 1.1.0
Installing jekyll-paginate 1.1.0 (was 1.0.0)
Installing jekyll-sass-converter 1.3.0 (was 1.2.0)
Installing listen 2.8.4 (was 2.7.9)
Installing jekyll-watch 1.2.0 (was 1.1.0)
Installing kramdown 1.5.0 (was 1.4.1)
Using liquid 2.6.1
Installing mercenary 0.3.5 (was 0.3.4)
Using posix-spawn 0.3.9
Using yajl-ruby 1.1.0
Using pygments.rb 0.6.0
Installing redcarpet 3.2.2 (was 3.1.2)
Installing safe_yaml 1.0.4 (was 1.0.3)
Using parslet 1.5.0
Installing toml 0.1.2 (was 0.1.1)
Installing jekyll 2.5.3 (was 2.3.0)
Installing jekyll-sitemap 0.7.0 (was 0.5.1)
Installing octopress-hooks 2.2.3 (was 2.2.1)
Installing octopress-date-format 2.0.2 (was 2.0.1)
Installing rack 1.6.0 (was 1.5.2)
Using rack-protection 1.5.3
Using rubypants 0.2.0
Using sass-globbing 1.0.0
Using sinatra 1.4.5
Using stringex 1.4.0
Using wdm 0.1.0
Using bundler 1.7.2
Your bundle is updated!
To save space in the hard disk, I removed the old versions of gems with a short and simple command.
Owner@OWNER-PC /c/github/vincenttam.github.io (source)
$ gem cleanup
Cleaning up installed gems...
Attempting to uninstall rake-10.3.2
Successfully uninstalled rake-10.3.2
Attempting to uninstall rack-1.5.2
Successfully uninstalled rack-1.5.2
Attempting to uninstall octopress-date-format-2.0.1
Successfully uninstalled octopress-date-format-2.0.1
Attempting to uninstall octopress-hooks-2.2.1
Successfully uninstalled octopress-hooks-2.2.1
Attempting to uninstall jekyll-sitemap-0.5.1
Successfully uninstalled jekyll-sitemap-0.5.1
Attempting to uninstall jekyll-2.3.0
Successfully uninstalled jekyll-2.3.0
Attempting to uninstall jekyll-watch-1.1.0
Successfully uninstalled jekyll-watch-1.1.0
Attempting to uninstall listen-2.7.9
Successfully uninstalled listen-2.7.9
Attempting to uninstall jekyll-sass-converter-1.2.0
Successfully uninstalled jekyll-sass-converter-1.2.0
Attempting to uninstall jekyll-coffeescript-1.0.0
Successfully uninstalled jekyll-coffeescript-1.0.0
Attempting to uninstall jekyll-paginate-1.0.0
Successfully uninstalled jekyll-paginate-1.0.0
Attempting to uninstall toml-0.1.1
Successfully uninstalled toml-0.1.1
Attempting to uninstall redcarpet-3.1.2
Successfully uninstalled redcarpet-3.1.2
Attempting to uninstall safe_yaml-1.0.3
Successfully uninstalled safe_yaml-1.0.3
Attempting to uninstall mercenary-0.3.4
Successfully uninstalled mercenary-0.3.4
Attempting to uninstall kramdown-1.4.1
Successfully uninstalled kramdown-1.4.1
Attempting to uninstall haml-4.0.5
Successfully uninstalled haml-4.0.5
Attempting to uninstall ffi-1.9.3-x64-mingw32
Successfully uninstalled ffi-1.9.3-x64-mingw32
Attempting to uninstall execjs-2.2.1
Successfully uninstalled execjs-2.2.1
Attempting to uninstall compass-0.12.7
Successfully uninstalled compass-0.12.7
Attempting to uninstall classifier-reborn-2.0.1
Successfully uninstalled classifier-reborn-2.0.1
Attempting to uninstall chunky_png-1.3.1
Successfully uninstalled chunky_png-1.3.1
Attempting to uninstall celluloid-0.15.2
Successfully uninstalled celluloid-0.15.2
Attempting to uninstall timers-1.1.0
Successfully uninstalled timers-1.1.0
Attempting to uninstall sass-3.2.19
Successfully uninstalled sass-3.2.19
Clean Up Complete
Updating Octopress in Octopress Documentation. ↩
This noon, I tried to use the kramdown command line utility to generate PDF files, but failed.
$ kramdown test.tex -o pdf > test.pdf
/home/owner/.rvm/rubies/ruby-2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/ke
rnel_require.rb:55:in `require': cannot load such file -- prawn (LoadError)
from /home/owner/.rvm/rubies/ruby-2.1.2/lib/ruby/site_ruby/2.1.0/rubygem
s/core_ext/kernel_require.rb:55:in `require'
from /home/owner/.rvm/gems/ruby-2.1.2/gems/kramdown-1.4.1/lib/kramdown/c
onverter/pdf.rb:10:in `<top (required)>'
from /home/owner/.rvm/gems/ruby-2.1.2/gems/kramdown-1.4.1/lib/kramdown/d
ocument.rb:119:in `const_defined?'
from /home/owner/.rvm/gems/ruby-2.1.2/gems/kramdown-1.4.1/lib/kramdown/d
ocument.rb:119:in `method_missing'
from /home/owner/.rvm/gems/ruby-2.1.2/gems/kramdown-1.4.1/bin/kramdown:6
1:in `block in <top (required)>'
from /home/owner/.rvm/gems/ruby-2.1.2/gems/kramdown-1.4.1/bin/kramdown:6
1:in `each'
from /home/owner/.rvm/gems/ruby-2.1.2/gems/kramdown-1.4.1/bin/kramdown:6
1:in `<top (required)>'
from /home/owner/.rvm/gems/ruby-2.1.2/bin/kramdown:23:in `load'
from /home/owner/.rvm/gems/ruby-2.1.2/bin/kramdown: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>'
I searched Google for “kramdown pdf”, and find this question useful. It linked to a page introducing Prawn.
I used the testing code there to figure out that the above problem had arised because I didn’t install the Ruby gem.
$ gem install prawn
Fetching: ttfunk-1.4.0.gem (100%)
Successfully installed ttfunk-1.4.0
Fetching: pdf-core-0.4.0.gem (100%)
Successfully installed pdf-core-0.4.0
Fetching: prawn-1.3.0.gem (100%)
********************************************
A lot has changed recently in Prawn.
Please read the changelog for details:
https://github.com/prawnpdf/prawn/wiki/CHANGELOG
********************************************
Successfully installed prawn-1.3.0
3 gems installed
But I still can’t run the sample code correctly. Finally, I use pandoc.
]]>This afternoon, I tried running rake
on Ruby 2.1.2. Unluckily, I
failed.
The above problem could be fixed by simply changing nil
to null
at
the second line of source/_includes/custom/category_feed.xml
, so
it’s not really a problem.
First, the image popup plugin complained about the new version of gems.
I tried to replace all imgpopup
by img
to find further problems
first.
[owner@localhost ~/octopress]$ rake generate
## Generating Site with Jekyll
unchanged sass/print.scss
identical source/stylesheets/screen.css
Configuration file: /home/owner/octopress/_config.yml
Source: source
Destination: public
Generating...
Liquid Exception: undefined method `safe_wrap' for #<<Jekyll::ImgPopup:0xa45c82
4>> in _posts/2013-08-16-edit-latex-equations-in-vim.html/#excerpt
jekyll 2.3.0 | Error: undefined method `safe_wrap' for #<<Jekyll::ImgPopup:0xa4
5c824>>
Second, it’s the gsub
method again! I’m sorry to that I has been
tired of reading Ruby’s documentation, so I decided to reset my commit
history to the tip of origin/source
, and revert the default RVM
version to 1.9.3 again by rvm use --default 1.9.3
.
Since the update of Octopress source code, this post won’t make
sense anymore. I can’t find a way to use MathJax in category list
entries anymore because category
in plugins/category_generator.rb
and plugins/category_list_tag.rb
have both been changed to lower
case. I don’t know how to track the Ruby code to revert it.
I imported some posts in my old blog on WordPress.com, and some categories like “$\rm \LaTeX$-Suite” weren’t displayed properly. Moreover, the link for some categories like “C/C++” was dead in Watson’s Category List Plugin.
Unlike two months ago1, I now think that it’s better for me to find out why the catergory list failed to generate a correct URL for a category page, but the default links for category pages in the blog archive are right.
I certainly know the precise location of the part of
plugins/category_list_tag.rb
that has generated the erroneous
links for some category pages.
category_url = File.join(category_dir, category.gsub(/_|\P{Word}/, '-').gsub(/-{2,}/, '-').downcase)
I tried to browse the code in plugins/category_generator.rb
to find
out Octopress’s way of generating the URL of categories and what’s
wrong with the above method to extract category_url
.
At the beginning, I saw category_dir
, and used *
and n
in Vim to
explore the script. I did so because in
plugins/category_list_tag.rb
, category_dir
was a part of
category_url
. I jumped through the category_dir
s for a few times
since they weren’t related to the generation of the URL for a
category page. When the cursor was at line 109, I discovered the word
category.to_url
. I typed *
on to_url
, and was brought to line
176. This category.to_url
was in category_link
method. From the
<a>
tag inside this method, I’m sure that I should give to_url
a
try.
"<a class='category' href='https://vincenttam.github.io/#{dir}/#{category.to_url}/'>#{category}</a>"
To test if my guess is correct, I used to most primitive method for
debugging: insert puts category + ": " + category.to_url
below the
line that defined category_url
in plugins/category_list_tag.rb
.
After that, I generated and previewed the site.
For the terminal output, I could see that catergory
was the name of
the a category, while category_url
was part of the correct URL for
a category page. Therefore, in plugins/category_list_tag.rb
, the
method that generated category_url
should be changed like this:
category_url = File.join(category_dir, category.to_url)
Last month, I used a specfic way to get things work.
↩As I am not going to spend most of my time to study IT, I aimed at merely changing “LaTeX” to “$\rm \LaTeX$”.