Rails-tutorial Chapter 1: rails server isn't working on Cloud9

烂漫一生 提交于 2019-12-02 23:58:42
Tommy

I learned that you can use the command killall ruby to stop any of the ruby processes which helped me because I had mistakenly run the rails server -b $IP -p $PORT command at the ~/workspace level in the tutorial. I found the answer in can't open rails server

I ended up starting the tutorial from scratch again and it worked fine, but anyone with this problem in the future may find this troubleshooting technique I received from cloud9's support team useful:


Try:

lsof -i:8080

This will give the app that occupies it.

If apache, stop it using:

sudo /etc/init.d/apache2 stop

Hope this answer is of use to anyone with this problem.

Probably you just had the other server still running. The one you initiate earlier on in he tutorial with the rails server command. You need to shut the other one down first using Ctrl+C, then try rails server -b $IP -p $PORT again

$ rails server -b $IP -p $PORT

Cloud9 uses the special environment variables $IP and $PORT to assign the IP address and port number dynamically. If you want to see the values of these variables, type echo $IP or echo $PORT at the command line.

It's likely that if you wait a few minutes (not more than 2), your OS will free up the port. If not, use a random port number over about 5,000 every time you run rails server, e.g.

$ rails server -b $IP -p 6789

Or, because your IDE is so sucky, you might consider using a different IDE.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!