osx-yosemite上的“gem install wkpdf”失败

时间:2014-10-30 14:49:53

标签: ruby gem osx-yosemite

我收到以下错误:

% gem install wkpdf
ERROR:  Could not find a valid gem 'wkpdf' (>= 0) in any repository
ERROR:  Possible alternatives: wkpdf

我怀疑它与wkpdf需要universal-darwin有关,而系统有universal-darwin-14

% gem list -r | grep wkpdf
plessl-wkpdf (0.3.5 universal-darwin)
wkpdf (0.6.11 universal-darwin)
% gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 2.4.2
  - RUBY VERSION: 2.0.0 (2014-05-08 patchlevel 481) [universal.x86_64-darwin14]
  - INSTALLATION DIRECTORY: /Library/Ruby/Gems/2.0.0
  - RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/bin
  - SPEC CACHE DIRECTORY: /Users/pv/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /Library/Ruby/Site
  - RUBYGEMS PLATFORMS:
    - ruby
    - universal-darwin-14
...
  - REMOTE SOURCES:
     - https://rubygems.org/

1 个答案:

答案 0 :(得分:1)

根据wkpdf的作者,Yosemite不支持wkpdf所依赖的RubyCocoa,并且他不太可能在不久的将来重新实现wkpdf

我转而使用wkhtmltopdf代替;见http://wkhtmltopdf.org/