Skip to content
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

Console task fails if ruby version has no readline support #1640

Closed
bascht opened this issue Mar 31, 2014 · 6 comments
Closed

Console task fails if ruby version has no readline support #1640

bascht opened this issue Mar 31, 2014 · 6 comments

Comments

@bascht
Copy link

bascht commented Mar 31, 2014

I've (inadvertently) installed ruby without readline support and tried to run padrino. The start task fails gracefully, while the console task spits out the whole stack:

$ bundle exec padrino start
You're running a version of ruby with no Readline support
Please `gem install rb-readline` or recompile ruby --with-readline.

$ bundle exec padrino console
/home/bascht/.rubies/ruby-2.1.0/lib/ruby/2.1.0/irb/completion.rb:9:in `require': cannot load such file -- readline (LoadError)
    from /home/bascht/.rubies/ruby-2.1.0/lib/ruby/2.1.0/irb/completion.rb:9:in `<top (required)>'
    from /home/bascht/.gem/ruby/2.1.0/gems/padrino-core-0.11.4/lib/padrino-core/cli/base.rb:64:in `require'
    from /home/bascht/.gem/ruby/2.1.0/gems/padrino-core-0.11.4/lib/padrino-core/cli/base.rb:64:in `console'
    from /home/bascht/.gem/ruby/2.1.0/gems/thor-0.17.0/lib/thor/task.rb:27:in `run'
    from /home/bascht/.gem/ruby/2.1.0/gems/thor-0.17.0/lib/thor/invocation.rb:120:in `invoke_task'
    from /home/bascht/.gem/ruby/2.1.0/gems/thor-0.17.0/lib/thor.rb:344:in `dispatch'
    from /home/bascht/.gem/ruby/2.1.0/gems/thor-0.17.0/lib/thor/base.rb:434:in `start'
    from /home/bascht/.gem/ruby/2.1.0/gems/padrino-core-0.11.4/bin/padrino:9:in `<top (required)>'
    from /home/bascht/.gem/ruby/2.1.0/bin/padrino:23:in `load'
    from /home/bascht/.gem/ruby/2.1.0/bin/padrino:23:in `<main>'

Looks like the readline check for 'console' is missing.
I'm using padrino-core 0.11.4

@skade
Copy link
Contributor

skade commented Mar 31, 2014

Why does start need readline anyways?

@bascht
Copy link
Author

bascht commented Mar 31, 2014

My words exactly. All afternoon long.

On 31 March 2014 20:42:38 CEST, Florian Gilcher notifications@github.com wrote:

Why does start need readline anyways?


Reply to this email directly or view it on GitHub:
#1640 (comment)

@skade
Copy link
Contributor

skade commented Mar 31, 2014

The first one is pry, not padrino:

https://github.com/pry/pry/blob/0-9-11-stable/lib/pry.rb#L219

@ujifgc
Copy link
Member

ujifgc commented Mar 31, 2014

I think this message completion.rb:9:in 'require': cannot load such file -- readline (LoadError) is graceful enough.

@skade
Copy link
Contributor

skade commented Mar 31, 2014

@ujifgc The issue is that we fail if completion is unavailable, as it is just a convenience feature for IRB and not a necessity. A warning is more appropriate.

Context: Ruby 2.0.0 and 2.1.0 seem to have issues building with recent readlines.

@ujifgc ujifgc closed this as completed in 1243a21 Apr 1, 2014
@ujifgc
Copy link
Member

ujifgc commented Apr 1, 2014

Fixed!

~$ rvm install ruby --without-readline
~$ irb
Readline was unable to be required, if you need completion or history install readline then reinstall the ruby.
You may follow 'rvm notes' for dependencies and/or read the docs page https://rvm.io/packages/readline/ . Be sure you 'rvm remove X ; rvm install X' to re-compile your ruby with readline support after obtaining the readline libraries.
2.1.1 :001 > exit
~/app$ padrino console
=> Loading development console (Padrino v.0.12.0)
=> Loading Application Admin
Readline was unable to be required, if you need completion or history install readline then reinstall the ruby.
You may follow 'rvm notes' for dependencies and/or read the docs page https://rvm.io/packages/readline/ . Be sure you 'rvm remove X ; rvm install X' to re-compile your ruby with readline support after obtaining the readline libraries.
2.1.1 :001 > ^[[A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants