V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
acking
V2EX  ›  问与答

有人在win7下折腾jekyll吗?

  •  
  •   acking · 2014-01-08 13:30:11 +08:00 · 2900 次点击
    这是一个创建于 3981 天前的主题,其中的信息可能已经有所发展或是发生改变。
    ruby 2.0.0p195 (2013-05-14) [x64-mingw32] 环境以及搭建好了
    运行gem install jekyll 报错,无法继续往下
    porter_wrap.c:27:16: warning: cast to pointer from integer of different size
    porter_wrap.c:27:16: warning: cast to pointer from integer of different size
    porter_wrap.c:27:16: warning: cast to pointer from integer of different size
    porter_wrap.c:27:34: warning: cast to pointer from integer of different size
    porter_wrap.c:27:34: warning: cast to pointer from integer of different size
    porter_wrap.c:27:34: warning: cast to pointer from integer of different size
    porter_wrap.c:28:7: warning: cast to pointer from integer of different size
    porter_wrap.c:28:7: warning: cast to pointer from integer of different size
    porter_wrap.c:28:7: warning: cast to pointer from integer of different size
    porter_wrap.c:20:17: warning: unused variable 'i'
    make: *** [porter_wrap.o] Error 1

    Gem files will remain installed in C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/fast-
    stemmer-1.0.2 for inspection.
    Results logged to C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/fast-stemmer-1.0.2/ext
    /gem_make.out

    检测了mkmf.log

    "x86_64-w64-mingw32-gcc -o conftest.exe -IC:/Ruby200-x64/include/ruby-2.0.0/x64-mingw32 -IC:/Ruby200-x64/include/ruby-2.0.0/ruby/backward -IC:/Ruby200-x64/include/ruby-2.0.0 -I. -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -march=native conftest.c -L. -LC:/Ruby200-x64/lib -L. -lx64-msvcrt-ruby200 -lshell32 -lws2_32 -limagehlp -lshlwapi "
    checked program was:
    /* begin */
    1: #include "ruby.h"
    2:
    3: #include <winsock2.h>
    4: #include <windows.h>
    5: int main(int argc, char **argv)
    6: {
    7: return 0;
    8: }
    /* end */
    求大神解决,百度google都无解,因为不太懂ruby。不知如何是好!!!
    第 1 条附言  ·  2014-01-08 16:01:28 +08:00
    封贴
    5 条回复    1970-01-01 08:00:00 +08:00
    acking
        1
    acking  
    OP
       2014-01-08 13:34:10 +08:00
    不要沉,顶起来
    caonan
        2
    caonan  
       2014-01-08 13:52:25 +08:00
    抱歉,没遇到过。

    在Windows下面搞就是自找苦吃,我上次也是遇到问题无数。

    我当时是主要是:

    1、含有中文的文件需要保存为UTF-8无BOM格式编码。

    2. 在Ruby的安装路径找到 文件convertible.rb

    C:\Ruby193\lib\ruby\gems\1.9.1\gems\jekyll-0.12.0\lib\jekyll\convertible.rb

    将27行修改为:self.content = File.read(File.join(base, name), :encoding => 'utf-8')

    其他暂时没遇到过
    woodfish
        3
    woodfish  
       2014-01-08 14:10:25 +08:00
    http://rubyinstaller.org/downloads/ 换个编译链,下载对应的ruby和DevKit吧

    Ruby 1.8.6 to 1.9.3: tdm-32-4.5.2
    Ruby 2.0.0: mingw64-32-4.7.2
    Ruby 2.0.0 x64 (64bits): mingw64-64-4.7.2
    loading
        4
    loading  
       2014-01-08 14:51:41 +08:00 via iPhone
    如果是我装虚拟机ubuntu,我在mac上用pd全自动装,懒得折腾那么多
    acking
        5
    acking  
    OP
       2014-01-08 16:00:52 +08:00   ❤️ 1
    @caonan 现在如果中文乱码不用修改convertible.rb文件里,只用在_config.yml文件中添加encoding: utf-8就可以了。
    感谢各位,重新安装Ruby就好了。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5115 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 09:44 · PVG 17:44 · LAX 01:44 · JFK 04:44
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.