RubyGem FPM 错误

Error on RubyGem FPM

我正在尝试 Grafana and I'm following its instructions 从源代码构建它。

虽然,当我进入创建优化发布包的部分时,在安装 FPM (v.1.4.0) 之后,我不断收到相同的错误:

$ fpm
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- ffi (LoadError)
    from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from /usr/lib/ruby/gems/1.8/gems/fpm-1.4.0/lib/fpm/util.rb:3
    from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from /usr/lib/ruby/gems/1.8/gems/fpm-1.4.0/lib/fpm/package.rb:2
    from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from /usr/lib/ruby/gems/1.8/gems/fpm-1.4.0/lib/fpm.rb:3
    from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from /usr/lib/ruby/gems/1.8/gems/fpm-1.4.0/bin/fpm:5
    from /usr/bin/fpm:19:in `load'
    from /usr/bin/fpm:19

知道它可能是什么吗?我在 RedHat EL6 64 位机器上。

经过大量搜索和反复试验,我通过以下命令找到了解决问题的方法:

gem 安装 --http_proxy http://username:password@proxy fpm

问题在于如何正确使用 gem 命令以绕过我公司的代理并获取 FPM 的所有依赖项。