Syntax Error every Time I run a rails command - ruby-on-rails

I'm trying to generate pages for a new rails project but I keep getting this error.
$ rails generate controller pages home
/Users/reidwahlbrink/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:241:in `load':/Users/reidwahlbrink/Desktop/Hanna's Blog/config/initializers/session_store.rb:3: syntax error, unexpected tIDENTIFIER, expecting end-of-input
...re, key: '_Hanna's_Blog_session'
... ^ (SyntaxError)
from /Users/reidwahlbrink/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:241:in `block in load'
from /Users/reidwahlbrink/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:232:in `load_dependency'
from /Users/reidwahlbrink/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:241:in `load'
from /Users/reidwahlbrink/.rvm/gems/ruby-2.1.2/gems/railties-4.1.4/lib/rails/engine.rb:648:in `block in load_config_initializer'
from /Users/reidwahlbrink/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.4/lib/active_support/notifications.rb:161:in `instrument'
from /Users/reidwahlbrink/.rvm/gems/ruby-2.1.2/gems/railties-4.1.4/lib/rails/engine.rb:647:in `load_config_initializer'
from /Users/reidwahlbrink/.rvm/gems/ruby-2.1.2/gems/railties-4.1.4/lib/rails/engine.rb:612:in `block (2 levels) in <class:Engine>'
from /Users/reidwahlbrink/.rvm/gems/ruby-2.1.2/gems/railties-4.1.4/lib/rails/engine.rb:611:in `each'
from /Users/reidwahlbrink/.rvm/gems/ruby-2.1.2/gems/railties-4.1.4/lib/rails/engine.rb:611:in `block in <class:Engine>'
from /Users/reidwahlbrink/.rvm/gems/ruby-2.1.2/gems/railties-4.1.4/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/reidwahlbrink/.rvm/gems/ruby-2.1.2/gems/railties-4.1.4/lib/rails/initializable.rb:30:in `run'
from /Users/reidwahlbrink/.rvm/gems/ruby-2.1.2/gems/railties-4.1.4/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/reidwahlbrink/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tsort.rb:226:in `block in tsort_each'
from /Users/reidwahlbrink/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /Users/reidwahlbrink/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tsort.rb:418:in `block (2 levels) in each_strongly_connected_component_from'
from /Users/reidwahlbrink/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tsort.rb:427:in `each_strongly_connected_component_from'
from /Users/reidwahlbrink/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tsort.rb:417:in `block in each_strongly_connected_component_from'
from /Users/reidwahlbrink/.rvm/gems/ruby-2.1.2/gems/railties-4.1.4/lib/rails/initializable.rb:44:in `each'
from /Users/reidwahlbrink/.rvm/gems/ruby-2.1.2/gems/railties-4.1.4/lib/rails/initializable.rb:44:in `tsort_each_child'
from /Users/reidwahlbrink/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tsort.rb:411:in `call'
from /Users/reidwahlbrink/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tsort.rb:411:in `each_strongly_connected_component_from'
from /Users/reidwahlbrink/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /Users/reidwahlbrink/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tsort.rb:345:in `each'
from /Users/reidwahlbrink/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tsort.rb:345:in `call'
from /Users/reidwahlbrink/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tsort.rb:345:in `each_strongly_connected_component'
from /Users/reidwahlbrink/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tsort.rb:224:in `tsort_each'
from /Users/reidwahlbrink/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tsort.rb:205:in `tsort_each'
from /Users/reidwahlbrink/.rvm/gems/ruby-2.1.2/gems/railties-4.1.4/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/reidwahlbrink/.rvm/gems/ruby-2.1.2/gems/railties-4.1.4/lib/rails/application.rb:300:in `initialize!'
from /Users/reidwahlbrink/Desktop/Hanna's Blog/config/environment.rb:5:in `<top (required)>'
from /Users/reidwahlbrink/.rvm/gems/ruby-2.1.2/gems/spring-1.1.3/lib/spring/application.rb:92:in `require'
from /Users/reidwahlbrink/.rvm/gems/ruby-2.1.2/gems/spring-1.1.3/lib/spring/application.rb:92:in `preload'
from /Users/reidwahlbrink/.rvm/gems/ruby-2.1.2/gems/spring-1.1.3/lib/spring/application.rb:140:in `serve'
from /Users/reidwahlbrink/.rvm/gems/ruby-2.1.2/gems/spring-1.1.3/lib/spring/application.rb:128:in `block in run'
from /Users/reidwahlbrink/.rvm/gems/ruby-2.1.2/gems/spring-1.1.3/lib/spring/application.rb:122:in `loop'
from /Users/reidwahlbrink/.rvm/gems/ruby-2.1.2/gems/spring-1.1.3/lib/spring/application.rb:122:in `run'
from /Users/reidwahlbrink/.rvm/gems/ruby-2.1.2/gems/spring-1.1.3/lib/spring/application/boot.rb:18:in `<top (required)>'
from /Users/reidwahlbrink/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/reidwahlbrink/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'
I've also tried to run rails server and it will load the server and then exit and return this same error. I'm working my way through One Month Rails and was trying to set up my own project with what I had learned so far after watching the creating more pages lesson. Please help!

You need to escape your apostrophe '_Hanna\'s_Blog_session'
Or you can just use double quotes "_Hanna's_Blog_session"
The reason for this is that in the single quotes case you need to identify that the apostrophe is part of the string literal rather than the end of the string.

You have a space and a single quote in your application's path:
/Users/reidwahlbrink/Desktop/Hanna's Blog/
^ ^
Probably from running:
rails new "Hanna's Blog"
This is going to cause many problems. You should delete that directory and instead run:
rails new hannasblog

Related

rails generate controller Comments not creating the files it should create

Am following ruby on rails documentation and am hooked here, it dosen't seem to create expected files, i need some help please.
C:\Sites\blog>rails generate controller Comments
i ran the code above but got this instead.
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:286:in `load': C:/Sites/blog/config/routes.rb:10: syntax error, unexpected end-of-input, expecting keyword_end (SyntaxError)
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:286:in `block in load'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:286:in `load'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/application/routes_reloader.rb:55:in `block in load_paths'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/application/routes_reloader.rb:55:in `each'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/application/routes_reloader.rb:55:in `load_paths'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/application/routes_reloader.rb:18:in `reload!'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/application/routes_reloader.rb:41:in `block in updater'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/file_update_checker.rb:81:in `execute'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/application/routes_reloader.rb:42:in `updater'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/application/routes_reloader.rb:31:in `execute_if_updated'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/application/finisher.rb:128:in `block in <module:Finisher>'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/initializable.rb:30:in `instance_exec'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/initializable.rb:30:in `run'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/initializable.rb:59:in `block in run_initializers'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:347:in `each'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:347:in `call'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/initializable.rb:58:in `run_initializers'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/application.rb:353:in `initialize!'
from C:/Sites/blog/config/environment.rb:5:in `<top (required)>'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/application.rb:329:in `require'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/application.rb:329:in `require_environment!'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/command/actions.rb:16:in `require_application_and_environment!'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/commands/generate/generate_command.rb:19:in `perform'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/command/base.rb:63:in `perform'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/command.rb:44:in `invoke'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/commands.rb:16:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
- List item
Please help me, and is documentation the best place for learning rails
Your routes.rb has an error in it somewhere. Backup your existing routes.rb file and then change it to,
Rails.application.routes.draw do
end
Then run your generate command. Afterwards, add the previous contents back into routes.rb

Have trouble with migration after uninstalling Devise gem

I tried installing devise but ran into a lot of migration issues so went ahead and uninstalled the gem. I tried running rake:db migrate, redo, reset, and drop and I still get this error even without Devise:
/Users/ashleighalmeida/mixi/config/initializers/devise.rb:3:in `<top (required)>': uninitialized constant Devise (NameError)
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:652:in `block in load_config_initializer'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/notifications.rb:166:in `instrument'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:651:in `load_config_initializer'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:615:in `each'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:615:in `block in <class:Engine>'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `run'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/2.1.0/tsort.rb:226:in `block in tsort_each'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/2.1.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/2.1.0/tsort.rb:418:in `block (2 levels) in each_strongly_connected_component_from'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/2.1.0/tsort.rb:427:in `each_strongly_connected_component_from'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/2.1.0/tsort.rb:417:in `block in each_strongly_connected_component_from'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:44:in `each'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:44:in `tsort_each_child'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/2.1.0/tsort.rb:411:in `call'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/2.1.0/tsort.rb:411:in `each_strongly_connected_component_from'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/2.1.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/2.1.0/tsort.rb:345:in `each'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/2.1.0/tsort.rb:345:in `call'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/2.1.0/tsort.rb:345:in `each_strongly_connected_component'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/2.1.0/tsort.rb:224:in `tsort_each'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/2.1.0/tsort.rb:205:in `tsort_each'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.1/lib/rails/application.rb:352:in `initialize!'
from /Users/ashleighalmeida/mixi/config/environment.rb:5:in `<top (required)>'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/spring-1.3.6/lib/spring/application.rb:92:in `preload'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/spring-1.3.6/lib/spring/application.rb:143:in `serve'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/spring-1.3.6/lib/spring/application.rb:131:in `block in run'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/spring-1.3.6/lib/spring/application.rb:125:in `loop'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/spring-1.3.6/lib/spring/application.rb:125:in `run'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/spring-1.3.6/lib/spring/application/boot.rb:18:in `<top (required)>'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from -e:1:in `<main>'
How do I completely remove Devise from my migration? Thanks!
Seems like you forgot to remove Devise initializer, which lies here:
config/initializers/devise.rb

Curious ouput of rails controller generator

Cannot generate controller via (it doesn't appear in /app/controllers/) rails generate controller StaticPages
Output:
azureuser#host:~/railstutorial_apps/demo$ rails generate controller StaticPages --no-test-framework
/home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:268:in `load': /home/azureuser/railstutorial_
/home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:268:in `load': /home/azureuser/railst[0/1427]
apps/demo/config/initializers/session_store.rb:1: syntax error, unexpected keyword_when, expecting end-of-input
ure to restart your server when you modify this file.
^ (SyntaxError)
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:268:in `block in load'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:240:in `load_dependency'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:268:in `load'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/railties-4.2.3/lib/rails/engine.rb:652:in `block in load_config_initializer'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/activesupport-4.2.3/lib/active_support/notifications.rb:166:in `instrument'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/railties-4.2.3/lib/rails/engine.rb:651:in `load_config_initializer'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/railties-4.2.3/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/railties-4.2.3/lib/rails/engine.rb:615:in `each'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/railties-4.2.3/lib/rails/engine.rb:615:in `block in <class:Engine>'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/railties-4.2.3/lib/rails/initializable.rb:30:in `instance_exec'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/railties-4.2.3/lib/rails/initializable.rb:30:in `run'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/railties-4.2.3/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/azureuser/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
from /home/azureuser/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
from /home/azureuser/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/tsort.rb:210:in `block (2 levels) in each_strongly_connected_component_from'
from /home/azureuser/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
from /home/azureuser/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/tsort.rb:209:in `block in each_strongly_connected_component_from'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/railties-4.2.3/lib/rails/initializable.rb:44:in `each'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/railties-4.2.3/lib/rails/initializable.rb:44:in `tsort_each_child'
from /home/azureuser/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/tsort.rb:203:in `each_strongly_connected_component_from'
from /home/azureuser/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
from /home/azureuser/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/tsort.rb:180:in `each'
from /home/azureuser/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
from /home/azureuser/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/railties-4.2.3/lib/rails/initializable.rb:54:in `run_initializers'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/railties-4.2.3/lib/rails/application.rb:352:in `initialize!'
from /home/azureuser/railstutorial_apps/demo/config/environment.rb:5:in `<top (required)>'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/spring-1.3.6/lib/spring/application.rb:92:in `require'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/spring-1.3.6/lib/spring/application.rb:92:in `preload'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/spring-1.3.6/lib/spring/application.rb:143:in `serve'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/spring-1.3.6/lib/spring/application.rb:131:in `block in run'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/spring-1.3.6/lib/spring/application.rb:125:in `loop'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/spring-1.3.6/lib/spring/application.rb:125:in `run'
from /home/azureuser/.rvm/gems/ruby-2.0.0-p643#railstutorial_gemset/gems/spring-1.3.6/lib/spring/application/boot.rb:18:in `<top (required)>'
from /home/azureuser/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /home/azureuser/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from -e:1:in `<main>'
azureuser#host:~/railstutorial_apps/demo$
As per my comment, there is an error in the config/initializers/session_store.rb. After you fix this error you will be able to generate the controller.

`method_missing': undefined method `aws_access_key' for {}:Figaro::Env

I'm currently having issues with configuring Figaro for my Rails 4 application. Whenever I try to run RSpec or rake db:migrate, I encounter the following error:
method_missing': undefined methodaws_access_key' for {}:Figaro::Env
Here is the complete error message for reference:
Louiss-MacBook-Pro:beautifulnow louismedina$ rspec
/Users/louismedina/.rvm/gems/ruby-2.1.5#beautifulnow-rails4/gems/figaro-0.7.0/lib/figaro/env.rb:9:in `method_missing': undefined method `aws_access_key' for #<Figaro::Env:0x007fc1b17749d8> (NoMethodError)
from /Users/louismedina/Desktop/MindtonicMedia/beautifulnow/config/initializers/aws.rb:1:in `<top (required)>'
from /Users/louismedina/.rvm/gems/ruby-2.1.5#beautifulnow-rails4/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:223:in `load'
from /Users/louismedina/.rvm/gems/ruby-2.1.5#beautifulnow-rails4/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:223:in `block in load'
from /Users/louismedina/.rvm/gems/ruby-2.1.5#beautifulnow-rails4/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:214:in `load_dependency'
from /Users/louismedina/.rvm/gems/ruby-2.1.5#beautifulnow-rails4/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:223:in `load'
from /Users/louismedina/.rvm/gems/ruby-2.1.5#beautifulnow-rails4/gems/railties-4.0.13/lib/rails/engine.rb:609:in `block (2 levels) in <class:Engine>'
from /Users/louismedina/.rvm/gems/ruby-2.1.5#beautifulnow-rails4/gems/railties-4.0.13/lib/rails/engine.rb:608:in `each'
from /Users/louismedina/.rvm/gems/ruby-2.1.5#beautifulnow-rails4/gems/railties-4.0.13/lib/rails/engine.rb:608:in `block in <class:Engine>'
from /Users/louismedina/.rvm/gems/ruby-2.1.5#beautifulnow-rails4/gems/railties-4.0.13/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/louismedina/.rvm/gems/ruby-2.1.5#beautifulnow-rails4/gems/railties-4.0.13/lib/rails/initializable.rb:30:in `run'
from /Users/louismedina/.rvm/gems/ruby-2.1.5#beautifulnow-rails4/gems/railties-4.0.13/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/louismedina/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:226:in `block in tsort_each'
from /Users/louismedina/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /Users/louismedina/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:418:in `block (2 levels) in each_strongly_connected_component_from'
from /Users/louismedina/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:427:in `each_strongly_connected_component_from'
from /Users/louismedina/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:417:in `block in each_strongly_connected_component_from'
from /Users/louismedina/.rvm/gems/ruby-2.1.5#beautifulnow-rails4/gems/railties-4.0.13/lib/rails/initializable.rb:44:in `each'
from /Users/louismedina/.rvm/gems/ruby-2.1.5#beautifulnow-rails4/gems/railties-4.0.13/lib/rails/initializable.rb:44:in `tsort_each_child'
from /Users/louismedina/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:411:in `call'
from /Users/louismedina/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:411:in `each_strongly_connected_component_from'
from /Users/louismedina/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /Users/louismedina/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:345:in `each'
from /Users/louismedina/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:345:in `call'
from /Users/louismedina/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:345:in `each_strongly_connected_component'
from /Users/louismedina/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:224:in `tsort_each'
from /Users/louismedina/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:205:in `tsort_each'
from /Users/louismedina/.rvm/gems/ruby-2.1.5#beautifulnow-rails4/gems/railties-4.0.13/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/louismedina/.rvm/gems/ruby-2.1.5#beautifulnow-rails4/gems/railties-4.0.13/lib/rails/application.rb:215:in `initialize!'
from /Users/louismedina/.rvm/gems/ruby-2.1.5#beautifulnow-rails4/gems/railties-4.0.13/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/louismedina/Desktop/MindtonicMedia/beautifulnow/config/environment.rb:5:in `<top (required)>'
from /Users/louismedina/Desktop/MindtonicMedia/beautifulnow/spec/spec_helper.rb:3:in `require'
from /Users/louismedina/Desktop/MindtonicMedia/beautifulnow/spec/spec_helper.rb:3:in `<top (required)>'
from /Users/louismedina/Desktop/MindtonicMedia/beautifulnow/spec/controllers/admin/admin_controller_spec.rb:1:in `require'
from /Users/louismedina/Desktop/MindtonicMedia/beautifulnow/spec/controllers/admin/admin_controller_spec.rb:1:in `<top (required)>'
from /Users/louismedina/.rvm/gems/ruby-2.1.5#beautifulnow-rails4/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:896:in `load'
from /Users/louismedina/.rvm/gems/ruby-2.1.5#beautifulnow-rails4/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:896:in `block in load_spec_files'
from /Users/louismedina/.rvm/gems/ruby-2.1.5#beautifulnow-rails4/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:896:in `each'
from /Users/louismedina/.rvm/gems/ruby-2.1.5#beautifulnow-rails4/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:896:in `load_spec_files'
from /Users/louismedina/.rvm/gems/ruby-2.1.5#beautifulnow-rails4/gems/rspec-core-2.14.7/lib/rspec/core/command_line.rb:22:in `run'
from /Users/louismedina/.rvm/gems/ruby-2.1.5#beautifulnow-rails4/gems/rspec-core-2.14.7/lib/rspec/core/runner.rb:80:in `run'
from /Users/louismedina/.rvm/gems/ruby-2.1.5#beautifulnow-rails4/gems/rspec-core-2.14.7/lib/rspec/core/runner.rb:17:in `block in autorun'
Does anyone have any guidance on this? Thanks.
I seemed to have solved the issue. In my "application.yml" file, I went ahead and provided these variables with pseudo values in order to get the undefined methods errors to stop.
For example:
aws_access_key: '123456789'
aws_access_secret: '123456789'
aws_bucket: '123456789'
Until Figaro 0.7, if you tried to access keys that didn't exist via Figaro.env.my_non_existant_key you would get an exception. The exception is misleading, because figaro uses Ruby's metaprogramming feature and can define methods at run time (so rather than having to call Figaro.env["my_key1"], you can call a method Figaro.env.my_key1).
Starting with Figaro 1.0, if you call Figaro.env.my_non_existant_key you will get nil as return value. If you want to ensure that the exception is raised when the key doesn't exist you can use new syntax with a 'bang' Figaro.env.my_non_existant_key!.

NoMethodError when using "rails generate scaffold"

I'm following Michael Hartl's Ruby on Rails Tutorial using nitrous.io. Right now I'm trying to make use of the scaffold command and it's returning a NoMethodError. I'm very new to coding so I'm not sure of the cause of the error but here's exactly what's happening:
~/workspace/rails_projects/demo_app(master)$ rails generate scaffold User name:string email:string
/home/action/workspace/rails_projects/demo_app/config/environments/development.rb:1:in `<top (required)>': undefined method `configure' for #<DemoAppp::Application:0x007fa3572a63e8> (NoMethodError)
from /home/action/.gem/ruby/2.1.1/gems/activesupport-4.0.5/lib/active_support/dependencies.rb:229:in `require'
from /home/action/.gem/ruby/2.1.1/gems/activesupport-4.0.5/lib/active_support/dependencies.rb:229:in `block in require'
from /home/action/.gem/ruby/2.1.1/gems/activesupport-4.0.5/lib/active_support/dependencies.rb:214:in `load_dependency'
from /home/action/.gem/ruby/2.1.1/gems/activesupport-4.0.5/lib/active_support/dependencies.rb:229:in `require'
from /home/action/.gem/ruby/2.1.1/gems/railties-4.0.5/lib/rails/engine.rb:591:in `block (2 levels) in <class:Engine>'
from /home/action/.gem/ruby/2.1.1/gems/railties-4.0.5/lib/rails/engine.rb:590:in `each'
from /home/action/.gem/ruby/2.1.1/gems/railties-4.0.5/lib/rails/engine.rb:590:in `block in <class:Engine>'
from /home/action/.gem/ruby/2.1.1/gems/railties-4.0.5/lib/rails/initializable.rb:30:in `instance_exec'
from /home/action/.gem/ruby/2.1.1/gems/railties-4.0.5/lib/rails/initializable.rb:30:in `run'
from /home/action/.gem/ruby/2.1.1/gems/railties-4.0.5/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/action/.parts/packages/ruby2.1/2.1.1/lib/ruby/2.1.0/tsort.rb:226:in `block in tsort_each'
from /home/action/.parts/packages/ruby2.1/2.1.1/lib/ruby/2.1.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /home/action/.parts/packages/ruby2.1/2.1.1/lib/ruby/2.1.0/tsort.rb:418:in `block (2 levels) in each_strongly_connected_component_from'
from /home/action/.parts/packages/ruby2.1/2.1.1/lib/ruby/2.1.0/tsort.rb:427:in `each_strongly_connected_component_from'
from /home/action/.parts/packages/ruby2.1/2.1.1/lib/ruby/2.1.0/tsort.rb:417:in `block in each_strongly_connected_component_from'
from /home/action/.gem/ruby/2.1.1/gems/railties-4.0.5/lib/rails/initializable.rb:44:in `each'
from /home/action/.gem/ruby/2.1.1/gems/railties-4.0.5/lib/rails/initializable.rb:44:in `tsort_each_child'
from /home/action/.parts/packages/ruby2.1/2.1.1/lib/ruby/2.1.0/tsort.rb:411:in `call'
from /home/action/.parts/packages/ruby2.1/2.1.1/lib/ruby/2.1.0/tsort.rb:411:in `each_strongly_connected_component_from'
from /home/action/.parts/packages/ruby2.1/2.1.1/lib/ruby/2.1.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /home/action/.parts/packages/ruby2.1/2.1.1/lib/ruby/2.1.0/tsort.rb:345:in `each'
from /home/action/.parts/packages/ruby2.1/2.1.1/lib/ruby/2.1.0/tsort.rb:345:in `call'
from /home/action/.parts/packages/ruby2.1/2.1.1/lib/ruby/2.1.0/tsort.rb:345:in `each_strongly_connected_component'
from /home/action/.parts/packages/ruby2.1/2.1.1/lib/ruby/2.1.0/tsort.rb:224:in `tsort_each'
from /home/action/.parts/packages/ruby2.1/2.1.1/lib/ruby/2.1.0/tsort.rb:205:in `tsort_each'
from /home/action/.gem/ruby/2.1.1/gems/railties-4.0.5/lib/rails/initializable.rb:54:in `run_initializers'
from /home/action/.gem/ruby/2.1.1/gems/railties-4.0.5/lib/rails/application.rb:215:in `initialize!'
from /home/action/workspace/rails_projects/demo_app/config/environment.rb:5:in `<top (required)>'
from /home/action/.gem/ruby/2.1.1/gems/railties-4.0.5/lib/rails/application.rb:189:in `require'
from /home/action/.gem/ruby/2.1.1/gems/railties-4.0.5/lib/rails/application.rb:189:in `require_environment!'
from /home/action/.gem/ruby/2.1.1/gems/railties-4.0.5/lib/rails/commands.rb:44:in `<top (required)>'
from bin/rails:8:in `require'
from bin/rails:8:in `<main>'
To me it seems like for some reason the path for development.rb is not the right one, but I'm just guessing.
This can result from namespacing issues in your environment. Your app is called DemoAppp (note the three "p"s), so ensure that your naming convention adheres to the following:
# app/config/initializers/development.rb
DemoAppp::Application.configure do
Alternatively, if it's possible that DemoAppp is a misspelling, you may want to replace DemoAppp with DemoApp with two "p"s.

Resources