Rails Server Crashes


#1

I am taking a Rails tutorial and now at lesson 112, I can’t start the rails server. I am using the same command I’ve been using all along but to no avail. The command is:
“rails s -b $IP -p $PORT”

Here is the beginning of the error messages:

=> Booting Puma
=> Rails 5.0.0 application starting in development on http://0.0.0.0:8080
=> Run rails server -h for more startup options
Exiting

I saw one post and answer that was similar but they said “It just started working”

I’m really stuck, can anyone suggest a resolution?


#2

were you able to resolve the issue? what other error messages did it show, the beginning is not particularly useful in this case.


#3

I did not resolve the issue. I started a new project and imported my GIT repository.
This is no longer urgent in that I am OK for now, thanks.

I brought up the problem project and it is still failing. These are the error lines.

-------------FROM BAD PROJECT-------------------
fwinograd:~/workspace/saasapp (user_memberships) $ rails s -b $IP -p PORT => Booting Puma => Rails 5.0.0 application starting in development on http://0.0.0.0:8080 => Run `rails server -h` for more startup options Exiting /home/ubuntu/workspace/saasapp/app/models/user.rb:10:in `<top (required)>': undefined method `attr_accessor' for main:Object (NoMethodError) from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/activesupport-5.0.0/lib/active_support/dependencies.rb:477:in `load' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/activesupport-5.0.0/lib/active_support/dependencies.rb:477:in `block in load_file' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/activesupport-5.0.0/lib/active_support/dependencies.rb:662:in `new_constants_in' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/activesupport-5.0.0/lib/active_support/dependencies.rb:476:in `load_file' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/activesupport-5.0.0/lib/active_support/dependencies.rb:375:in `block in require_or_load' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/activesupport-5.0.0/lib/active_support/dependencies.rb:37:in `block in load_interlock' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/activesupport-5.0.0/lib/active_support/dependencies/interlock.rb:12:in `block in loading' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/activesupport-5.0.0/lib/active_support/concurrency/share_lock.rb:117:in `exclusive' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/activesupport-5.0.0/lib/active_support/dependencies/interlock.rb:11:in `loading' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/activesupport-5.0.0/lib/active_support/dependencies.rb:37:in `load_interlock' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/activesupport-5.0.0/lib/active_support/dependencies.rb:358:in `require_or_load' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/activesupport-5.0.0/lib/active_support/dependencies.rb:511:in `load_missing_constant' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/activesupport-5.0.0/lib/active_support/dependencies.rb:203:in `const_missing' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/activesupport-5.0.0/lib/active_support/inflector/methods.rb:268:in `const_get' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/activesupport-5.0.0/lib/active_support/inflector/methods.rb:268:in `block in constantize' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/activesupport-5.0.0/lib/active_support/inflector/methods.rb:266:in `each' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/activesupport-5.0.0/lib/active_support/inflector/methods.rb:266:in `inject' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/activesupport-5.0.0/lib/active_support/inflector/methods.rb:266:in `constantize' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/activesupport-5.0.0/lib/active_support/dependencies.rb:583:in `get' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/activesupport-5.0.0/lib/active_support/dependencies.rb:614:in `constantize' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/devise-4.2.0/lib/devise.rb:301:in `get' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/devise-4.2.0/lib/devise/mapping.rb:81:in `to' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/devise-4.2.0/lib/devise/mapping.rb:76:in `modules' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/devise-4.2.0/lib/devise/mapping.rb:93:in `routes' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/devise-4.2.0/lib/devise/mapping.rb:160:in `default_used_route' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/devise-4.2.0/lib/devise/mapping.rb:70:in `initialize' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/devise-4.2.0/lib/devise.rb:331:in `new' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/devise-4.2.0/lib/devise.rb:331:in `add_mapping' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/devise-4.2.0/lib/devise/rails/routes.rb:241:in `block in devise_for' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/devise-4.2.0/lib/devise/rails/routes.rb:240:in `each' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/devise-4.2.0/lib/devise/rails/routes.rb:240:in `devise_for' from /home/ubuntu/workspace/saasapp/config/routes.rb:3:in `block in <top (required)>' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/actionpack-5.0.0/lib/action_dispatch/routing/route_set.rb:389:in `instance_exec' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/actionpack-5.0.0/lib/action_dispatch/routing/route_set.rb:389:in `eval_block' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/actionpack-5.0.0/lib/action_dispatch/routing/route_set.rb:371:in `draw' from /home/ubuntu/workspace/saasapp/config/routes.rb:1:in `<top (required)>' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/activesupport-5.0.0/lib/active_support/dependencies.rb:287:in `load' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/activesupport-5.0.0/lib/active_support/dependencies.rb:287:in `block in load' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/activesupport-5.0.0/lib/active_support/dependencies.rb:259:in `load_dependency' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/activesupport-5.0.0/lib/active_support/dependencies.rb:287:in `load' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/railties-5.0.0/lib/rails/application/routes_reloader.rb:40:in `block in load_paths' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/railties-5.0.0/lib/rails/application/routes_reloader.rb:40:in `each' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/railties-5.0.0/lib/rails/application/routes_reloader.rb:40:in `load_paths' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/railties-5.0.0/lib/rails/application/routes_reloader.rb:16:in `reload!' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/railties-5.0.0/lib/rails/application/routes_reloader.rb:26:in `block in updater' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/activesupport-5.0.0/lib/active_support/file_update_checker.rb:77:in `execute' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/railties-5.0.0/lib/rails/application/routes_reloader.rb:27:in `updater' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/railties-5.0.0/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/railties-5.0.0/lib/rails/application/finisher.rb:119:in `block in <module:Finisher>' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/railties-5.0.0/lib/rails/initializable.rb:30:in `instance_exec' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/railties-5.0.0/lib/rails/initializable.rb:30:in `run' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/railties-5.0.0/lib/rails/initializable.rb:55:in `block in run_initializers' from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each' from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component' from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from' from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component' from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:347:in `each' from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:347:in `call' from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component' from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each' from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/railties-5.0.0/lib/rails/initializable.rb:54:in `run_initializers' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/railties-5.0.0/lib/rails/application.rb:352:in `initialize!' from /home/ubuntu/workspace/saasapp/config/environment.rb:5:in `<top (required)>' from /home/ubuntu/workspace/saasapp/config.ru:3:in `require_relative' from /home/ubuntu/workspace/saasapp/config.ru:3:in `block in <main>' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/rack-2.0.1/lib/rack/builder.rb:55:in `instance_eval' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/rack-2.0.1/lib/rack/builder.rb:55:in `initialize' from /home/ubuntu/workspace/saasapp/config.ru:in `new' from /home/ubuntu/workspace/saasapp/config.ru:in `<main>' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/rack-2.0.1/lib/rack/builder.rb:49:in `eval' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/rack-2.0.1/lib/rack/builder.rb:49:in `new_from_string' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/rack-2.0.1/lib/rack/builder.rb:40:in `parse_file' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/rack-2.0.1/lib/rack/server.rb:318:in `build_app_and_options_from_config' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/rack-2.0.1/lib/rack/server.rb:218:in `app' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/railties-5.0.0/lib/rails/commands/server.rb:59:in `app' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/rack-2.0.1/lib/rack/server.rb:353:in `wrapped_app' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/railties-5.0.0/lib/rails/commands/server.rb:124:in `log_to_stdout' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/railties-5.0.0/lib/rails/commands/server.rb:77:in `start' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:90:in `block in server' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:85:in `tap' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:85:in `server' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:49:in `run_command!' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/railties-5.0.0/lib/rails/commands.rb:18:in `<top (required)>' from /home/ubuntu/workspace/saasapp/bin/rails:9:in `require' from /home/ubuntu/workspace/saasapp/bin/rails:9:in `<top (required)>' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/spring-1.7.2/lib/spring/client/rails.rb:28:in `load' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/spring-1.7.2/lib/spring/client/rails.rb:28:in `call' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/spring-1.7.2/lib/spring/client/command.rb:7:in `call' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/spring-1.7.2/lib/spring/client.rb:30:in `run' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/spring-1.7.2/bin/spring:49:in `<top (required)>' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/spring-1.7.2/lib/spring/binstub.rb:11:in `load' from /usr/local/rvm/gems/ruby-2.3.0@saasapp/gems/spring-1.7.2/lib/spring/binstub.rb:11:in `<top (required)>' from /home/ubuntu/workspace/saasapp/bin/spring:15:in `require' from /home/ubuntu/workspace/saasapp/bin/spring:15:in `<top (required)>' from bin/rails:3:in `load' from bin/rails:3:in `<main>' fwinograd:~/workspace/saasapp (user_memberships)


#4

looks like an error in your code, in /home/ubuntu/workspace/saasapp/app/models/user.rb:10