Ruby 1.9.2 and Rails 3 cannot open rails console

前端 未结 10 1995
野性不改
野性不改 2020-12-01 06:04
[gkaykck@main myApplication]$ rails console
/usr/local/lib/ruby/1.9.1/irb/completion.rb:9:in `require\': no such file to load -- readline (LoadError)
    from /usr/l         


        
10条回答
  •  南笙
    南笙 (楼主)
    2020-12-01 06:46

    Apparently ubuntu and ruby don't always catch dependencies like they should.

    From the first google hit (yeah, I clicked on this stack-overflow in place #2 before checking out the first result.)

    Navigate to the Ruby source and enter:

    sudo apt-get install libreadline5-dev
    cd ext/readline
    ruby extconf.rb
    make
    sudo make install
    

    So, if you're on another distro, make sure you install readline somehow (source/package), then run make/install on extconf from the source. I tried what gkaykck suggested of course but got this without readline already on my system.

    $ ruby extconf.rb
    checking for tgetnum() in -lncurses... no
    checking for tgetnum() in -ltermcap... no
    checking for tgetnum() in -lcurses... no
    checking for readline/readline.h... no
    checking for editline/readline.h... no
    

提交回复
热议问题