17 February 2015
I’ve been using Octopress on Mac OS X (i.e. have no problem). But, recently I’ve decided to run my blog on Windows machine and felt pain. Ahh, Octopress uses bunch of native extentions which actually cause a lot of cross-platform issues. My first attempt was to try JRuby due to his better Windows support, but got this:
$ bundle install Fetching gem metadata from https://rubygems.org/......... Installing rake (10.4.2) Installing RedCloth (4.2.9) Using blankslate (18.104.22.168) Installing hitimes (1.2.2) Installing timers (4.0.1) Installing celluloid (0.16.0) Installing chunky_png (1.3.3) Installing fast-stemmer (1.0.2) with native extensions Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension . D:/Tools/JRuby/jruby-1.7.0/bin/jruby.exe extconf.rb NotImplementedError: C extension support is not enabled. Pass -Xcext.enabled=true to JRuby or set JRUBY_OPTS or modify .jrubyrc to enable. (root) at D:/Tools/JRuby/jruby-1.7.0/lib/ruby/shared/mkmf.rb:8 require at org/jruby/RubyKernel.java:1019 (root) at D:/Tools/JRuby/jruby-1.7.0/lib/ruby/shared/rubygems/custom_require.rb:1 (root) at extconf.rb:1 Gem files will remain installed in D:/Tools/JRuby/jruby-1.7.0/lib/ruby/gems/shared/gems/fast-stemmer-1.0.2 for inspection. Results logged to D:/Tools/JRuby/jruby-1.7.0/lib/ruby/gems/shared/gems/fast-stemmer-1.0.2/ext/gem_make.out An error occurred while installing fast-stemmer (1.0.2), and Bundler cannot continue. Make sure that `gem install fast-stemmer -v '1.0.2'` succeeds before bundling.
rubyinstaller-2.1.5-x64.exe in my case) and install RubyInstaller. I installed in
rubygems via running
gem update and you should get the next error:
$ gem update Updating installed gems ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError) SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://api.rubygems.org/specs.4.8.gz)
It’s well known
rubygems issues with ready to use solution:
$ gem which rubygems D:/Tools/Ruby/Ruby21-x64/lib/ruby/2.1.0/rubygems.rb
$ copy AddTrustExternalCARoot-2048.pem D:\Tools\Ruby\Ruby21-x64\lib\ruby\2.1.0\rubygems\ssl_certs
Now it’s time to clone Octopress blog and run it. Unfortunatelly, there are some minor issues which still must be fixed.
d:\Tools\Ruby\DevKit_2.1_x64\in my case)
ruby dk.rb initwhich generate
- D:/Tools/Ruby/Ruby21-x64to the end of this file.
ruby dk.rb install
See my Development Kit
# This configuration file contains the absolute path locations of all # installed Rubies to be enhanced to work with the DevKit. This config # file is generated by the 'ruby dk.rb init' step and may be modified # before running the 'ruby dk.rb install' step. To include any installed # Rubies that were not automagically discovered, simply add a line below # the triple hyphens with the absolute path to the Ruby root directory. # # Example: # # --- # - C:/ruby19trunk # - C:/ruby192dev # --- - D:/Tools/Ruby/Ruby21-x64
I assume that blog was previously cloned. Now, we should perform “traditional” Ruby project ceremony:
gem install bundler