13

我正在尝试使用. gem install geoutmGithub 存储库没有问题页面,所以我尝试自己解决问题,然后提交拉取请求。这是问题:

$ gem 安装geoutm
获取:geoutm-1.0.1.gem (100%)
成功安装geoutm-1.0.1
错误:执行 gem 时...(类型错误)
    没有将 Array 隐式转换为 String

它说“成功安装”,但尝试要求 gem 失败。详细安装并没有多大用处:

$ gem install geooutm --verbose
头 https://rubygems.org/latest_specs.4.8.gz
302 临时搬家
头 https://s3.amazonaws.com/production.s3.rubygems.org/latest_specs.4.8.gz
200 好
获取 https://rubygems.org/latest_specs.4.8.gz
302 临时搬家
获取 https://s3.amazonaws.com/production.s3.rubygems.org/latest_specs.4.8.gz
200 好
安装 gem geooutm-1.0.1
/home/tomas/.rvm/gems/ruby-2.0.0-p247/gems/geoutm-1.0.1/spec/latlon_spec.rb
/home/tomas/.rvm/gems/ruby-2.0.0-p247/gems/geoutm-1.0.1/spec/geoutm_spec.rb
/home/tomas/.rvm/gems/ruby-2.0.0-p247/gems/geoutm-1.0.1/spec/spec_helper.rb
/home/tomas/.rvm/gems/ruby-2.0.0-p247/gems/geoutm-1.0.1/spec/utm_spec.rb
/home/tomas/.rvm/gems/ruby-2.0.0-p247/gems/geoutm-1.0.1/spec/testdata.yaml
/home/tomas/.rvm/gems/ruby-2.0.0-p247/gems/geoutm-1.0.1/spec/spec.opts
/home/tomas/.rvm/gems/ruby-2.0.0-p247/gems/geoutm-1.0.1/spec/ellipsoid_spec.rb
/home/tomas/.rvm/gems/ruby-2.0.0-p247/gems/geoutm-1.0.1/lib/geoutm/utm_zones.rb
/home/tomas/.rvm/gems/ruby-2.0.0-p247/gems/geoutm-1.0.1/lib/geoutm/geo_utm_exception.rb
/home/tomas/.rvm/gems/ruby-2.0.0-p247/gems/geoutm-1.0.1/lib/geoutm/utm.rb
/home/tomas/.rvm/gems/ruby-2.0.0-p247/gems/geoutm-1.0.1/lib/geoutm/ellipsoid.rb
/home/tomas/.rvm/gems/ruby-2.0.0-p247/gems/geoutm-1.0.1/lib/geoutm/latlon.rb
/home/tomas/.rvm/gems/ruby-2.0.0-p247/gems/geoutm-1.0.1/lib/geoutm.rb
/home/tomas/.rvm/gems/ruby-2.0.0-p247/gems/geoutm-1.0.1/LICENCE
/home/tomas/.rvm/gems/ruby-2.0.0-p247/gems/geoutm-1.0.1/README.rdoc
/home/tomas/.rvm/gems/ruby-2.0.0-p247/gems/geoutm-1.0.1/History.txt
成功安装geoutm-1.0.1
错误:执行 gem 时...(类型错误)
    没有将 Array 隐式转换为 String

当手动下载并在不安装的情况下使用时,gem 可以完美运行。

问题是我不知道如何找出类型错误发生的位置。我找不到任何安装日志或更详细的输出标志。知道如何找出这个错误吗?

4

2 回答 2

8

使用来自的输出

$ gem install --backtrace ...

你可以进一步做

$ byebug /home/tallakt/.rvm/rubies/ruby-2.0.0-p0/bin/gem install geoutm-1.0.1.gem

内部 byebyg 类型:

(byebug) break /home/tallakt/.rvm/gems/ruby-2.0.0-p0/gems/rdoc-4.0.1/lib/rdoc/rubygems_hook.rb:171
Created breakpoint 1 at /home/tallakt/.rvm/gems/ruby-2.0.0-p0/gems/rdoc-4.0.1/lib/rdoc/rubygems_hook.rb:171
(byebug) c

我正在寻找geoutm中的错误,但现在可以使用

$ gem install -N geoutm

跳过 RDoc 生成

于 2013-09-30T07:53:42.330 回答
6

感谢 Arup Rakshit 的评论,我尝试了这个命令:

gem install geooutm --debug --backtrace --verbose

我得到了一个很好的错误回溯:

/home/tomas/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rdoc/options.rb:407 处的异常“TypeError” - 没有将数组隐式转换为字符串
错误:执行 gem 时...(类型错误)
    没有将 Array 隐式转换为 String
    /home/tomas/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rdoc/options.rb:407:in `存在?
    /home/tomas/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rdoc/options.rb:407:in `block in check_files'
    /home/tomas/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rdoc/options.rb:406:in `delete_if'
    /home/tomas/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rdoc/options.rb:406:in `check_files'
    /home/tomas/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rdoc/options.rb:480:in `finish'
    /home/tomas/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rdoc/options.rb:1037:in `parse'
    /home/tomas/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rdoc/rubygems_hook.rb:162:in `block in generate'
    /home/tomas/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rdoc/rubygems_hook.rb:159:in `chdir'
    /home/tomas/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rdoc/rubygems_hook.rb:159:in `generate'
    /home/tomas/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rdoc/rubygems_hook.rb:54:in `block in generation_hook'
    /home/tomas/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rdoc/rubygems_hook.rb:53:in `每个'
    /home/tomas/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rdoc/rubygems_hook.rb:53:in `generation_hook'
    /home/tomas/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/dependency_installer.rb:382:在“调用”中
    /home/tomas/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/dependency_installer.rb:382:in `block (2 levels) in install'
    /home/tomas/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/dependency_installer.rb:381:在“每个”中
    /home/tomas/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/dependency_installer.rb:381:in `block in install'
    /home/tomas/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/dependency_installer.rb:401:in `in_background'
    /home/tomas/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/dependency_installer.rb:380:在“安装”中
    /home/tomas/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/commands/install_command.rb:166:in `block in execute'
    /home/tomas/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/commands/install_command.rb:158:in `each'
    /home/tomas/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/commands/install_command.rb:158:in `execute'
    /home/tomas/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/command.rb:305:in `invoke_with_build_args'
    /home/tomas/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/command_manager.rb:170:in `process_args'
    /home/tomas/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/command_manager.rb:130:在“运行”中
    /home/tomas/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/gem_runner.rb:60:in `run'
    /home/tomas/.rvm/rubies/ruby-2.0.0-p247/bin/gem:22:in `<main>'
于 2013-09-29T13:19:10.617 回答