Try to print "Hello World" on webpage but something happened - ruby-on-rails

I am a beginner in Ruby on Rails.
Today, I want to have my first try to print "Hello World" on webpage but something happened.
First of all,I create a "project" folder by "mkdir project" and then create new rails project in this folder by "rails new demo".
Next,I type "rails server" and website shows good.
Then,I type "rails generate controller welcome" and put this code
Demo::Application.routes.draw do
get "welcome/say_hello" => "welcome#say"
# ...
end
into config/routes.rb .
Then, I run "rails server" again and some problem happened like below.
C:\project\demo>rails s
=> Booting WEBrick
=> Rails 4.0.0 application starting in development on http://localhost:3000/
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Exiting
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in `load': C:/project/demo/config/routes.rb:59:
syntax error, unexpected keyword_end, expecting $end (SyntaxError)
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport4.0.0/lib/active_support/dependencies.rb:222:in `block in load'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport4.0.0/lib/active_support/dependencies.rb:222:in `load'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:40:in `each'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:40:in `load_paths'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:16:in `reload!'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:26:in `block in updater'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.0.0/lib/active_support/file_update_checker.rb:75:in `call'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.0.0/lib/active_support/file_update_checker.rb:75:in `execute'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:27:in `updater'
from C:65535:in `execute_if_updated'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `instance_exec'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `run'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/initializable.rb:55:in `block in run_initializers'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:150:in `block intsort_each'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:183:in `block (2 levels)in each_strongly_connected_component'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:219:in `each_strongly_connected_component_from'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:182:in `block in each_strongly_connected_component'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:180:in `each'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:180:in `each_strongly_connected_component'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:148:in `tsort_each'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/initializable.rb:54:in `run_initializers'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/application.rb:215:in `initialize!'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
from C:/project/demo/config/environment.rb:5:in `<top (required)>'
from C:/project/demo/config.ru:3:in `require'
from C:/project/demo/config.ru:3:in `block in <main>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
from C:/project/demo/config.ru:in `new'
from C:/project/demo/config.ru:in `<main>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/commands/server.rb:48:in `app'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/commands/server.rb:75:in `start'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/commands.rb:78:in `block in <top (required)>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/commands.rb:73:in `tap'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/commands.rb:73:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
Is anyone know what happened??
This is my routes filr as below:
Demo::Application.routes.draw do
get "welcome/say_hello" => "welcome#say"
# ...
end

You have a syntax error in your routes file on line 59. You probably forgot to add a do keyword to a block, or forgot to close a block by using an end keyword.
Show us your routes file in order to debug the problem more accurately.
See this line in the stack trace:
load': C:/project/demo/config/routes.rb:59: syntax error, unexpected keyword_end, expecting $end

Related

Running rails server on bash a linux system on windows

I am following this steps to install ruby on rails in ubuntu or linux subsystem on windows 10.
But this time, I used the updated ruby which is version 2.3.3, rails which is version 5.0.0.1, but after successfull installation of all the requirements, I tried to run this
rails new ruby_app
in the path /mnt/c/xampp/htdocs/ which is in windows local c and after a successfull installation I tried running this.
rails server
I got this problem
/home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/app_loader.rb:40: warning: Insecure world writable dir /home/fil/.rbenv/versions in PATH, mode 040777
=> Booting Puma
=> Rails 5.0.0.1 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
Exiting
/home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rb-inotify-0.9.7/lib/rb-inotify/watcher.rb:74:in `initialize': Invalid argument - Failed to watch "/home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/locale": the given event mask contains no legal events; or fd is not an inotify file descriptor. (Errno::EINVAL)
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rb-inotify-0.9.7/lib/rb-inotify/notifier.rb:190:in `new'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rb-inotify-0.9.7/lib/rb-inotify/notifier.rb:190:in `watch'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rb-inotify-0.9.7/lib/rb-inotify/notifier.rb:204:in `watch'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/adapter/linux.rb:32:in `_configure'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/adapter/base.rb:45:in `block in configure'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/adapter/base.rb:40:in `each'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/adapter/base.rb:40:in `configure'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/adapter/base.rb:63:in `start'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/backend.rb:28:in `start'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/listener.rb:67:in `block in <class:Listener>'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/fsm.rb:120:in `instance_eval'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/fsm.rb:120:in `call'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/fsm.rb:91:in `transition_with_callbacks!'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/fsm.rb:57:in `transition'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/listener.rb:90:in `start'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/evented_file_update_checker.rb:90:in `boot!'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/evented_file_update_checker.rb:61:in `initialize'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/i18n_railtie.rb:59:in `new'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/i18n_railtie.rb:59:in `initialize_i18n'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/i18n_railtie.rb:15:in `block in <class:Railtie>'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/lazy_load_hooks.rb:44:in `each'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/application/finisher.rb:65:in `block in <module:Finisher>'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:30:in `instance_exec'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:30:in `run'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/2.3.0/tsort.rb:347:in `each'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/2.3.0/tsort.rb:347:in `call'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:54:in `run_initializers'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/application.rb:352:in `initialize!'
from /mnt/c/xampp/htdocs/ruby_app/config/environment.rb:5:in `<top (required)>'
from /mnt/c/xampp/htdocs/ruby_app/config.ru:3:in `require_relative'
from /mnt/c/xampp/htdocs/ruby_app/config.ru:3:in `block in <main>'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:55:in `instance_eval'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:55:in `initialize'
from /mnt/c/xampp/htdocs/ruby_app/config.ru:in `new'
from /mnt/c/xampp/htdocs/ruby_app/config.ru:in `<main>'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:49:in `eval'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:49:in `new_from_string'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:40:in `parse_file'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/server.rb:318:in `build_app_and_options_from_config'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/server.rb:218:in `app'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/server.rb:59:in `app'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/server.rb:353:in `wrapped_app'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/server.rb:124:in `log_to_stdout'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/server.rb:77:in `start'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:90:in `block in server'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:85:in `tap'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:85:in `server'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands.rb:18:in `<top (required)>'
from /mnt/c/xampp/htdocs/ruby_app/bin/rails:9:in `require'
from /mnt/c/xampp/htdocs/ruby_app/bin/rails:9:in `<top (required)>'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/spring-2.0.0/lib/spring/client/rails.rb:28:in `load'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/spring-2.0.0/lib/spring/client/rails.rb:28:in `call'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/spring-2.0.0/lib/spring/client/command.rb:7:in `call'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/spring-2.0.0/lib/spring/client.rb:30:in `run'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/spring-2.0.0/bin/spring:49:in `<top (required)>'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/spring-2.0.0/lib/spring/binstub.rb:31:in `load'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/spring-2.0.0/lib/spring/binstub.rb:31:in `<top (required)>'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /mnt/c/xampp/htdocs/ruby_app/bin/spring:14:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
Can you give idea what is this? how to solve it?
Don't have enough reputation to post as comment but this should provide some answers: https://github.com/rails/rails/issues/26054
Seems to be a windows related issue from last month.
Haven't used ruby on rails in quite a while so I can't reproduce or test (right now) to see if this is true.
From a comment wich was helpful to others:
Go to you config/environments/development.rb and comment out the last
line, something about watching files and listen gem. can't remember
from the top of my head the exact wording, but it is the last line of
config
this is new a new method that rails uses to watch changed files, but
it doesn't work on WSL
I think guard gem will also fail because of this
Bottom line:
Using rails new --skip-spring --skip-listen gives you a working app

Error shows up in server when using private_pub gem

I've been trying to use the private_pub gem for real-time updates in sample app so I can learn it and use it on the app I'm working on . But it always throws the following error when I type
rails s
shyam#shyam-SATELLITE-C50-B:~/Ajaxtry$ rails s
=> Booting Thin
=> Rails 4.2.2 application starting in development on
http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Exiting
/home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/private_pub-1.0.3/lib/private_pub.rb:21:in `load_config': uninitialized constant YAML (NameError)
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/private_pub-1.0.3/lib/private_pub/engine.rb:8:in `block in <class:Engine>'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/initializable.rb:30:in `instance_exec'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/initializable.rb:30:in `run'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `each'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `call'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/initializable.rb:54:in `run_initializers'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/application.rb:352:in `initialize!'
from /home/shyam/Ajaxtry/config/environment.rb:5:in `<top (required)>'
from /home/shyam/Ajaxtry/config.ru:3:in `require'
from /home/shyam/Ajaxtry/config.ru:3:in `block in <main>'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `instance_eval'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `initialize'
from /home/shyam/Ajaxtry/config.ru:in `new'
from /home/shyam/Ajaxtry/config.ru:in `<main>'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `eval'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `new_from_string'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:40:in `parse_file'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:299:in `build_app_and_options_from_config'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:208:in `app'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/commands/server.rb:61:in `app'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:336:in `wrapped_app'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/commands/server.rb:139:in `log_to_stdout'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/commands/server.rb:78:in `start'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:80:in `block in server'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:75:in `server'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/commands.rb:17:in `<top (required)>'
from /home/shyam/Ajaxtry/bin/rails:9:in `require'
from /home/shyam/Ajaxtry/bin/rails:9:in `<top (required)>'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.5.0/lib/spring/client/rails.rb:28:in `load'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.5.0/lib/spring/client/rails.rb:28:in `call'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.5.0/lib/spring/client/command.rb:7:in `call'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.5.0/lib/spring/client.rb:28:in `run'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.5.0/bin/spring:49:in `<top (required)>'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.5.0/lib/spring/binstub.rb:11:in `load'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.5.0/lib/spring/binstub.rb:11:in `<top (required)>'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /home/shyam/Ajaxtry/bin/spring:13:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
The thin server seems to be working fine. Would appreciate any help .
I'm using ruby -v 2.2.2p95 and rails 4.2.2
UPDATE:
I do not think that it is with either the private_pub gem or the Sync gem(I tried using Sync just to make sure). Its still showing the same error. Since it says YAML is an uninitialized constant, i checked the function storing the YAML load and it looks like the following:
#.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sync-0.3.5/lib/sync.rb
def load_config(filename, environment)
reset_config
yaml = YAML.load(ERB.new(File.read(filename)).result)[environment.to_s]
raise ArgumentError, "The #{environment} environment does not exist in #{filename}" if yaml.nil?
yaml.each{|key, value| config[key.to_sym] = value }
setup_logger
if adapter
setup_client
else
setup_dummy_client
end
end
Why doesn't ruby recognize that YAML?
Private Pub does not work with Rails 4. It has been forked to this gem:
https://github.com/gregmolnar/chatter
See this thread and comment: https://github.com/ryanb/private_pub/issues/83#issuecomment-23869164

Receiving syntax error message when trying to start application server for first Rails application after configuration [noob]

The following message pops up when I enter $ rails server in the Terminal (Mac, running latest version of Yosemite). I'm pretty lost, other topics have recommended altering the text in the config folder of my project, but what I've tried hasn't worked and I'm guessing because those are slightly dated topics.
I'm learning from the Learn Ruby on Rails book trying to get this MailChimp application working, completed up to the 13th chapter without any big issues. Any help is appreciated.
=> Booting WEBrick
=> Rails 4.1.1 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (-- binding option)
=> Ctrl-C to shutdown server
Exiting
/Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/psych.rb:370:in `parse': (<unknown>): found character that cannot start any token while scanning for the next token at line 14 column 1 (Psych::SyntaxError)
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/psych.rb:370:in `parse_stream'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/psych.rb:318:in `parse'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/psych.rb:245:in `load'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/application.rb:313:in `secrets'
from /Users/dengel29/workspace/learn-rails/config/environments/development.rb:32:in `block in <top (required)>'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/railtie.rb:210:in `instance_eval'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/railtie.rb:210:in `configure'
from /Users/dengel29/workspace/learn-rails/config/environments/development.rb:1:in `<top (required)>'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `block in require'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:232:in `load_dependency'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/engine.rb:594:in `block (2 levels) in <class:Engine>'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/engine.rb:593:in `each'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/engine.rb:593:in `block in <class:Engine>'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/initializable.rb:30:in `run'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:226:in `block in tsort_each'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:418:in `block (2 levels) in each_strongly_connected_component_from'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:427:in `each_strongly_connected_component_from'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:417:in `block in each_strongly_connected_component_from'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/initializable.rb:44:in `each'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/initializable.rb:44:in `tsort_each_child'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:411:in `call'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:411:in `each_strongly_connected_component_from'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:345:in `each'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:345:in `call'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:345:in `each_strongly_connected_component'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:224:in `tsort_each'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:205:in `tsort_each'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/application.rb:288:in `initialize!'
from /Users/dengel29/workspace/learn-rails/config/environment.rb:5:in `<top (required)>'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `block in require'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:232:in `load_dependency'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
from /Users/dengel29/workspace/learn-rails/config.ru:3:in `block in <main>'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
from /Users/dengel29/workspace/learn-rails/config.ru:in `new'
from /Users/dengel29/workspace/learn-rails/config.ru:in `<main>'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/commands/server.rb:50:in `app'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/commands/server.rb:130:in `log_to_stdout'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/commands/server.rb:67:in `start'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:81:in `block in server'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:76:in `tap'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:76:in `server'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/commands.rb:17:in `<top (required)>'
from /Users/dengel29/workspace/learn-rails/bin/rails:8:in `require'
from /Users/dengel29/workspace/learn-rails/bin/rails:8:in `<top (required)>'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in `load'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in `call'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/spring-1.1.3/lib/spring/client/command.rb:7:in `call'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/spring-1.1.3/lib/spring/client.rb:26:in `run'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/spring-1.1.3/bin/spring:48:in `<top (required)>'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `load'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `<top (required)>'
from /Users/dengel29/workspace/learn-rails/bin/spring:16:in `require'
from /Users/dengel29/workspace/learn-rails/bin/spring:16:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
Perhaps your ENV variables are not set up correctly, or you have an unusual character in one of the variables. Be careful there are not tab characters or any unusual characters in the config/secrets.yml file.
I suggest you replace all ENV values in the config/secrets.yml with hardcoded strings. Don't check the file into git with your private credentials in the file. Just test it to see if you can isolate the problem.

Rails server exits on startup. (Rails 4.0.2)

Rails server suddenly keeps exiting on startup. Though it worked perfectly a little while ago. I haven't tweaked anything since.
=> Booting WEBrick
=> Rails 4.0.2 application starting in development on http: //0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Exiting
/home/kavya/.rvm/gems/ruby-2.1.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:229:in `default_controller_and_action': missing :controller (ArgumentError)
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:116:in `normalize_options!'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:64:in `initialize'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:1443:in `new'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:1443:in `add_route'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:1422:in `decomposed_match'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:1403:in `block in match'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:1394:in `each'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:1394:in `match'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:601:in `map_method'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:570:in `post'
from /home/kavya/lms/config/routes.rb:11:in `block in <top (required)>'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/route_set.rb:341:in `instance_exec'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/route_set.rb:341:in `eval_block'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/route_set.rb:319:in `draw'
from /home/kavya/lms/config/routes.rb:1:in `<top (required)>'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:223:in `load'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:223:in `block in load'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:214:in `load_dependency'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:223:in `load'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/application/routes_reloader.rb:40:in `each'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/application/routes_reloader.rb:40:in `load_paths'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/application/routes_reloader.rb:16:in `reload!'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/application/routes_reloader.rb:26:in `block in updater'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.2/lib/active_support/file_update_checker.rb:75:in `call'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.2/lib/active_support/file_update_checker.rb:75:in `execute'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/application/routes_reloader.rb:27:in `updater'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/application/routes_reloader.rb:6:in `execute_if_updated'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/initializable.rb:30:in `instance_exec'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/initializable.rb:30:in `run'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/kavya/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:226:in `block in tsort_each'
from /home/kavya/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /home/kavya/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:427:in `each_strongly_connected_component_from'
from /home/kavya/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /home/kavya/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:345:in `each'
from /home/kavya/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:345:in `call'
from /home/kavya/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:345:in `each_strongly_connected_component'
from /home/kavya/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:224:in `tsort_each'
from /home/kavya/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:205:in `tsort_each'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/initializable.rb:54:in `run_initializers'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/application.rb:215:in `initialize!'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /home/kavya/lms/config/environment.rb:5:in `<top (required)>'
from /home/kavya/lms/config.ru:3:in `require'
from /home/kavya/lms/config.ru:3:in `block in <main>'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
from /home/kavya/lms/config.ru:in `new'
from /home/kavya/lms/config.ru:in `<main>'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/commands/server.rb:48:in `app'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/commands/server.rb:75:in `start'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/commands.rb:76:in `block in <top (required)>'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/commands.rb:71:in `tap'
from /home/kavya/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/commands.rb:71:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
As you can refer here..
Why is my development server not loading? default_controller_and_action': missing :action (ArgumentError)
It's because of syntax problem under config/routes.rb in your application:
Check your routes you may find like for example while defining controller#action in routes like below..
Syntax should not be like:
root :to => 'home/index'
Syntax should be like:
root :to => 'home#index'

rails server argument error

After installing devise with devise_install successfully, when restarting the server, I am getting the following error. Please help me. I have gone through number of questions and I am not getting correct response .
Error :
bfmt048#bfmt048-System-Product-Name:~/demo$ rails s
=> Booting WEBrick
=> Rails 4.0.0 application starting in development on zero.zero.zero.zero:threethousand
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Exiting
/home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activemodel-4.0.0/lib/active_model/validations/format.rb:46:in `check_options_validity': The provided regular expression is using multiline anchors (^ or $), which may present a security risk. Did you mean to use \A and \z, or forgot to add the :multiline => true option? (ArgumentError)
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activemodel-4.0.0/lib/active_model/validations/format.rb:20:in `check_validity!'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activemodel-4.0.0/lib/active_model/validator.rb:143:in `initialize'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activemodel-4.0.0/lib/active_model/validations/with.rb:87:in `new'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activemodel-4.0.0/lib/active_model/validations/with.rb:87:in `block in validates_with'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activemodel-4.0.0/lib/active_model/validations/with.rb:86:in `each'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activemodel-4.0.0/lib/active_model/validations/with.rb:86:in `validates_with'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activemodel-4.0.0/lib/active_model/validations/format.rb:111:in `validates_format_of'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/devise-1.1.rc0/lib/devise/models/validatable.rb:20:in `block in included'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/devise-1.1.rc0/lib/devise/models/validatable.rb:17:in `class_eval'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/devise-1.1.rc0/lib/devise/models/validatable.rb:17:in `included'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/devise-1.1.rc0/lib/devise/models.rb:63:in `include'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/devise-1.1.rc0/lib/devise/models.rb:63:in `block (2 levels) in devise'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/devise-1.1.rc0/lib/devise/models.rb:63:in `each'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/devise-1.1.rc0/lib/devise/models.rb:63:in `block in devise'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/devise-1.1.rc0/lib/devise/models.rb:77:in `devise_modules_hook!'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/devise-1.1.rc0/lib/devise/models.rb:62:in `devise'
from /home/bfmt048/demo/app/models/user.rb:4:in `<class:User>'
from /home/bfmt048/demo/app/models/user.rb:1:in `<top (required)>'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:423:in `load'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:423:in `block in load_file'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:615:in `new_constants_in'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:422:in `load_file'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:323:in `require_or_load'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:462:in `load_missing_constant'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:183:in `const_missing'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/inflector/methods.rb:226:in `const_get'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/inflector/methods.rb:226:in `block in constantize'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/inflector/methods.rb:224:in `each'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/inflector/methods.rb:224:in `inject'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/inflector/methods.rb:224:in `constantize'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/core_ext/string/inflections.rb:66:in `constantize'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/devise-1.1.rc0/lib/devise/mapping.rb:75:in `to'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/devise-1.1.rc0/lib/devise/mapping.rb:68:in `modules'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/devise-1.1.rc0/lib/devise/mapping.rb:81:in `strategies'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/devise-1.1.rc0/lib/devise.rb:166:in `register'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/devise-1.1.rc0/lib/devise/rails/routes.rb:93:in `block in devise_for'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/devise-1.1.rc0/lib/devise/rails/routes.rb:92:in `each'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/devise-1.1.rc0/lib/devise/rails/routes.rb:92:in `devise_for'
from /home/bfmt048/demo/config/routes.rb:3:in `block in <top (required)>'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/routing/route_set.rb:316:in `instance_exec'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/routing/route_set.rb:316:in `eval_block'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/routing/route_set.rb:294:in `draw'
from /home/bfmt048/demo/config/routes.rb:1:in `<top (required)>'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in `load'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in `block in load'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in `load'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:40:in `each'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:40:in `load_paths'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:16:in `reload!'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:26:in `block in updater'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/file_update_checker.rb:75:in `call'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/file_update_checker.rb:75:in `execute'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:27:in `updater'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:6:in `execute_if_updated'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `instance_exec'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `run'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/2.0.0/tsort.rb:180:in `each'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:54:in `run_initializers'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:215:in `initialize!'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /home/bfmt048/demo/config/environment.rb:5:in `<top (required)>'
from /home/bfmt048/demo/config.ru:3:in `require'
from /home/bfmt048/demo/config.ru:3:in `block in <main>'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
from /home/bfmt048/demo/config.ru:in `new'
from /home/bfmt048/demo/config.ru:in `<main>'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands/server.rb:48:in `app'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands/server.rb:75:in `start'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:78:in `block in <top (required)>'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:73:in `tap'
from /home/bfmt048/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:73:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
ArgumentError: The provided regular expression is using multiline anchors (^ or $),
which may present a security risk. Did you mean to use \A and \z,
or forgot to add the :multiline => true option?
This error occurs when trying to upgrade from previous version of rails to rails 4.0.0.
Regexp validation for validates_format_of.
If you don’t expect multiline incoming data, you need to replace all the “^” with “\A” and all the “$” with “\z”. If you expect multiline strings, just specify the multiline: true option.
Source: http://dev.mensfeld.pl/2013/07/upgrading-to-rails-4-0-from-rails-3-2-test-case-part-ii-assets-models/
Not sure of the specific reason for your error, but I would try updating devise to latest version which supports rails 4.0.0.
this is a new check in rails 4. why are you using such an old devise version (and why an rc?). just use the most recent release by putting
gem "devise", "~> 3.0.3"
in your Gemfile
It's not safe to use ^ and $ since $ matches \n (new-line characted) which has the possibility to enter an email like "test123#example.com\n< script>/* ... */< /script >"
http://edgeguides.rubyonrails.org/active_record_validations.html#format
So if we use ^ and $ to match the end or beginning of an expression then the above is likely to pass the filter and any malicious code can be passed in with the email entered.
We can either use the /A, /Z option to specfy the beginning and end of a line, instead of ^ and $, or else we can set the :multiline option to true
eg: validates :content, format: { with: /^Meanwhile$/, multiline: true }
http://edgeguides.rubyonrails.org/security.html#regular-expressions

Resources