我试图通过运行以下命令使用knife命令对我的服务器执行ssh:
FOREIGN KEY
但它让我误以为:
knife ssh "name:myserverhost" "pwd"
我是厨师和小刀的新手,尝试使用刀ssh运行基本的/usr/local/rbenv/versions/1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1637:in `raise_if_conflicts': Unable to activate net-ssh-gateway-1.2.0, because net-ssh-2.2.2 conflicts with net-ssh (>= 2.6.5) (Gem::LoadError)
from /usr/local/rbenv/versions/1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:746:in `activate'
from /usr/local/rbenv/versions/1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:51:in `block in require'
from /usr/local/rbenv/versions/1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:50:in `each'
from /usr/local/rbenv/versions/1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:50:in `require'
from /usr/local/rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/net-ssh-multi-1.1/lib/net/ssh/multi/session.rb:2:in `<top (required)>'
from /usr/local/rbenv/versions/1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /usr/local/rbenv/versions/1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /usr/local/rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/net-ssh-multi-1.1/lib/net/ssh/multi.rb:1:in `<top (required)>'
from /usr/local/rbenv/versions/1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /usr/local/rbenv/versions/1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /usr/local/rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/chef-10.14.2/lib/chef/knife/ssh.rb:27:in `block in <class:Ssh>'
from /usr/local/rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/chef-10.14.2/lib/chef/knife.rb:204:in `call'
from /usr/local/rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/chef-10.14.2/lib/chef/knife.rb:204:in `load_deps'
from /usr/local/rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/chef-10.14.2/lib/chef/knife.rb:165:in `run'
from /usr/local/rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/chef-10.14.2/lib/chef/application/knife.rb:123:in `run'
from /usr/local/rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/chef-10.14.2/bin/knife:25:in `<top (required)>'
from /usr/local/rbenv/versions/1.9.2-p290/bin/knife:23:in `load'
from /usr/local/rbenv/versions/1.9.2-p290/bin/knife:23:in `<main>'
命令,你能帮我解决一下这里的问题吗?
答案 0 :(得分:2)
安装knife
以在工作站上使用的正确方法是使用ChefDK安装程序包。你已经把它作为一个宝石安装了,这一般都不是一个好主意(在“我们无法帮助那么多,因为它更难调试问题”的背景下“不支持”)而且你使用的是一个很老的版本Ruby我们很久以前就停止了支持。
删除宝石安装的Chef版本并安装ChefDK,你应该全部设置。