Chinaunix首页 | 论坛 | 博客
  • 博客访问: 461748
  • 博文数量: 117
  • 博客积分: 3195
  • 博客等级: 中校
  • 技术积分: 1156
  • 用 户 组: 普通用户
  • 注册时间: 2009-08-04 01:44
文章分类

全部博文(117)

文章存档

2012年(5)

2011年(5)

2010年(46)

2009年(61)

我的朋友

分类: Python/Ruby

2012-08-10 00:49:37

一运行example_helper.rb,就报错。。
第一个:
D:\Ruby193\lib\ruby\gems\1.9.1\gems\prawn-0.12.0\examples>ruby example_helper.rb

D:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require':
cannot load such file -- bundler (LoadError)
解决方法:gem install bundler

第二个:
D:\Ruby193\lib\ruby\gems\1.9.1\gems\prawn-0.12.0\examples>ruby example_helper.rb

D:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/shared_helpers.rb:
22:in `default_gemfile': Could not locate Gemfile (Bundler::GemfileNotFound)
解决方法:把这个文件 gems\bundler-1.1.5\lib\bundler\templates\Gemfile 复制到gems\prawn-0.12.0\examples\目录下。并在example_helper.rb文件里面加上这句。

点击(此处)折叠或打开

  1. ENV['BUNDLE_GEMFILE'] || File.join(Dir.pwd, 'Gemfile')

第三个:
D:\Ruby193\lib\ruby\gems\1.9.1\gems\prawn-0.12.0\examples>ruby example_helper.rb

D:/Ruby193/lib/ruby/gems/1.9.1/gems/prawn-0.12.0/lib/prawn/core/object_store.rb:
10:in `require': cannot load such file -- pdf/reader (LoadError)
解决方法:
原因是$LOAD_PATH里面没有pdf/reader的路径。$LOAD_PATH是Ruby读取外部文件的一个环境变量.
只要在example_helper.rb里面加上就可以了
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', '..', 'pdf-reader-1.1.1','lib'))

之后第四个第五个。。
D:/Ruby193/lib/ruby/gems/1.9.1/gems/pdf-reader-1.1.1/lib/pdf/reader.rb:30:in `re
quire': cannot load such file -- ascii85 (LoadError)

都是跟上面一样的原因,一起加上就OK了。

点击(此处)折叠或打开

  1. $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', '..', 'ttfunk-1.0.3','lib'))
  2. $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', '..', 'pdf-reader-1.1.1','lib'))
  3. $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', '..', 'Ascii85-1.0.1','lib'))
  4. $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', '..', 'ruby-rc4-0.1.5','lib'))
再运行,总算没事了。。
阅读(4219) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~