`
hot88zh
  • 浏览: 182909 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

linux下进入rails console提示cannot load such file -- readline

 
阅读更多

在linux下输入rails console,之后提示错误,如下:

/usr/local/ruby/lib/ruby/1.9.1/irb/completion.rb:9:in `require': cannot load such file -- readline (LoadError)

        from /usr/local/ruby/lib/ruby/1.9.1/irb/completion.rb:9:in `<top (required)>'

        from /usr/local/ruby/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/commands/console.rb:3:in `require'

        from /usr/local/ruby/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/commands/console.rb:3:in `<top (required)>'

        from /usr/local/ruby/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/commands.rb:37:in `require'

        from /usr/local/ruby/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/commands.rb:37:in `<top (required)>'

        from script/rails:6:in `require'

        from script/rails:6:in `<main>'

需要先安装readline,命令如下:

apt-get install libreadline5-dev

再进入到ruby源码中,重新编译readline,命令如下:

cd ext/readline
ruby extconf.rb
make
sudo make install

即可。 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics