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

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

大家好,我用sudo gem install jekyll在我的Fedora 20上安装jekyll并得到以下错误.我已经成功安装了ruby和rubygems,在我看来已经安装了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

本文标题为:ruby – 在linux上安装jekyll(fedora 20)

基础教程推荐