No Method Error - Undefined method 'chomp' - ruby-on-rails

I am very new to Ruby on Rails and currently running through the Michael Hartl tutorial.I've started to get a crazy long error when trying to call any method. Doesn't matter which. The one below is from running:
rails generate controller StaticPages about --no-test-framework
And then I get the following error:
/Users/MYUSERNAME/rails_projects/sample_app/config/initializers/secret_token.rb:18:in `secure_token': undefined method `chomp' for #<Pathname:/Users/MYUSERNAME/rails_projects/sample_app/.secret> (NoMethodError)
from /Users/bcraft07/rails_projects/sample_app/config/initializers/secret_token.rb:27:in `<top (required)>'
from /usr/local/rvm/gems/ruby-2.0.0-p247#railstutorial_rails_4_0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:223:in `load'
from /usr/local/rvm/gems/ruby-2.0.0-p247#railstutorial_rails_4_0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:223:in `block in load'
from /usr/local/rvm/gems/ruby-2.0.0-p247#railstutorial_rails_4_0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:214:in `load_dependency'
from /usr/local/rvm/gems/ruby-2.0.0-p247#railstutorial_rails_4_0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:223:in `load'
from /usr/local/rvm/gems/ruby-2.0.0-p247#railstutorial_rails_4_0/gems/railties-4.0.2/lib/rails/engine.rb:609:in `block (2 levels) in <class:Engine>'
from /usr/local/rvm/gems/ruby-2.0.0-p247#railstutorial_rails_4_0/gems/railties-4.0.2/lib/rails/engine.rb:608:in `each'
from /usr/local/rvm/gems/ruby-2.0.0-p247#railstutorial_rails_4_0/gems/railties-4.0.2/lib/rails/engine.rb:608:in `block in <class:Engine>'
from /usr/local/rvm/gems/ruby-2.0.0-p247#railstutorial_rails_4_0/gems/railties-4.0.2/lib/rails/initializable.rb:30:in `instance_exec'
from /usr/local/rvm/gems/ruby-2.0.0-p247#railstutorial_rails_4_0/gems/railties-4.0.2/lib/rails/initializable.rb:30:in `run'
from /usr/local/rvm/gems/ruby-2.0.0-p247#railstutorial_rails_4_0/gems/railties-4.0.2/lib/rails/initializable.rb:55:in `block in run_initializers'
from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:210:in `block (2 levels) in each_strongly_connected_component_from'
from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:209:in `block in each_strongly_connected_component_from'
from /usr/local/rvm/gems/ruby-2.0.0-p247#railstutorial_rails_4_0/gems/railties-4.0.2/lib/rails/initializable.rb:44:in `each'
from /usr/local/rvm/gems/ruby-2.0.0-p247#railstutorial_rails_4_0/gems/railties-4.0.2/lib/rails/initializable.rb:44:in `tsort_each_child'
from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:203:in `each_strongly_connected_component_from'
from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:180:in `each'
from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
from /usr/local/rvm/gems/ruby-2.0.0-p247#railstutorial_rails_4_0/gems/railties-4.0.2/lib/rails/initializable.rb:54:in `run_initializers'
from /usr/local/rvm/gems/ruby-2.0.0-p247#railstutorial_rails_4_0/gems/railties-4.0.2/lib/rails/application.rb:215:in `initialize!'
from /usr/local/rvm/gems/ruby-2.0.0-p247#railstutorial_rails_4_0/gems/railties-4.0.2/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/bcraft07/rails_projects/sample_app/config/environment.rb:5:in `<top (required)>'
from /usr/local/rvm/gems/ruby-2.0.0-p247#railstutorial_rails_4_0/gems/railties-4.0.2/lib/rails/application.rb:189:in `require'
from /usr/local/rvm/gems/ruby-2.0.0-p247#railstutorial_rails_4_0/gems/railties-4.0.2/lib/rails/application.rb:189:in `require_environment!'
from /usr/local/rvm/gems/ruby-2.0.0-p247#railstutorial_rails_4_0/gems/railties-4.0.2/lib/rails/commands.rb:44:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
My assumption is that is as something to do with my RVM and the gems that I have. I know its a very long error and lot of it is unique to the project that I am working on but any help is greatly appreciated. Keep in mind that I'm serious noob!
Edit:
require 'securerandom'
def secure_token
token_file = Rails.root.join('.secret')
if File.exist? (token_file)
#Use the existing token
File.read token (token_file).chomp
else
#Generate a new token and store it in token_file.
token = SecureRandom.hex(64)
File.write(token_file, token)
token
end
end
SampleApp::Application.config.secret_key_base = secure_token

Replace chomp with to_s:
File.read token (token_file).to_s

Related

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.

Can't generate anything using rails-api gem

I'm trying to set up a rails json api using the rails-api gem but I'm having a little trouble getting it to work like it should.
I'm following this tutorial since I'll be creating this for an ember.js frontend.
http://blog.jasonkriss.com/building-an-app-with-ember-app-kit-part-1/
And bundling (after fixing the [ issue on line 3) works.
When I attempt to generate the model that he generates after bundling I just get something that looks like this in the terminal...
/Users/jordanriser/workspace/Test/config/environments/development.rb:1:in `<top (required)>': undefined method `configure' for #<Test::Application:0x007f9bcb9b0640> (NoMethodError)
from /Users/jordanriser/.rvm/gems/ruby-2.1.1/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:229:in `require'
from /Users/jordanriser/.rvm/gems/ruby-2.1.1/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:229:in `block in require'
from /Users/jordanriser/.rvm/gems/ruby-2.1.1/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:214:in `load_dependency'
from /Users/jordanriser/.rvm/gems/ruby-2.1.1/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:229:in `require'
from /Users/jordanriser/.rvm/gems/ruby-2.1.1/gems/railties-4.0.4/lib/rails/engine.rb:591:in `block (2 levels) in <class:Engine>'
from /Users/jordanriser/.rvm/gems/ruby-2.1.1/gems/railties-4.0.4/lib/rails/engine.rb:590:in `each'
from /Users/jordanriser/.rvm/gems/ruby-2.1.1/gems/railties-4.0.4/lib/rails/engine.rb:590:in `block in <class:Engine>'
from /Users/jordanriser/.rvm/gems/ruby-2.1.1/gems/railties-4.0.4/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/jordanriser/.rvm/gems/ruby-2.1.1/gems/railties-4.0.4/lib/rails/initializable.rb:30:in `run'
from /Users/jordanriser/.rvm/gems/ruby-2.1.1/gems/railties-4.0.4/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/jordanriser/.rbenv/versions/2.1.1/lib/ruby/2.1.0/tsort.rb:226:in `block in tsort_each'
from /Users/jordanriser/.rbenv/versions/2.1.1/lib/ruby/2.1.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /Users/jordanriser/.rbenv/versions/2.1.1/lib/ruby/2.1.0/tsort.rb:418:in `block (2 levels) in each_strongly_connected_component_from'
from /Users/jordanriser/.rbenv/versions/2.1.1/lib/ruby/2.1.0/tsort.rb:427:in `each_strongly_connected_component_from'
from /Users/jordanriser/.rbenv/versions/2.1.1/lib/ruby/2.1.0/tsort.rb:417:in `block in each_strongly_connected_component_from'
from /Users/jordanriser/.rvm/gems/ruby-2.1.1/gems/railties-4.0.4/lib/rails/initializable.rb:44:in `each'
from /Users/jordanriser/.rvm/gems/ruby-2.1.1/gems/railties-4.0.4/lib/rails/initializable.rb:44:in `tsort_each_child'
from /Users/jordanriser/.rbenv/versions/2.1.1/lib/ruby/2.1.0/tsort.rb:411:in `call'
from /Users/jordanriser/.rbenv/versions/2.1.1/lib/ruby/2.1.0/tsort.rb:411:in `each_strongly_connected_component_from'
from /Users/jordanriser/.rbenv/versions/2.1.1/lib/ruby/2.1.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /Users/jordanriser/.rbenv/versions/2.1.1/lib/ruby/2.1.0/tsort.rb:345:in `each'
from /Users/jordanriser/.rbenv/versions/2.1.1/lib/ruby/2.1.0/tsort.rb:345:in `call'
from /Users/jordanriser/.rbenv/versions/2.1.1/lib/ruby/2.1.0/tsort.rb:345:in `each_strongly_connected_component'
from /Users/jordanriser/.rbenv/versions/2.1.1/lib/ruby/2.1.0/tsort.rb:224:in `tsort_each'
from /Users/jordanriser/.rbenv/versions/2.1.1/lib/ruby/2.1.0/tsort.rb:205:in `tsort_each'
from /Users/jordanriser/.rvm/gems/ruby-2.1.1/gems/railties-4.0.4/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/jordanriser/.rvm/gems/ruby-2.1.1/gems/railties-4.0.4/lib/rails/application.rb:215:in `initialize!'
from /Users/jordanriser/workspace/Test/config/environment.rb:5:in `<top (required)>'
from /Users/jordanriser/.rvm/gems/ruby-2.1.1/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:229:in `require'
from /Users/jordanriser/.rvm/gems/ruby-2.1.1/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:229:in `block in require'
from /Users/jordanriser/.rvm/gems/ruby-2.1.1/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:214:in `load_dependency'
from /Users/jordanriser/.rvm/gems/ruby-2.1.1/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:229:in `require'
from /Users/jordanriser/.rvm/gems/ruby-2.1.1/gems/railties-4.0.4/lib/rails/application.rb:189:in `require_environment!'
from /Users/jordanriser/.rvm/gems/ruby-2.1.1/gems/railties-4.0.4/lib/rails/commands.rb:44:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
I've googled that "undefined method 'configure'" But I can't seem to find any definitive answers on what that is.

ember-rails: undefined method `ember' for #<Rails::Application::Configuration:0x007f14d10deb88> (NoMethodError)

I keep getting this error with the ember-rails gem:
ERROR -- : undefined method `ember' for #<Rails::Application::Configuration:0x007f14d10deb88> (NoMethodError)
/home/deploy/apps/gastos/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/railtie/configuration.rb:95:in `method_missing'
/home/deploy/apps/gastos/releases/20130914034514/config/environments/staging.rb:81:in `block in <top (required)>'
/home/deploy/apps/gastos/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:24:in `class_eval'
/home/deploy/apps/gastos/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:24:in `configure'
/home/deploy/apps/gastos/releases/20130914034514/config/environments/staging.rb:1:in `<top (required)>'
/home/deploy/apps/gastos/shared/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
/home/deploy/apps/gastos/shared/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `block in require'
/home/deploy/apps/gastos/shared/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
/home/deploy/apps/gastos/shared/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
/home/deploy/apps/gastos/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:591:in `block (2 levels) in <class:Engine>'
/home/deploy/apps/gastos/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:590:in `each'
/home/deploy/apps/gastos/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:590:in `block in <class:Engine>'
/home/deploy/apps/gastos/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `instance_exec'
/home/deploy/apps/gastos/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `run'
/home/deploy/apps/gastos/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:55:in `block in run_initializers'
/home/deploy/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
/home/deploy/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
/home/deploy/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/tsort.rb:210:in `block (2 levels) in each_strongly_connected_component_from'
/home/deploy/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
/home/deploy/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/tsort.rb:209:in `block in each_strongly_connected_component_from'
/home/deploy/apps/gastos/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:44:in `each'
/home/deploy/apps/gastos/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:44:in `tsort_each_child'
/home/deploy/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/tsort.rb:203:in `each_strongly_connected_component_from'
/home/deploy/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
/home/deploy/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/tsort.rb:180:in `each'
/home/deploy/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
/home/deploy/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
/home/deploy/apps/gastos/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:54:in `run_initializers'
/home/deploy/apps/gastos/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:215:in `initialize!'
/home/deploy/apps/gastos/shared/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
/home/deploy/apps/gastos/releases/20130914034514/config/environment.rb:5:in `<top (required)>'
I've placed the configuration for ember in my environment file (staging.rb) like so:
config.ember.variant = :production
The only clue that I've gotten from Google so far was this issue on Github where the solution was to take out ember-rails from the :assets group. I'm using Rails 4 already, so I don't even have an :assets group in the first place. I should also point out that I've already setup my application to use a staging environment, so I'm certain that the problem doesn't have anything to do with its current Rails environment.
Has anyone else solved this problem already? Am I just missing something?
For the sake of everyone else who may encounter this error, all I had to do was restart my server and it worked fine afterwards.

Resources