DEV Community

critwitt
critwitt

Posted on

1

Fixing Errno::EIO: Input/Output Error when Running Sinatra for Ruby

I came across and issue while working on my backend server using Sinatra with Ruby. When I would try to run my server locally on my machine, I would get an error on Sinatra's end saying Errno::EIO, and notifying me that there was an input/output error which was preventing me from fetching data from that endpoint. That error might occur because you're trying to access a port which is already in use. There's a lot of fascinating Computer Science that goes into ports but chances are you're just looking to fix this issue.

In your terminal, you want to kill the port that's currently in use. For this example, I will use port 9292, but you should use whatever port you're trying to access.

In your terminal, type the following:

sudo kill -9 `sudo lsof -t -i:9292`
Enter fullscreen mode Exit fullscreen mode

Make sure to use backticks, not apostrophes or quotes. If you're interested in exactly what you're typing, I'll direct you ExplainShell. If you're uninterested in the specifics just know this this is killing the open terminal.

Now when you try to run your server again, Sinatra will work perfectly. Happy Coding!

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

AWS Q Developer image

Your AI Code Assistant

Automate your code reviews. Catch bugs before your coworkers. Fix security issues in your code. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay