New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invoking from within code fails #33
Comments
Yes, maybe the documentation is not very clear regarding this. You need to In your case, you can do
to tell the ruby to require it before running your program. |
Thanks so much Deivid … that completely fixed the problem! Apologies for the simplicity of the question … R. From: David Rodríguez [mailto:notifications@github.com] Yes, maybe the documentation is not very clear regarding this. You need to require byebug before calling byebug, but if you use bundler it will take care of that for you. In your case, you can do ruby -rbyebug sshtest.bb.rb to tell the ruby to require it before running your program. — |
You are welcome @rpattcorner , no need to apologize! |
@deivid-rodriguez I would recommend adding the require 'byebug' bit to the documentation. |
I fell in the same trap, however require 'byebug' failed with with a 'cannot load such file' error even thought the gem was installed. But adding it to the Gemfile worked. |
Probably an error on my part, but ...
Invoking byebug from shell works fine, e.g.
byebug -- myprogram.rb --option1
However inserting the command
byebug
in ruby code results in, for example:
[root@ip-10-0-1-100 deploy]# ruby sshtest.bb.rb
sshtest.bb.rb:9:in
<main>': undefined local variable or method
byebug' for main:Object (NameError)Code looks like:
[root@ip-10-0-1-100 deploy]# cat sshtest.bb.rb
require 'net/http'
require 'json'
require 'rexml/document'
require 'net/ssh'
require 'net/ssh/multi'
connect_fail_retries = 0;
byebug
begin
puts "before do",connect_fail_retries
...
What obvious thing am I missing?
Documentation says to just insert
The text was updated successfully, but these errors were encountered: