我收到以下错误:
% 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/
答案 0 :(得分:1)
根据wkpdf
的作者,Yosemite不支持wkpdf
所依赖的RubyCocoa,并且他不太可能在不久的将来重新实现wkpdf
。
我转而使用wkhtmltopdf
代替;见http://wkhtmltopdf.org/。