No such file to load — readLine solution after Ruby upgrade

Time:2019-10-5

Upgrade Ruby and rails and enter script/consle:

Copy codeThe code is as follows:
/usr/local/lib/ruby/1.8/irb/completion.rb:10:in `require’: no such file to loadreadline (LoadError) 
        from /usr/local/lib/ruby/1.8/irb/completion.rb:10 
        from /usr/local/lib/ruby/1.8/irb/init.rb:252:in `require’ 
        from /usr/local/lib/ruby/1.8/irb/init.rb:252:in `load_modules’ 
        from /usr/local/lib/ruby/1.8/irb/init.rb:250:in `each’ 
        from /usr/local/lib/ruby/1.8/irb/init.rb:250:in `load_modules’ 
        from /usr/local/lib/ruby/1.8/irb/init.rb:21:in `setup’ 
        from /usr/local/lib/ruby/1.8/irb.rb:54:in `start’ 
        from /usr/local/bin/irb:13 

Terms of settlement:

Step 1: Verify that libncurses5-dev libreadline5-dev is installed or not.

Copy codeThe code is as follows:
Suo apt-get install libncurses5-dev libreadline5-dev for installation

Step 2:

Copy codeThe code is as follows:
cd /usr/src/ruby-1.8.7/ext/readline 
ruby extconf.rb 
make 
sudo make install  

Recommended Today

[tutorial] restful API using JWT authentication in laravel

This article is forwarded from the professional laravel developer community, original link: https://learnku.com/laravel/t… In this article, we’ll learn how to use JWT authentication to build restful APIs in larevel. JWT stands for JSON web tokens. We will also use the API to create full-featured crud applications for user products. When using cross platform applications, the […]