2013-11-15 155 views
2

我遇到過這個問題:無法在Ubuntu上運行哲基爾12.04

gabriele @ osiris { ~ } [ ven nov 15 ] [ 12:57 ] 
> jekyll 

/var/lib/gems/1.8/gems/highline-1.6.19/lib/highline/system_extensions.rb:210: warning: Insecure world writable dir /home/gabriele in PATH, mode 040777 
/var/lib/gems/1.8/gems/commander-4.1.3/lib/commander/runner.rb:365:in `require_program': program version required (Commander::Runner::CommandError) 
     from /var/lib/gems/1.8/gems/commander-4.1.3/lib/commander/runner.rb:364:in `each' 
     from /var/lib/gems/1.8/gems/commander-4.1.3/lib/commander/runner.rb:364:in `require_program' 
     from /var/lib/gems/1.8/gems/commander-4.1.3/lib/commander/runner.rb:52:in `run!' 
     from /var/lib/gems/1.8/gems/commander-4.1.3/lib/commander/delegates.rb:7:in `run!' 
     from /var/lib/gems/1.8/gems/commander-4.1.3/lib/commander/import.rb:10 
     from /usr/local/bin/jekyll:19 
/usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require': no such file to load -- json (LoadError) 
     from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `require' 
     from /var/lib/gems/1.8/gems/jekyll-1.3.0/bin/../lib/jekyll/filters.rb:2 
     from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require' 
     from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `require' 
     from /var/lib/gems/1.8/gems/jekyll-1.3.0/bin/../lib/jekyll.rb:43 
     from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require' 
     from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `require' 
     from /var/lib/gems/1.8/gems/jekyll-1.3.0/bin/jekyll:7 
     from /usr/local/bin/jekyll:19:in `load' 
     from /usr/local/bin/jekyll:19 

我已經安裝傑奇在Ubuntu 12.04與

sudo apt-get install ruby1.9.1-dev && sudo gem install jekyll 

這是我的寶石ENV後:

RubyGems Environment: 
    - RUBYGEMS VERSION: 1.8.15 
    - RUBY VERSION: 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux] 
    - INSTALLATION DIRECTORY: /var/lib/gems/1.8 
    - RUBY EXECUTABLE: /usr/bin/ruby1.8 
    - EXECUTABLE DIRECTORY: /usr/local/bin 
    - RUBYGEMS PLATFORMS: 
    - ruby 
    - x86_64-linux 
    - GEM PATHS: 
    - /var/lib/gems/1.8 
    - /home/gabriele/.gem/ruby/1.8 
    - GEM CONFIGURATION: 
    - :update_sources => true 
    - :verbose => true 
    - :benchmark => false 
    - :backtrace => false 
    - :bulk_threshold => 1000 
    - REMOTE SOURCES: 
    - http://rubygems.org/ 

我該如何解決它?

+0

我也有這個問題,我已經更新了我所有的寶石,並確保寶石json安裝,但無法弄清楚如何過去... – defmeta

+0

@defmeta parkr的解決方案完美解決了這個問題。 –

+0

[運行jekyll新命令時出錯]可能重複(http://stackoverflow.com/questions/19788258/error-when-running-jekyll-new-command) –

回答

4

正在運行gem install json應該修復LoadError

當可執行文件加載出現問題時(此例中爲bin/jekyll),Commander會拋出program version required錯誤。由於1.8.7無法加載內部的json庫(在1.9中引入),因此您需要安裝gem。