On running, Rails exits on an old (since corrected) error

ruby-on-rails

#1

I can’t escape a state where I am repeatedly exited from rails due to an earlier error in the route file (which has since been corrected).

Error information appears

  1. after running (and being exited from) rails (see: Example 1), but the same also appears
  2. after rails —help is partially completed (see: Example 2)

In other words, I can’t get on with my work with rails on Cloud9 until I can escape this recursive error state.

BTW, I can’t kill my processes with Kill -9 but they simply restart, and I’m back to the error state.

—————
Example 1
—————
^C ^C
^C rails server -b $IP -p $PORT
=> Booting Puma
=> Rails 5.0.3 application starting in development on http://0.0.0.0:8080
=> Run rails server -h for more startup options
Exiting
/usr/local/rvm/gems/ruby-2.3.0/gems/actionpack-5.0.3/lib/action_dispatch/routing/mapper.rb:329:in check_part': Missing :controller key on routes definition, please check your routes. (ArgumentError) from /usr/local/rvm/gems/ruby-2.3.0/gems/actionpack-5.0.3/lib/action_dispatch/routing/mapper.rb:309:incheck_controller_and_action’
from /usr/local/rvm/gems/ruby-2.3.0/gems/actionpack-5.0.3/lib/action_dispatch/routing/mapper.rb:252:in normalize_options!' from /usr/local/rvm/gems/ruby-2.3.0/gems/actionpack-5.0.3/lib/action_dispatch/routing/mapper.rb:116:ininitialize’
from /usr/local/rvm/gems/ruby-2.3.0/gems/actionpack-5.0.3/lib/action_dispatch/routing/mapper.rb:69:in `new’

—————
Example 2
—————

petstech:~/workspace/pets_sandbox_app (master) $ rails --help
Usage: rails COMMAND [ARGS]

The most common rails commands are:
generate Generate new code (short-cut alias: “g”)
console Start the Rails console (short-cut alias: “c”)
server Start the Rails server (short-cut alias: “s”)
test Run tests (short-cut alias: “t”)
dbconsole Start a console for the database specified in config/database.yml
(short-cut alias: “db”)
new Create a new Rails application. “rails new my_app” creates a
new application called MyApp in “./my_app”

All commands can be run with -h (or --help) for more information.

In addition to those commands, there are:
/usr/local/rvm/gems/ruby-2.3.0/gems/actionpack-5.0.3/lib/action_dispatch/routing/mapper.rb:329:in check_part': Missing :controller key on routes definition, please check your routes. (ArgumentError) from /usr/local/rvm/gems/ruby-2.3.0/gems/actionpack-5.0.3/lib/action_dispatch/routing/mapper.rb:309:incheck_controller_and_action’
from /usr/local/rvm/gems/ruby-2.3.0/gems/actionpack-5.0.3/lib/action_dispatch/routing/mapper.rb:252:in normalize_options!' from /usr/local/rvm/gems/ruby-2.3.0/gems/actionpack-5.0.3/lib/action_dispatch/routing/mapper.rb:116:ininitialize’
from /usr/local/rvm/gems/ruby-2.3.0/gems/actionpack-5.0.3/lib/action_dispatch/routing/mapper.rb:69:in new' from /usr/local/rvm/gems/ruby-2.3.0/gems/actionpack-5.0.3/lib/action_dispatch/routing/mapper.rb:69:inbuild’


#2

Problem resolved: routes.rb file must have been corrupted, i.e., correcting the errors (missing ‘,’ in get statements) didn’t fix the problem. Created a new file and entering lines rather than cutting/pasting from corrupted file.