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.