Ruby gem install jekyll 请问这个错误 instance of Date needs to have method `marshal_load'

jiyinyiyong · 2011年12月29日 · 最后由 jiyinyiyong 回复于 2013年05月23日 · 9210 次阅读

想尝试 Jekyll 的, 尝试了 taobao 和官网两个 repo, 都遇到这个错误

$ gem install jekyll
ERROR:  While executing gem ... (TypeError)
    instance of Date needs to have method `marshal_load'

系统是 Ubuntu, 1.8.7 和 1.9.1 都用过去, 不行 然后装上 RVM, 照说再不是版本的问题了吧?

$ ruby -v
ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-linux]
$ gem -v
1.8.10

结果还是上面的问题, 求助...

你的环境有问题!

~ ‹ruby-1.9.2›  $ gem source
http://ruby.taobao.org
~ ‹ruby-1.9.2›  $ gem install jekyll 
Fetching: liquid-2.3.0.gem (100%)
Successfully installed liquid-2.3.0
Fetching: fast-stemmer-1.0.0.gem (100%)
Building native extensions.  This could take a while...
Successfully installed fast-stemmer-1.0.0
Fetching: classifier-1.3.3.gem (100%)
Successfully installed classifier-1.3.3
Fetching: directory_watcher-1.4.1.gem (100%)
Successfully installed directory_watcher-1.4.1
Fetching: syntax-1.0.0.gem (100%)
Successfully installed syntax-1.0.0
Fetching: maruku-0.6.0.gem (100%)
Successfully installed maruku-0.6.0
Fetching: kramdown-0.13.4.gem (100%)
Successfully installed kramdown-0.13.4
Fetching: posix-spawn-0.3.6.gem (100%)
Building native extensions.  This could take a while...
Successfully installed posix-spawn-0.3.6
Fetching: albino-1.3.3.gem (100%)
Successfully installed albino-1.3.3
Fetching: jekyll-0.11.2.gem (100%)
Successfully installed jekyll-0.11.2
Installing ri documentation for liquid-2.3.0
Installing darkfish documentation for liquid-2.3.0
Installing ri documentation for fast-stemmer-1.0.0
Installing darkfish documentation for fast-stemmer-1.0.0
Installing ri documentation for classifier-1.3.3
Installing darkfish documentation for classifier-1.3.3
Installing ri documentation for directory_watcher-1.4.1
Installing darkfish documentation for directory_watcher-1.4.1
Installing ri documentation for syntax-1.0.0
Installing darkfish documentation for syntax-1.0.0
Couldn't find file to include 'MaRuKu.txt' from lib/maruku.rb
Installing ri documentation for maruku-0.6.0
Installing darkfish documentation for maruku-0.6.0
Installing ri documentation for kramdown-0.13.4
Installing darkfish documentation for kramdown-0.13.4
Installing ri documentation for posix-spawn-0.3.6
Installing darkfish documentation for posix-spawn-0.3.6
Installing ri documentation for albino-1.3.3
Installing darkfish documentation for albino-1.3.3
Installing ri documentation for jekyll-0.11.2
Installing darkfish documentation for jekyll-0.11.2
10 gems installed

我等了一个小时终于 RVM 装上 1.9.2 (都有死心去装 Octopress 的感觉了..) 看楼上用 1.9 我用 1.9.. 下面, ToT 居然这样成功了 Jekyll 的文档里还是 ruby1.8-dev 的, 之前 Ubuntu 上的 1,9,1 无法 Build.. 不过总算装成功了..

$ gem install jekyll
Fetching: liquid-2.3.0.gem (100%)
Fetching: fast-stemmer-1.0.0.gem (100%)
Building native extensions.  This could take a while...
Fetching: classifier-1.3.3.gem (100%)
Fetching: directory_watcher-1.4.1.gem (100%)
Fetching: syntax-1.0.0.gem (100%)
Fetching: maruku-0.6.0.gem (100%)
Fetching: kramdown-0.13.4.gem (100%)
Fetching: posix-spawn-0.3.6.gem (100%)
Building native extensions.  This could take a while...
Fetching: albino-1.3.3.gem (100%)
Fetching: jekyll-0.11.2.gem (100%)
Successfully installed liquid-2.3.0
Successfully installed fast-stemmer-1.0.0
Successfully installed classifier-1.3.3
Successfully installed directory_watcher-1.4.1
Successfully installed syntax-1.0.0
Successfully installed maruku-0.6.0
Successfully installed kramdown-0.13.4
Successfully installed posix-spawn-0.3.6
Successfully installed albino-1.3.3
Successfully installed jekyll-0.11.2
10 gems installed
Installing ri documentation for liquid-2.3.0...
Installing ri documentation for fast-stemmer-1.0.0...
Installing ri documentation for classifier-1.3.3...
Installing ri documentation for directory_watcher-1.4.1...
Installing ri documentation for syntax-1.0.0...
Installing ri documentation for maruku-0.6.0...
Couldn't find file to include 'MaRuKu.txt' from lib/maruku.rb
Installing ri documentation for kramdown-0.13.4...
Installing ri documentation for posix-spawn-0.3.6...
Installing ri documentation for albino-1.3.3...
Installing ri documentation for jekyll-0.11.2...
Installing RDoc documentation for liquid-2.3.0...
Installing RDoc documentation for fast-stemmer-1.0.0...
Installing RDoc documentation for classifier-1.3.3...
Installing RDoc documentation for directory_watcher-1.4.1...
Installing RDoc documentation for syntax-1.0.0...
Installing RDoc documentation for maruku-0.6.0...
Couldn't find file to include 'MaRuKu.txt' from lib/maruku.rb
Installing RDoc documentation for kramdown-0.13.4...
Installing RDoc documentation for posix-spawn-0.3.6...
Installing RDoc documentation for albino-1.3.3...
Installing RDoc documentation for jekyll-0.11.2...

我觉得你不妨死了这条心,然后去装 Octopress,呵呵 :-)

把 1.9.1 卸了吧

今天同事也有同样的问题,我也尝试了一下发现,1.8.7 安装 jekyll 都会出现这个错误。 解决办法就是升级 Ruby 到 1.9.3+

喵旧帖.. 说起来到现在 Jekyll 都没学会, 前几天装一次结果 Python 3 Pyramid 报错 正在围观支持 Python 3

需要 登录 后方可回复, 如果你还没有账号请 注册新账号