我在Ubuntu 14.04尝试使用此过程为gitHub页面设置Jeckyll:https://help.github.com/articles/using-jekyll-with-pages/
我对linux比较陌生,所以在解决问题时我基本上不知道我在做什么。我希望有人能指引我指出正确的方向。
我正在尝试在上面链接的步骤中执行第2步。 gem install bundler
。看来我在某处弄乱了某些东西(或者我错过了依赖项?)。在任何情况下,宝石似乎都有问题,特别是gem install
。如果我which gem
,我会/usr/local/bin/gem
。
但是gem install
会出现以下错误:
ERROR: Loading command: install (LoadError)
cannot load such file -- zlib
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass
所以我尝试确保安装了zlib,但看起来我已经拥有了它?
$ sudo apt-get install zlib1g-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
zlib1g-dev is already the newest version.
zlib1g-dev set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 36 not upgraded.
然后我看了gem install help
并得到了一些有趣的输出......看起来有一堆丢失的命令,包括install
命令?怎么了?:
$ gem help commands
ERROR: Loading command: build (LoadError)
cannot load such file -- zlib
ERROR: Loading command: cert (NameError)
uninitialized constant Gem::Commands::CertCommand
ERROR: Loading command: check (LoadError)
cannot load such file -- zlib
ERROR: Loading command: generate_index (LoadError)
cannot load such file -- zlib
ERROR: Loading command: install (LoadError)
cannot load such file -- zlib
ERROR: Loading command: pristine (LoadError)
cannot load such file -- zlib
ERROR: Loading command: push (LoadError)
cannot load such file -- zlib
ERROR: Loading command: server (LoadError)
cannot load such file -- zlib
ERROR: Loading command: specification (LoadError)
cannot load such file -- zlib
ERROR: Loading command: unpack (LoadError)
cannot load such file -- zlib
ERROR: Loading command: update (LoadError)
cannot load such file -- zlib
GEM commands are:
build [No command found for build]
cert [No command found for cert]
check [No command found for check]
cleanup Clean up old versions of installed gems
contents Display the contents of the installed gems
dependency Show the dependencies of an installed gem
environment Display information about the RubyGems environment
fetch Download a gem and place it in the current directory
generate_index [No command found for generate_index]
help Provide help on the 'gem' command
install [No command found for install]
list Display local gems whose name matches REGEXP
lock Generate a lockdown list of gems
mirror Mirror all gem files (requires rubygems-mirror)
open Open gem sources in editor
outdated Display all gems that need updates
owner Manage gem owners of a gem on the push server
pristine [No command found for pristine]
push [No command found for push]
query Query gem information in local or remote repositories
rdoc Generates RDoc for pre-installed gems
search Display remote gems whose name matches REGEXP
server [No command found for server]
sources Manage the sources and cache file RubyGems uses to search
for gems
specification [No command found for specification]
stale List gems along with access times
uninstall Uninstall gems from the local repository
unpack [No command found for unpack]
update [No command found for update]
which Find the location of a library file you can require
yank Remove a pushed gem from the index
有什么想法?
此外,这里是gem environment
的输出,因为它有用:
RubyGems Environment:
- RUBYGEMS VERSION: 2.5.0
- RUBY VERSION: 2.2.3 (2015-08-18 patchlevel 173) [x86_64-linux]
- INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/2.2.0
- USER INSTALLATION DIRECTORY: /home/amy/.gem/ruby/2.2.0
- RUBY EXECUTABLE: /usr/local/bin/ruby
- EXECUTABLE DIRECTORY: /usr/local/bin
- SPEC CACHE DIRECTORY: /home/amy/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /usr/local/etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /usr/local/lib/ruby/gems/2.2.0
- /home/amy/.gem/ruby/2.2.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /usr/local/sbin
- /usr/local/bin
- /usr/sbin
- /usr/bin
- /sbin
- /bin
- /usr/games
- /usr/local/games
无论如何,我完全迷失了。