我在网络上搜索过,但无法找到解决此错误的方法。每当我尝试启动rails服务器,甚至是rails console时,我都会得到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>'
我试图安装crack gem然后运行bundler但是即使重启终端后我仍然会遇到同样的错误。所以我不确定如何解决这个问题。
答案 0 :(得分:6)
我得到了@apneadiving解决方案。
我也试过替换
gem 'ap'
与
gem 'awesome_print'
Gemfile中的。
这似乎也有效。
更新: 似乎ap可能是awesome_print gem的html / xml版本。
答案 1 :(得分:4)
可以肯定的是:错误源于ap gem,this line。
它使用crack / xml作为依赖,但是它没有被声明为gemfile中的依赖关系。子捆绑器无法知道它应该被添加。
如何解决?
在宝石文件中添加宝石crack
,在ap
宝石
或更改ap gem源代码