If you are running a "rails g scaffold ..." and have the command hanging with no visible sign of activity, Spring is likely playing havoc.
Rails Spring is a preloader for the Rails framework. If you execute a "spring stop" and re-run the scaffold command, it should work. However, having to stop Spring after every command is going to get aggravating so there's an environment variable you can set - DISABLE_SPRING.
Run "spring stop" (if it is already running) and then define the DISABLE_SPRING variable like this on a bash prompt: