Ruby中缺少Gem错误

Ruby中缺少Gem错误,ruby,ubuntu,rubygems,puppet,sensu,Ruby,Ubuntu,Rubygems,Puppet,Sensu,我在Ubuntu 13.04上运行一个木偶安装的Sensu客户端,它反过来执行check procs.rb。。它失败于: /usr/lib/ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find json (>= 0) amongst [addressable-2.3.5, amq-client-1.0.2, amq-protocol-1.2.0, amqp-1.0.0, asyn

我在Ubuntu 13.04上运行一个木偶安装的Sensu客户端,它反过来执行check procs.rb。。它失败于:

/usr/lib/ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': 
    Could not find json (>= 0) amongst 
    [addressable-2.3.5, amq-client-1.0.2, amq-protocol-1.2.0, amqp-1.0.0, 
    async_sinatra-1.0.0, coffee-script-2.2.0, coffee-script-source-1.6.3, 
    commonjs-0.2.7, cookiejar-0.3.0, daemons-1.1.9, em-http-request-1.0.3, 
    em-redis-unified-0.4.2, em-socksify-0.3.0, em-worker-0.0.2, 
    eventmachine-1.0.3, execjs-2.0.2, handlebars_assets-0.15, hike-1.2.3,
    http_parser.rb-0.6.0, ipaddress-0.8.0, less-2.4.0,
    libv8-3.11.8.17-x86_64-linux, mixlib-cli-1.4.0, mixlib-config-2.1.0,
    mixlib-log-1.6.0, mixlib-shellout-1.3.0, multi_json-1.8.2, ohai-6.16.0,
    oj-2.0.9, rack-1.5.2, rack-protection-1.5.1, ref-1.0.5, sass-3.2.12,
    semver-1.0.1, sensu-0.12.3, sensu-dashboard-0.10.2, sensu-plugin-0.2.2,
    sinatra-1.3.5, slim-2.0.2, sprockets-2.10.1, systemu-2.6.0, systemu-2.5.2,
    temple-0.6.7, therubyracer-0.11.4, thin-1.5.0, tilt-1.4.1, yajl-ruby-1.2.0,
    yui-compressor-0.12.0] (Gem::LoadError) 
        from /usr/lib/ruby/1.9.1/rubygems/specification.rb:777:in `block in activate_dependencies'
        from /usr/lib/ruby/1.9.1/rubygems/specification.rb:766:in `each' 
        from /usr/lib/ruby/1.9.1/rubygems/specification.rb:766:in `activate_dependencies' from /usr/lib/ruby/1.9.1/rubygems/specification.rb:750:in `activate' from /usr/lib/ruby/1.9.1/rubygems.rb:212:in `rescue in try_activate' 
        from /usr/lib/ruby/1.9.1/rubygems.rb:209:in `try_activate' 
        from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:59:in `rescue in require' from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:35:in `require' 
        from /etc/sensu/plugins/check-procs.rb:29:in `<main>' 
Ubuntu测试 它在那里,但不在宝石清单上。还请注意,“semver”包含在错误的“中间”列表中

[root@ubuntu-vm]# ls -l /var/lib/gems/1.9.1/gems/json-1.8.1/
total 140
-rw-rw-r-- 1 root root 15043 Jan  8 10:03 CHANGES
-rw-rw-r-- 1 root root  2574 Jan  8 10:03 COPYING
-rw-rw-r-- 1 root root  2591 Jan  8 10:03 COPYING-json-jruby
drwxr-xr-x 2 root root  4096 Jan  8 10:03 data
drwxr-xr-x 2 root root  4096 Jan  8 10:03 diagrams
drwxr-xr-x 3 root root  4096 Jan  8 10:03 ext
-rw-rw-r-- 1 root root   200 Jan  8 10:03 Gemfile
-rw-rw-r-- 1 root root 18114 Jan  8 10:03 GPL
-rwxrwxr-x 1 root root   441 Jan  8 10:03 install.rb
drwxr-xr-x 3 root root  4096 Jan  8 10:03 java
-rw-rw-r-- 1 root root  4869 Jan  8 10:03 json.gemspec
-rw-rw-r-- 1 root root   549 Jan  8 10:03 json-java.gemspec
-rw-rw-r-- 1 root root  4929 Jan  8 10:03 json_pure.gemspec
drwxr-xr-x 3 root root  4096 Jan  8 10:03 lib
-rw-rw-r-- 1 root root 11995 Jan  8 10:03 Rakefile
-rw-rw-r-- 1 root root   929 Jan  8 10:03 README-json-jruby.markdown
-rw-rw-r-- 1 root root 12561 Jan  8 10:03 README.rdoc
drwxr-xr-x 3 root root  4096 Jan  8 10:03 tests
-rw-rw-r-- 1 root root     1 Jan  8 10:03 TODO
drwxr-xr-x 2 root root  4096 Jan  8 10:03 tools
-rw-rw-r-- 1 root root     6 Jan  8 10:03 VERSION
如果有必要的话,Sensu还有一个“嵌入式Ruby”,其中也包含一系列宝石。在这方面,两台服务器似乎几乎完全相同

[root@either-vm]# ls -l /opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/
total 200
drwxr-xr-x 7 root root 4096 Jan  8 05:00 addressable-2.3.5
drwxr-xr-x 6 root root 4096 Jan  8 05:00 amq-client-1.0.2
drwxr-xr-x 7 root root 4096 Jan  8 05:00 amqp-1.0.0

..... lots more .....

任何帮助都将不胜感激!谢谢。

sensu是使用默认的ruby运行还是使用sensu的嵌入式ruby? 我的默认chef安装使用/opt/sensu/embedded/bin/ruby来运行,因此我的所有检查命令都是/opt/sensu/embedded/bin/ruby check_procs.rb等

我认为这是更好的,因为它保持你的系统ruby如果安装干净,保持sensu只在sensu的嵌入式ruby

您是否使用rvm/rbenv?请显示ruby-v命令的输出,哪个gem,哪个ruby,哪个bundle,如果安装了bundler gem,还显示bundle json
[root@ubuntu-vm]# ls -l /var/lib/gems/1.9.1/gems/json-1.8.1/
total 140
-rw-rw-r-- 1 root root 15043 Jan  8 10:03 CHANGES
-rw-rw-r-- 1 root root  2574 Jan  8 10:03 COPYING
-rw-rw-r-- 1 root root  2591 Jan  8 10:03 COPYING-json-jruby
drwxr-xr-x 2 root root  4096 Jan  8 10:03 data
drwxr-xr-x 2 root root  4096 Jan  8 10:03 diagrams
drwxr-xr-x 3 root root  4096 Jan  8 10:03 ext
-rw-rw-r-- 1 root root   200 Jan  8 10:03 Gemfile
-rw-rw-r-- 1 root root 18114 Jan  8 10:03 GPL
-rwxrwxr-x 1 root root   441 Jan  8 10:03 install.rb
drwxr-xr-x 3 root root  4096 Jan  8 10:03 java
-rw-rw-r-- 1 root root  4869 Jan  8 10:03 json.gemspec
-rw-rw-r-- 1 root root   549 Jan  8 10:03 json-java.gemspec
-rw-rw-r-- 1 root root  4929 Jan  8 10:03 json_pure.gemspec
drwxr-xr-x 3 root root  4096 Jan  8 10:03 lib
-rw-rw-r-- 1 root root 11995 Jan  8 10:03 Rakefile
-rw-rw-r-- 1 root root   929 Jan  8 10:03 README-json-jruby.markdown
-rw-rw-r-- 1 root root 12561 Jan  8 10:03 README.rdoc
drwxr-xr-x 3 root root  4096 Jan  8 10:03 tests
-rw-rw-r-- 1 root root     1 Jan  8 10:03 TODO
drwxr-xr-x 2 root root  4096 Jan  8 10:03 tools
-rw-rw-r-- 1 root root     6 Jan  8 10:03 VERSION
[root@either-vm]# ls -l /opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/
total 200
drwxr-xr-x 7 root root 4096 Jan  8 05:00 addressable-2.3.5
drwxr-xr-x 6 root root 4096 Jan  8 05:00 amq-client-1.0.2
drwxr-xr-x 7 root root 4096 Jan  8 05:00 amqp-1.0.0

..... lots more .....