Pty Gem Not Found

`rails s` says `require': cannot load such file -- pty (LoadError) in Windows RailsInstaller

The backtrace tells us that the web-console gem wants Ruby's pty library. Unfortunately PTYs (pseudo-terminals) are a Unix/Linux feature which does not exist on Windows, so that Ruby library doesn't either.

You can get moving in a couple of ways:

  • If you don't care about the web-console gem right now, just remove it from your Gemfile.

  • If you really need the web-console gem, try replacing web-console with these gems:

    gem 'rubysl-pty', platforms: :ruby
    gem 'web-console-rails3', platforms: :ruby

    Source: a web-console Github issue.

Ruby pty spawn shell command fails

you have no telnet command available directly.
you can try one of several ways to handle it

  1. specify full path to command
  2. make sure the path environment variable (usually PATH) that you have in the environment used by ruby contains the folder where telnet resides.

minitest' gem not found during production bundle install

Login to the server by ubuntu user and run gem update bundler and after cap deploy from local machine.

Ruby - Problems with Expect and Pty

For this I recommend using the net-ssh gem: sudo gem install net-ssh: http://net-ssh.rubyforge.org/ssh/v2/api/index.html

The code goes a little like this:

require 'rubygems'
require 'net/ssh'

Net::SSH.start('your-server', 'username', :password => "password") do |ssh|
puts ssh.exec!("ls -la")
end


Related Topics



Leave a reply



Submit