Ruby 雾 gem 导致服务器无法运行:无法加载此类文件 -- xmlrpc/client (LoadError)
Posted
技术标签:
【中文标题】Ruby 雾 gem 导致服务器无法运行:无法加载此类文件 -- xmlrpc/client (LoadError)【英文标题】:Ruby fog gem causing server not to run: cannot load such file -- xmlrpc/client (LoadError) 【发布时间】:2017-06-06 15:27:49 【问题描述】:正如标题所述,我正在尝试设置一个 Ubuntu 16.04 系统来处理 Rails 应用程序。当我注释掉雾 gem 时,服务器在本地启动,并且 gem 留在其中会产生下面的错误消息。谷歌搜索似乎没有提供任何东西,因为我找不到与我有相同错误的其他人,而且我不能根据需要简单地从应用程序中删除 gem。
全文如下:
/home/mark/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in `require': cannot load such file -- xmlrpc/client (LoadError)
from /home/mark/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in `block in require'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:259:in `load_dependency'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in `require'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/fog-1.28.0/lib/fog/xenserver/core.rb:15:in `<class:Connection>'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/fog-1.28.0/lib/fog/xenserver/core.rb:14:in `<module:XenServer>'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/fog-1.28.0/lib/fog/xenserver/core.rb:5:in `<module:Fog>'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/fog-1.28.0/lib/fog/xenserver/core.rb:4:in `<top (required)>'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in `require'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in `block in require'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:259:in `load_dependency'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in `require'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/fog-1.28.0/lib/fog/xenserver/compute.rb:1:in `<top (required)>'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in `require'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in `block in require'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:259:in `load_dependency'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in `require'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/fog-1.28.0/lib/fog/xenserver.rb:1:in `<top (required)>'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in `require'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in `block in require'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:259:in `load_dependency'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in `require'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/fog-1.28.0/lib/fog.rb:63:in `<top (required)>'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/bundler-1.14.0/lib/bundler/runtime.rb:91:in `require'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/bundler-1.14.0/lib/bundler/runtime.rb:91:in `block (2 levels) in require'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/bundler-1.14.0/lib/bundler/runtime.rb:86:in `each'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/bundler-1.14.0/lib/bundler/runtime.rb:86:in `block in require'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/bundler-1.14.0/lib/bundler/runtime.rb:75:in `each'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/bundler-1.14.0/lib/bundler/runtime.rb:75:in `require'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/bundler-1.14.0/lib/bundler.rb:107:in `require'
from /home/mark/projects/walkabout/config/application.rb:7:in `<top (required)>'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:88:in `require'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:88:in `block in server'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:85:in `tap'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:85:in `server'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/railties-5.0.1/lib/rails/commands.rb:18:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
如果有人能告诉我如何下载/安装 xmlrpc 客户端或解决此问题,将不胜感激。
【问题讨论】:
一个好的第一步是更新fog的版本,因为有一些更新的版本可能会固有地解决这个问题。 【参考方案1】:所以问题是从 Ruby 2.4.0 开始,之前与 ruby 捆绑在一起的 xmlrpc 库已被提取到 gem 中。所以你必须把它添加到你的 gem 文件中并再次打包。
gem 'xmlrpc'
【讨论】:
一个月前你在哪里 :D 你说得对,这解决了我的问题。以上是关于Ruby 雾 gem 导致服务器无法运行:无法加载此类文件 -- xmlrpc/client (LoadError)的主要内容,如果未能解决你的问题,请参考以下文章
无法安装 gem - 无法构建 gem 本机扩展 - 无法加载此类文件 - mkmf (LoadError)
无法使用所需的 tumblr_client 运行 ruby 脚本
Rails无法加载shoulda-matchers 3.1.1 gem,undefined方法`allow_value'代表#