Resolve `require': no such file to load -- readline (LoadError) exception (especially ruby build from source code)
It gives the exception when I run “rails console”. This is how I resolve the problem. My environment: Ubuntu 12.04, Ruby 1.9.2p290 build from source, Rails 3.0.10
For ruby builded frome source code:
- Make sure you have libreadline-dev and libncurses5-dev 2. Go to the ruby source code directory 3. Build readline up
Install libreadline-dev
sudo apt-get install libreadline-dev libncurses5-dev
or Some older ubuntu didn't have libreadline-dev try:
sudo apt-get install libreadline5-dev libncurses5-dev
cd (ruby_sourcecode_dir)/ext/readline ruby extconf.rb make sudo make install
For RVM: Basically same to above. But the path to ext/readline is under .rvm directory. eg. /home/your_name/.rvm/src/ruby-1.9.2-p290/ext/readline
喜歡這篇文章嗎?你可能也會喜歡我的學習電子報,我會分享經過篩選的優質內容 + 學習心得
📚 訂閱我的學習電子報
📖 涵蓋主題:
🧑💻 軟體工程
🎯 生產力
💰 商業理財
🧳 創業
🐱 奇怪的知識增加了
💭 思考人生心得
🎁 現在訂閱就送我個人非常愛用「學習任何領域皮毛的 AI Prompt」!
立即免費訂閱 →
✨ 不浪費你的時間,只分享達到我標準的優質內容