Rails 3.1控制台错误

时间:2011-10-09 00:58:19

标签: ruby-on-rails irb pry

  

可能重复:
  no such file to load — readline

我刚刚创建了一个rails应用程序,并试图进入控制台,但我一直收到错误

rellon@relloneee:~/Dropbox/Apress$ rails c
/home/rellon/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/completion.rb:9:in `require': no such file to load -- readline (LoadError)
    from /home/rellon/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/completion.rb:9:in `<top (required)>'
    from /home/rellon/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands/console.rb:3:in `require'
    from /home/rellon/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands/console.rb:3:in `<top (required)>'
    from /home/rellon/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands.rb:37:in `require'
    from /home/rellon/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands.rb:37:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

我可以请一些帮助.....

我也试过撬,现在我收到了这条消息

rellon@relloneee:~/Dropbox/Apress$ pry -r config/environment
/home/rellon/.rvm/gems/ruby-1.9.2-p290/gems/pry-0.9.6.2/lib/pry.rb:8: warning: already initialized constant DEFAULT_HOOKS
/home/rellon/.rvm/gems/ruby-1.9.2-p290/gems/pry-0.9.6.2/lib/pry.rb:21: warning: already initialized constant DEFAULT_PRINT
/home/rellon/.rvm/gems/ruby-1.9.2-p290/gems/pry-0.9.6.2/lib/pry.rb:39: warning: already initialized constant SIMPLE_PRINT
/home/rellon/.rvm/gems/ruby-1.9.2-p290/gems/pry-0.9.6.2/lib/pry.rb:48: warning: already initialized constant CLIPPED_PRINT
/home/rellon/.rvm/gems/ruby-1.9.2-p290/gems/pry-0.9.6.2/lib/pry.rb:53: warning: already initialized constant DEFAULT_EXCEPTION_HANDLER
/home/rellon/.rvm/gems/ruby-1.9.2-p290/gems/pry-0.9.6.2/lib/pry.rb:59: warning: already initialized constant DEFAULT_EXCEPTION_WHITELIST
/home/rellon/.rvm/gems/ruby-1.9.2-p290/gems/pry-0.9.6.2/lib/pry.rb:62: warning: already initialized constant DEFAULT_PROMPT
/home/rellon/.rvm/gems/ruby-1.9.2-p290/gems/pry-0.9.6.2/lib/pry.rb:85: warning: already initialized constant DEFAULT_CONTROL_D_HANDLER
/home/rellon/.rvm/gems/ruby-1.9.2-p290/gems/pry-0.9.6.2/lib/pry.rb:100: warning: already initialized constant SIMPLE_PROMPT
/home/rellon/.rvm/gems/ruby-1.9.2-p290/gems/pry-0.9.6.2/lib/pry.rb:102: warning: already initialized constant SHELL_PROMPT
/home/rellon/.rvm/gems/ruby-1.9.2-p290/gems/pry-0.9.6.2/lib/pry.rb:109: warning: already initialized constant NAV_PROMPT
/home/rellon/.rvm/gems/ruby-1.9.2-p290/gems/pry-0.9.6.2/lib/pry.rb:120: warning: already initialized constant DEFAULT_SYSTEM
/home/rellon/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': no such file to load -- readline (LoadError)
    from /home/rellon/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /home/rellon/.rvm/gems/ruby-1.9.2-p290/gems/pry-0.9.6.2/lib/pry.rb:151:in `<top (required)>'
    from /home/rellon/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /home/rellon/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /home/rellon/.rvm/gems/ruby-1.9.2-p290/gems/pry-0.9.6.2/bin/pry:12:in `rescue in <top (required)>'
    from /home/rellon/.rvm/gems/ruby-1.9.2-p290/gems/pry-0.9.6.2/bin/pry:8:in `<top (required)>'
    from /home/rellon/.rvm/gems/ruby-1.9.2-p290/bin/pry:19:in `load'
    from /home/rellon/.rvm/gems/ruby-1.9.2-p290/bin/pry:19:in `<main>'

1 个答案:

答案 0 :(得分:1)

看起来这符合你的问题

no such file to load -- readline

基本上,您可能缺少readline模块。