Ad

Showing posts with label command line. Show all posts
Showing posts with label command line. Show all posts

Wednesday, July 17, 2013

Command line basics

When jumped on a developer project, I realized that command line is absolutely essential and will be used every other seconds. There are the modern ones : Rails command line, Heroku command line, Git, SVN, even though Command Line tools are old~~ for us newly minted developers. For one business co-founder, she wasn't even sure what it is (understandable of course).

For beginners, I will say: it's hard to learn, old, and less GUI (not graphically rich and friendly for beginners). You have to watch out for several things.

This is a growing list of cautions, tips and notes for beginners, especially beginner rails developers!

  • In rails development you often have to use "sudo" to do super user things. But that's not so good. Most professionals don't like using super user power very much. That can break things. In fact, beginners need to be very careful with command lines.
  • remove commands, rm, especially with force -f or recursive -r can be especially destructive, use caution 
  • 127.0.0.1 is an IP address that refers to the local computer

Console Debug - Rails Server Error

Tried to start http://0.0.0.0:3000 then keep getting into the website that I was working on with a startup rather than my own Rails app. Also got this error message


`initialize': Address already in use - bind(2) (Errno::EADDRINUSE) Sometimes this happens if you already have a Rails Server running. 

You can start the server at a new port

rails s -p=3001
Or just kill all the ruby processes
killall ruby Source: Stack Overflow
You can also use command line to find all the processes that are running
lsof|grep 3000 lsof | grep -i ruby
Turns out in my case it was more than that. A helpful developer changed my /etc/hosts file to change the localhost alias around, so it's actually unrelated to the Rails stuff. So i have to use
sudo nano /etc/hosts To view this file:

And because this is in the /etc/ directory we need to be very careful not to change these mission critical directories without knowing what we are doing.

React UI, UI UX, Reactstrap React Bootstrap

React UI MATERIAL  Install yarn add @material-ui/icons Reactstrap FORMS. Controlled Forms. Uncontrolled Forms.  Columns, grid