pdf-writer 无效多字节字符 (US-ASCII),期望 keywords_end 内容 =“%PDF-#{@version}\n%âãÏÓ\n”轨道3

发布于 2024-12-29 11:36:48 字数 2551 浏览 5 评论 0原文

我在尝试运行的协作项目中遇到了 pdf-writer gem 的问题,我正在使用 RVMRuby 1.9.2p180Rails Ubuntu 10.10 上的 3.1.0

我创建了一个新的 gemset 来使用 Bundler 安装所需的 gem,但是当我尝试运行该应用程序时,出现以下错误;

josethernandezc@DG965WH:~/Desktop/conest31$ rails s
/home/josethernandezc/.rvm/gems/ruby-1.9.2-p180@conest31/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require': /home/josethernandezc/.rvm/gems/ruby-1.9.2-p180@conest31/gems/pdf-writer-1.1.8/lib/pdf/writer.rb:712: invalid multibyte char (US-ASCII) (SyntaxError)
/home/josethernandezc/.rvm/gems/ruby-1.9.2-p180@conest31/gems/pdf-writer-1.1.8/lib/pdf/writer.rb:712: invalid multibyte char (US-ASCII)
/home/josethernandezc/.rvm/gems/ruby-1.9.2-p180@conest31/gems/pdf-writer-1.1.8/lib/pdf/writer.rb:712: syntax error, unexpected $end, expecting keyword_end
content = "%PDF-#{@version}\n%âãÏÓ\n"
                                ^
from /home/josethernandezc/.rvm/gems/ruby-1.9.2-p180@conest31/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `block in require'
from /home/josethernandezc/.rvm/gems/ruby-1.9.2-p180@conest31/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223:in `block in load_dependency'
from /home/josethernandezc/.rvm/gems/ruby-1.9.2-p180@conest31/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:640:in `new_constants_in'
from /home/josethernandezc/.rvm/gems/ruby-1.9.2-p180@conest31/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223:in `load_dependency'
from /home/josethernandezc/.rvm/gems/ruby-1.9.2-p180@conest31/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
from /home/josethernandezc/Desktop/conest31/config/application.rb:58:in `<top (required)>'
from /home/josethernandezc/.rvm/gems/ruby-1.9.2-p180@conest31/gems/railties-3.1.0/lib/rails/commands.rb:52:in `require'
from /home/josethernandezc/.rvm/gems/ruby-1.9.2-p180@conest31/gems/railties-3.1.0/lib/rails/commands.rb:52:in `block in <top (required)>'
from /home/josethernandezc/.rvm/gems/ruby-1.9.2-p180@conest31/gems/railties-3.1.0/lib/rails/commands.rb:49:in `tap'
from /home/josethernandezc/.rvm/gems/ruby-1.9.2-p180@conest31/gems/railties-3.1.0/lib/rails/commands.rb:49:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'

问题出在 pdf-writer-1.1.8/lib/pdf/writer.rb:712 中,具体来说; content = "%PDF-#{@version}\n%âãÏÓ\n"

任何建议都很好,我尝试用 Google 搜索错误,但我没有找到任何特定于 pdf-writer 的内容。 ..

I have a problem with the pdf-writer gem on a collaborative project I'm trying to run, I'm using RVM, Ruby 1.9.2p180, Rails 3.1.0 on Ubuntu 10.10.

I created a new gemset to install the required gems with Bundler, but when I try to run the app I get the fallowing error;

josethernandezc@DG965WH:~/Desktop/conest31$ rails s
/home/josethernandezc/.rvm/gems/ruby-1.9.2-p180@conest31/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require': /home/josethernandezc/.rvm/gems/ruby-1.9.2-p180@conest31/gems/pdf-writer-1.1.8/lib/pdf/writer.rb:712: invalid multibyte char (US-ASCII) (SyntaxError)
/home/josethernandezc/.rvm/gems/ruby-1.9.2-p180@conest31/gems/pdf-writer-1.1.8/lib/pdf/writer.rb:712: invalid multibyte char (US-ASCII)
/home/josethernandezc/.rvm/gems/ruby-1.9.2-p180@conest31/gems/pdf-writer-1.1.8/lib/pdf/writer.rb:712: syntax error, unexpected $end, expecting keyword_end
content = "%PDF-#{@version}\n%âãÏÓ\n"
                                ^
from /home/josethernandezc/.rvm/gems/ruby-1.9.2-p180@conest31/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `block in require'
from /home/josethernandezc/.rvm/gems/ruby-1.9.2-p180@conest31/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223:in `block in load_dependency'
from /home/josethernandezc/.rvm/gems/ruby-1.9.2-p180@conest31/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:640:in `new_constants_in'
from /home/josethernandezc/.rvm/gems/ruby-1.9.2-p180@conest31/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223:in `load_dependency'
from /home/josethernandezc/.rvm/gems/ruby-1.9.2-p180@conest31/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
from /home/josethernandezc/Desktop/conest31/config/application.rb:58:in `<top (required)>'
from /home/josethernandezc/.rvm/gems/ruby-1.9.2-p180@conest31/gems/railties-3.1.0/lib/rails/commands.rb:52:in `require'
from /home/josethernandezc/.rvm/gems/ruby-1.9.2-p180@conest31/gems/railties-3.1.0/lib/rails/commands.rb:52:in `block in <top (required)>'
from /home/josethernandezc/.rvm/gems/ruby-1.9.2-p180@conest31/gems/railties-3.1.0/lib/rails/commands.rb:49:in `tap'
from /home/josethernandezc/.rvm/gems/ruby-1.9.2-p180@conest31/gems/railties-3.1.0/lib/rails/commands.rb:49:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'

The problem is in the pdf-writer-1.1.8/lib/pdf/writer.rb:712, especifically; content = "%PDF-#{@version}\n%âãÏÓ\n"

Any suggestions would be great, I tried to Google the error but I have not found anything specific to pdf-writer....

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

风铃鹿 2025-01-05 11:36:48

pdf-writer 与 Ruby 1.9 不兼容。有一个分叉: https://github.com/metaskills/pdf-writer

更改Gemfile 中的 pdf-writer 行:

gem 'pdf-writer', :git => 'git://github.com/metaskills/pdf-writer.git'

pdf-writer is not compatible with Ruby 1.9. There is a fork which is: https://github.com/metaskills/pdf-writer

Change the pdf-writer line in your Gemfile for:

gem 'pdf-writer', :git => 'git://github.com/metaskills/pdf-writer.git'
巡山小妖精 2025-01-05 11:36:48

我刚刚将 pdf-writer 移植到 Ruby 2.0。发送到元技能的拉取请求(在之前的答案中引用)。

如果您同时需要 Ruby 2.0,请在此处找到分叉代码:

gem 'pdf-writer', :git => 'git://github.com/mwlang/pdf-writer.git'

I just ported pdf-writer to Ruby 2.0. Pull request sent to metaskills (referenced in previous answer).

If you need it for Ruby 2.0 in the meantime, please find the forked code here:

gem 'pdf-writer', :git => 'git://github.com/mwlang/pdf-writer.git'
写下不归期 2025-01-05 11:36:48

pdf-writer 的 fork 也可以在 Ruby 2.1 上运行,谢谢。

gem 'pdf-writer', :git => 'git://github.com/mwlang/pdf-writer.git'

The fork of pdf-writer also works on Ruby 2.1, thanks.

gem 'pdf-writer', :git => 'git://github.com/mwlang/pdf-writer.git'
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文