2

我在网上搜索了所有内容,但无法找到解决此错误的方法。每次我尝试启动 rails 服务器,甚至是 rails 控制台时,我都会得到一个crack/xml (LoadError). 任何人有任何他们认为可以帮助我正确启动和运行轨道的建议吗?

Construct Coverage: rails s
/Users/Construct/.rvm/gems/ruby-1.9.3-p194@coverage/gems/ap-0.1.1/lib/ap.rb:2:in `require': cannot load such file -- crack/xml (LoadError)
    from /Users/Construct/.rvm/gems/ruby-1.9.3-p194@coverage/gems/ap-0.1.1/lib/ap.rb:2:in `<top (required)>'
    from /Users/Construct/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler/runtime.rb:68:in `require'
    from /Users/Construct/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
    from /Users/Construct/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler/runtime.rb:66:in `each'
    from /Users/Construct/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler/runtime.rb:66:in `block in require'
    from /Users/Construct/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler/runtime.rb:55:in `each'
    from /Users/Construct/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler/runtime.rb:55:in `require'
    from /Users/Construct/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler.rb:119:in `require'
    from /Users/Construct/Dropbox/rails_projects/Coverage/config/application.rb:7:in `<top (required)>'
    from /Users/Construct/.rvm/gems/ruby-1.9.3-p194@coverage/gems/railties-3.2.1/lib/rails/commands.rb:53:in `require'
    from /Users/Construct/.rvm/gems/ruby-1.9.3-p194@coverage/gems/railties-3.2.1/lib/rails/commands.rb:53:in `block in <top (required)>'
    from /Users/Construct/.rvm/gems/ruby-1.9.3-p194@coverage/gems/railties-3.2.1/lib/rails/commands.rb:50:in `tap'
    from /Users/Construct/.rvm/gems/ruby-1.9.3-p194@coverage/gems/railties-3.2.1/lib/rails/commands.rb:50:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

我试图安装破解 gem 然后运行 ​​bundler 但我仍然得到同样的错误,即使在终端重新启动后也是如此。所以我不确定如何解决这种情况。

4

2 回答 2

7

我得到了@apneadiving 解决方案。

我也尝试更换

gem 'ap'

gem 'awesome_print'

在 Gemfile 中。

这似乎也有效。

更新:似乎ap可能是awesome_print gem的html/xml版本。

于 2013-07-26T02:57:02.757 回答
4

可以肯定的是:错误源于 ap gem,这一行

它使用crack/xml 作为依赖,但它没有在gemfile 中声明为依赖,子捆绑器不知道应该添加它。

怎么修?

  • 在 gem 文件中添加 gem crack,在apgem之前

  • 或更改 ap gem 源代码

于 2012-08-26T15:40:57.097 回答