Knife ssh cannot load such file -- readline (LoadError)


#1

Hello everyone,

I was listening to the latest Food Fight podcast (enjoy it, btw) and they
were talking about knife ssh. I haven’t really looked at it yet, so I
figured now was a good time. However, as soon as I ran any knife ssh
command, I got this:

$ knife ssh “role:experimental” “uptime”
/home/arthur/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
require': cannot load such file -- readline (LoadError) from /home/arthur/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:inrequire’
from
/home/arthur/.rvm/gems/ruby-1.9.3-p125/gems/chef-0.10.8/lib/chef/knife/ssh.rb:28:in
block in <class:Ssh>' from /home/arthur/.rvm/gems/ruby-1.9.3-p125/gems/chef-0.10.8/lib/chef/knife.rb:202:incall’
from
/home/arthur/.rvm/gems/ruby-1.9.3-p125/gems/chef-0.10.8/lib/chef/knife.rb:202:in
load_deps' from /home/arthur/.rvm/gems/ruby-1.9.3-p125/gems/chef-0.10.8/lib/chef/knife.rb:163:inrun’
from
/home/arthur/.rvm/gems/ruby-1.9.3-p125/gems/chef-0.10.8/lib/chef/application/knife.rb:128:in
run' from /home/arthur/.rvm/gems/ruby-1.9.3-p125/gems/chef-0.10.8/bin/knife:25:in<top (required)>'
from /home/arthur/.rvm/gems/ruby-1.9.3-p125/bin/knife:19:in load' from /home/arthur/.rvm/gems/ruby-1.9.3-p125/bin/knife:19:in

I thought it might have to do with using the latest ruby 1.9.3, so I tried
it out in 1.9.2 but I got the same error. Google doesn’t really give me
much here, so I’m wondering if any has seen this before. Thanks!

All the best,

Arthur Kalmenson


#2

When you built Ruby you didn’t have the readline headers installed, so
it didn’t link against them.

Rebuild ruby with the readline packages (incl. headers) installed.

–AJ

On 3 March 2012 11:36, Arthur Kalmenson arthur.kalm@gmail.com wrote:

Hello everyone,

I was listening to the latest Food Fight podcast (enjoy it, btw) and they
were talking about knife ssh. I haven’t really looked at it yet, so I
figured now was a good time. However, as soon as I ran any knife ssh
command, I got this:

$ knife ssh “role:experimental” “uptime”
/home/arthur/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
require': cannot load such file -- readline (LoadError) from /home/arthur/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:inrequire’
from
/home/arthur/.rvm/gems/ruby-1.9.3-p125/gems/chef-0.10.8/lib/chef/knife/ssh.rb:28:in
block in <class:Ssh>' from /home/arthur/.rvm/gems/ruby-1.9.3-p125/gems/chef-0.10.8/lib/chef/knife.rb:202:incall’
from
/home/arthur/.rvm/gems/ruby-1.9.3-p125/gems/chef-0.10.8/lib/chef/knife.rb:202:in
load_deps' from /home/arthur/.rvm/gems/ruby-1.9.3-p125/gems/chef-0.10.8/lib/chef/knife.rb:163:inrun’
from
/home/arthur/.rvm/gems/ruby-1.9.3-p125/gems/chef-0.10.8/lib/chef/application/knife.rb:128:in
run' from /home/arthur/.rvm/gems/ruby-1.9.3-p125/gems/chef-0.10.8/bin/knife:25:in<top (required)>'
from /home/arthur/.rvm/gems/ruby-1.9.3-p125/bin/knife:19:in load' from /home/arthur/.rvm/gems/ruby-1.9.3-p125/bin/knife:19:in

I thought it might have to do with using the latest ruby 1.9.3, so I tried
it out in 1.9.2 but I got the same error. Google doesn’t really give me much
here, so I’m wondering if any has seen this before. Thanks!

All the best,

Arthur Kalmenson


#3

Thanks AJ. I’m using knife on an Ubuntu machine, so I’m not sure where the
readline package is. I’ve installed chef on my workstation with RVM, so
perhaps I’m missing the readline header because of that?

Following this guide:
http://assets.en.oreilly.com/1/event/61/oscon2011_tute_chef_19882.htm, I
have all the correct libraries installed… Any ideas what the issue might
be?


Arthur Kalmenson

On Fri, Mar 2, 2012 at 5:38 PM, AJ Christensen aj@junglist.gen.nz wrote:

When you built Ruby you didn’t have the readline headers installed, so
it didn’t link against them.

Rebuild ruby with the readline packages (incl. headers) installed.

–AJ

On 3 March 2012 11:36, Arthur Kalmenson arthur.kalm@gmail.com wrote:

Hello everyone,

I was listening to the latest Food Fight podcast (enjoy it, btw) and they
were talking about knife ssh. I haven’t really looked at it yet, so I
figured now was a good time. However, as soon as I ran any knife ssh
command, I got this:

$ knife ssh “role:experimental” “uptime”

/home/arthur/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in

`require’: cannot load such file – readline (LoadError)
from

/home/arthur/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in

`require’
from

/home/arthur/.rvm/gems/ruby-1.9.3-p125/gems/chef-0.10.8/lib/chef/knife/ssh.rb:28:in

`block in class:Ssh
from

/home/arthur/.rvm/gems/ruby-1.9.3-p125/gems/chef-0.10.8/lib/chef/knife.rb:202:in

`call’
from

/home/arthur/.rvm/gems/ruby-1.9.3-p125/gems/chef-0.10.8/lib/chef/knife.rb:202:in

`load_deps’
from

/home/arthur/.rvm/gems/ruby-1.9.3-p125/gems/chef-0.10.8/lib/chef/knife.rb:163:in

`run’
from

/home/arthur/.rvm/gems/ruby-1.9.3-p125/gems/chef-0.10.8/lib/chef/application/knife.rb:128:in

run' from /home/arthur/.rvm/gems/ruby-1.9.3-p125/gems/chef-0.10.8/bin/knife:25:in<top (required)>'
from /home/arthur/.rvm/gems/ruby-1.9.3-p125/bin/knife:19:in load' from /home/arthur/.rvm/gems/ruby-1.9.3-p125/bin/knife:19:in

I thought it might have to do with using the latest ruby 1.9.3, so I
tried
it out in 1.9.2 but I got the same error. Google doesn’t really give me
much
here, so I’m wondering if any has seen this before. Thanks!

All the best,

Arthur Kalmenson


#4

Hi Arthur,

To check if you have the readline’s headers installed try this:

$ dpkg -l | grep libreadline.*-dev

If they are already installed you should get something like this:

ii libreadline6-dev 6.2-2ubuntu1 GNU readline and history
libraries, development files

If you don’t get anything means you don’t have it, so install them by doing:

$ sudo apt-get install libreadline-dev

I hope this helps.

Greetings

On Mon, Mar 5, 2012 at 3:46 PM, Arthur Kalmenson arthur.kalm@gmail.com wrote:

Thanks AJ. I’m using knife on an Ubuntu machine, so I’m not sure where the
readline package is. I’ve installed chef on my workstation with RVM, so
perhaps I’m missing the readline header because of that?

Following this
guide: http://assets.en.oreilly.com/1/event/61/oscon2011_tute_chef_19882.htm,
I have all the correct libraries installed… Any ideas what the issue might
be?

On Fri, Mar 2, 2012 at 5:38 PM, AJ Christensen aj@junglist.gen.nz wrote:

When you built Ruby you didn’t have the readline headers installed, so
it didn’t link against them.

Rebuild ruby with the readline packages (incl. headers) installed.

–AJ

On 3 March 2012 11:36, Arthur Kalmenson arthur.kalm@gmail.com wrote:

Hello everyone,

I was listening to the latest Food Fight podcast (enjoy it, btw) and
they
were talking about knife ssh. I haven’t really looked at it yet, so I
figured now was a good time. However, as soon as I ran any knife ssh
command, I got this:

$ knife ssh “role:experimental” “uptime”

/home/arthur/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
`require’: cannot load such file – readline (LoadError)
from

/home/arthur/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
`require’
from

/home/arthur/.rvm/gems/ruby-1.9.3-p125/gems/chef-0.10.8/lib/chef/knife/ssh.rb:28:in
`block in class:Ssh
from

/home/arthur/.rvm/gems/ruby-1.9.3-p125/gems/chef-0.10.8/lib/chef/knife.rb:202:in
`call’
from

/home/arthur/.rvm/gems/ruby-1.9.3-p125/gems/chef-0.10.8/lib/chef/knife.rb:202:in
`load_deps’
from

/home/arthur/.rvm/gems/ruby-1.9.3-p125/gems/chef-0.10.8/lib/chef/knife.rb:163:in
`run’
from

/home/arthur/.rvm/gems/ruby-1.9.3-p125/gems/chef-0.10.8/lib/chef/application/knife.rb:128:in
run' from /home/arthur/.rvm/gems/ruby-1.9.3-p125/gems/chef-0.10.8/bin/knife:25:in<top (required)>'
from /home/arthur/.rvm/gems/ruby-1.9.3-p125/bin/knife:19:in load' from /home/arthur/.rvm/gems/ruby-1.9.3-p125/bin/knife:19:in

I thought it might have to do with using the latest ruby 1.9.3, so I
tried
it out in 1.9.2 but I got the same error. Google doesn’t really give me
much
here, so I’m wondering if any has seen this before. Thanks!

All the best,

Arthur Kalmenson


Juanje


#5

Thanks Juan. Installing libreadline-dev worked great.


Arthur Kalmenson

2012/3/5 Juan Jesús Ojeda Croissier juanje.ojeda@gmail.com

Hi Arthur,

To check if you have the readline’s headers installed try this:

$ dpkg -l | grep libreadline.*-dev

If they are already installed you should get something like this:

ii libreadline6-dev 6.2-2ubuntu1 GNU readline and history
libraries, development files

If you don’t get anything means you don’t have it, so install them by
doing:

$ sudo apt-get install libreadline-dev

I hope this helps.

Greetings

On Mon, Mar 5, 2012 at 3:46 PM, Arthur Kalmenson arthur.kalm@gmail.com
wrote:

Thanks AJ. I’m using knife on an Ubuntu machine, so I’m not sure where
the
readline package is. I’ve installed chef on my workstation with RVM, so
perhaps I’m missing the readline header because of that?

Following this
guide:
http://assets.en.oreilly.com/1/event/61/oscon2011_tute_chef_19882.htm,
I have all the correct libraries installed… Any ideas what the issue
might
be?

On Fri, Mar 2, 2012 at 5:38 PM, AJ Christensen aj@junglist.gen.nz
wrote:

When you built Ruby you didn’t have the readline headers installed, so
it didn’t link against them.

Rebuild ruby with the readline packages (incl. headers) installed.

–AJ

On 3 March 2012 11:36, Arthur Kalmenson arthur.kalm@gmail.com wrote:

Hello everyone,

I was listening to the latest Food Fight podcast (enjoy it, btw) and
they
were talking about knife ssh. I haven’t really looked at it yet, so I
figured now was a good time. However, as soon as I ran any knife ssh
command, I got this:

$ knife ssh “role:experimental” “uptime”

/home/arthur/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in

`require’: cannot load such file – readline (LoadError)
from

/home/arthur/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in

`require’
from

/home/arthur/.rvm/gems/ruby-1.9.3-p125/gems/chef-0.10.8/lib/chef/knife/ssh.rb:28:in

`block in class:Ssh
from

/home/arthur/.rvm/gems/ruby-1.9.3-p125/gems/chef-0.10.8/lib/chef/knife.rb:202:in

`call’
from

/home/arthur/.rvm/gems/ruby-1.9.3-p125/gems/chef-0.10.8/lib/chef/knife.rb:202:in

`load_deps’
from

/home/arthur/.rvm/gems/ruby-1.9.3-p125/gems/chef-0.10.8/lib/chef/knife.rb:163:in

`run’
from

/home/arthur/.rvm/gems/ruby-1.9.3-p125/gems/chef-0.10.8/lib/chef/application/knife.rb:128:in

`run’
from

/home/arthur/.rvm/gems/ruby-1.9.3-p125/gems/chef-0.10.8/bin/knife:25:in

<top (required)>' from /home/arthur/.rvm/gems/ruby-1.9.3-p125/bin/knife:19:inload’
from /home/arthur/.rvm/gems/ruby-1.9.3-p125/bin/knife:19:in `’

I thought it might have to do with using the latest ruby 1.9.3, so I
tried
it out in 1.9.2 but I got the same error. Google doesn’t really give
me

much
here, so I’m wondering if any has seen this before. Thanks!

All the best,

Arthur Kalmenson


Juanje