微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

ruby – 在linux上安装jekyll(fedora 20)

大家好,我用sudo gem install jekyll在我的Fedora 20上安装jekyll并得到以下错误.我已经成功安装了 rubyrubygems,在我看来已经安装了jekyll.但是当我输入jekyll serve时,页面将不会被创建,我收到了类似的消息.我是fedora和ruby的新手,感谢您的帮助.

Successfully installed jekyll-2.1.0
/usr/local/share/ruby/site_ruby/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- json/pure (LoadError)
    from /usr/local/share/ruby/site_ruby/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/share/gems/gems/json-1.7.7/lib/json.rb:60:in `rescue in <module:JSON>'
    from /usr/share/gems/gems/json-1.7.7/lib/json.rb:57:in `<module:JSON>'
    from /usr/share/gems/gems/json-1.7.7/lib/json.rb:54:in `<top (required)>'
    from /usr/local/share/ruby/site_ruby/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/local/share/ruby/site_ruby/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/share/gems/gems/rdoc-4.0.1/lib/rdoc/text.rb:16:in `<top (required)>'
    from /usr/share/gems/gems/rdoc-4.0.1/lib/rdoc/code_object.rb:28:in `<class:CodeObject>'
    from /usr/share/gems/gems/rdoc-4.0.1/lib/rdoc/code_object.rb:26:in `<top (required)>'
    from /usr/share/gems/gems/rdoc-4.0.1/lib/rdoc/generator/markup.rb:59:in `<top (required)>'
    from /usr/local/share/ruby/site_ruby/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/local/share/ruby/site_ruby/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/share/gems/gems/rdoc-4.0.1/lib/rdoc/generator/darkfish.rb:6:in `<top (required)>'
    from /usr/local/share/ruby/site_ruby/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/local/share/ruby/site_ruby/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/share/gems/gems/rdoc-4.0.1/lib/rdoc/rdoc.rb:565:in `<top (required)>'
    from /usr/local/share/ruby/site_ruby/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/local/share/ruby/site_ruby/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/share/gems/gems/rdoc-4.0.1/lib/rdoc/rubygems_hook.rb:73:in `load_rdoc'
    from /usr/share/gems/gems/rdoc-4.0.1/lib/rdoc/rubygems_hook.rb:238:in `setup'
    from /usr/share/gems/gems/rdoc-4.0.1/lib/rdoc/rubygems_hook.rb:151:in `generate'
    from /usr/share/gems/gems/rdoc-4.0.1/lib/rdoc/rubygems_hook.rb:56:in `block in generation_hook'
    from /usr/share/gems/gems/rdoc-4.0.1/lib/rdoc/rubygems_hook.rb:55:in `each'
    from /usr/share/gems/gems/rdoc-4.0.1/lib/rdoc/rubygems_hook.rb:55:in `generation_hook'
    from /usr/local/share/ruby/site_ruby/rubygems/request_set.rb:178:in `call'
    from /usr/local/share/ruby/site_ruby/rubygems/request_set.rb:178:in `block in install'
    from /usr/local/share/ruby/site_ruby/rubygems/request_set.rb:177:in `each'
    from /usr/local/share/ruby/site_ruby/rubygems/request_set.rb:177:in `install'
    from /usr/local/share/ruby/site_ruby/rubygems/commands/install_command.rb:249:in `install_gem'
    from /usr/local/share/ruby/site_ruby/rubygems/commands/install_command.rb:291:in `block in install_gems'
    from /usr/local/share/ruby/site_ruby/rubygems/commands/install_command.rb:287:in `each'
    from /usr/local/share/ruby/site_ruby/rubygems/commands/install_command.rb:287:in `install_gems'
    from /usr/local/share/ruby/site_ruby/rubygems/commands/install_command.rb:202:in `execute'
    from /usr/local/share/ruby/site_ruby/rubygems/command.rb:307:in `invoke_with_build_args'
    from /usr/local/share/ruby/site_ruby/rubygems/command_manager.rb:167:in `process_args'
    from /usr/local/share/ruby/site_ruby/rubygems/command_manager.rb:137:in `run'
    from /usr/local/share/ruby/site_ruby/rubygems/gem_runner.rb:54:in `run'
    from /bin/gem:21:in `<main>'

解决方法

尝试安装ruby-devel –

sudo yum install ruby-devel

并尝试重新安装jekyll –

sudo gem install jekyll

并确保安装了nodejs,

sudo yum install nodejs

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐