我正在关注允许在我的Droplet上托管Jekyll的this tutorial。我的一切都在我的机器上运行,现在可以在数字海洋上设置所有东西。
apt-get install git-core
curl -L https://get.rvm.io | bash -s stable --ruby=2.0.0
到目前为止一切顺利:
# sudo gem install jekyll
Successfully installed jekyll-1.3.0
1 gem installed
Installing ri documentation for jekyll-1.3.0...
Installing RDoc documentation for jekyll-1.3.0...
然后当我尝试用jekyll做某事时出现错误:
root@jackrabbit:~# jekyll
/usr/lib/ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find jekyll (>= 0) amongst [bundler-1.3.5, bundler-unload-1.0.2, executable-hooks-1.2.6, liquid-2.5.4, rake- 10.1.0, rubygems-bundler-1.4.2, rvm-1.11.3.8] (Gem::LoadError)
from /usr/lib/ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from /usr/lib/ruby/1.9.1/rubygems.rb:1231:in `gem'
from /usr/local/bin/jekyll:22:in `<main>'
我检查了宝石清单:
root@jackrabbit:~# gem list
*** LOCAL GEMS ***
bigdecimal (1.2.0)
bundler (1.3.5)
bundler-unload (1.0.2)
executable-hooks (1.2.6)
io-console (0.4.2)
json (1.7.7)
liquid (2.5.4)
minitest (4.3.2)
psych (2.0.0)
rake (10.1.0, 0.9.6)
rdoc (4.0.0)
rubygems-bundler (1.4.2)
rvm (1.11.3.8)
test-unit (2.0.0.0)
我可以看到jekyll不存在。我做错了什么?还有另一种方法可以确保在ubuntu上正确安装jekyll吗?
编辑:
重新安装jekyll时,我现在收到这个新错误:
root@jackrabbit:~# gem install jekyll
Building native extensions. This could take a while...
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.
/usr/local/rvm/rubies/ruby-2.0.0-p353/bin/ruby extconf.rb
Gem files will remain installed in /usr/local/rvm/gems/ruby-2.0.0-p353/gems/fast-stemmer-1.0.2 for inspection.
Results logged to /usr/local/rvm/gems/ruby-2.0.0-p353/gems/fast-stemmer-1.0.2/ext/gem_make.out
这可能有助于理解问题。
答案 0 :(得分:3)
Jekyll使用ubuntu ruby 1.9.3
工作得很好# for Ubuntu 12.04
sudo apt-get update
sudo apt-get install ruby1.9.1 ruby1.9.1-dev \
rubygems1.9.1 irb1.9.1 ri1.9.1 rdoc1.9.1 \
build-essential libopenssl-ruby1.9.1 libssl-dev zlib1g-dev
# for Ubuntu 14.04
sudo apt-get update
sudo apt-get install ruby ruby1.9.1-dev ri1.9.1 node-js
然后你只需要安装Jekyll
sudo gem install bundler
sudo gem install jekyll