3

Everyone, I used sudo gem install jekyll to install jekyll on my Fedora 20 and got the following error. I've successfully installed ruby and rubygems, and it seems to me the jekyll has been installed. But when I enter jekyll serve, the pages won't be created and I got the similar message. I'm new to fedora and ruby, thanks for any help.

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>'
HDJEMAI
  • 7,766
  • 41
  • 60
  • 81
user3805728
  • 89
  • 1
  • 10

2 Answers2

4

try to install ruby-devel by this -

sudo yum install ruby-devel

and the try to re install jekyll -

sudo gem install jekyll

And also make sure you have nodejs installed,

sudo yum install nodejs
Anurag-Sharma
  • 4,119
  • 5
  • 23
  • 37
3

This is a problem with your JSON parser. See cannot load such file -- json/pure in your stacktrace? You need to be able to successfully run gem install json or gem install json_pure before you can run Jekyll.

bwest
  • 8,098
  • 3
  • 23
  • 54
  • Thanks, I tried your solution and installed some more required software and it worked. I still got one more question to ask, in this [post](http://stackoverflow.com/questions/17033621/jekyll-wont-load-anymore-after-update?rq=1), people say `sudo gem install jekyll` and `gem install jekyll` have different effects, and enter `gem list --all` with or without `sudo`, I got a whole different list of gems. Why is that? – user3805728 Jul 06 '14 at 03:13
  • The `sudo` prefix for the gem command gives you a global perspective on your rubygems installation. So, if you run simply `gem install` (without sudo or root permissions) you will install a particular gem locally, under your current home directory. – sentenza Oct 22 '14 at 09:24