1

我是红宝石的新手。我写了一个简单的代码:...

pac = PAC.load(pacfilename)
return pac.find('http://www.google.com')

...

我正在使用宝石

gem 'win32-service', '0.8.2', :platforms => :mingw
gem 'pac', "~> 1.0.0"
gem 'therubyracer', '0.11.0beta1', :platforms => :mingw

我收到以下错误: PAC::ProgramError in Accounts#new Showing G:/test/app/views/accounts/new.html.erb 其中第 6 行出现:

无法调用 null 提取源的方法“lastIndexOf”(在第 6 行附近):

3:> 4:5:6: <%= getProxyServer %> 7: 8: <%= link_to 'Back', accounts_path %>

跟踪文件 pac (1.0.0) lib/pac/runtimes/rubyracer.rb:28:in rescue in block in call' pac (1.0.0) lib/pac/runtimes/rubyracer.rb:22:inblock in call' pac (1.0.0) lib/pac/runtimes/rubyracer.rb:57:in block in lock' pac (1.0.0) lib/pac/runtimes/rubyracer.rb:55:incall' 的相关部分pac (1.0.0) lib/pac/runtimes/rubyracer.rb:55:in Locker' pac (1.0.0) lib/pac/runtimes/rubyracer.rb:55:inlock' pac (1.0.0) lib/pac/runtimes/rubyracer.rb:21:in call' pac (1.0.0) lib/pac/file.rb:18:infind' app/helpers/accounts_helper.rb: 46:在readPACfileData' app/helpers/accounts_helper.rb:65:inreadPACfile 中'app/helpers/accounts_helper.rb:83:在`getProxyServer'中

问题是什么?我想以编程方式从应用程序中找出 proxyserverIP(如果有),然后将其用于访问网站。有什么帮助吗?

4

0 回答 0