Rails 5.2: GCP deployment fails after starting to use the new encrypted credentials feature - ruby-on-rails-3

I'm facing quite a strange issue with GCP (Google Cloud Platform) deployments. I've recently updated my Ruby on Rails application to 5.2 (was 5.1.4 previously) and I started using the the encrypted credentials feature (which I believe is amazing, to be honest), but it looks like GCP is not that happy with it.
Here is the traceback that I receive when I deploy (via gcloud from my local workstation and also CircleCI)
Started cloud_sql_proxy.
D, [2018-05-28T16:19:42.241746 #17] DEBUG -- : Cannot load `Rails.application.database_configuration`:
ActiveSupport::MessageEncryptor::InvalidMessage excluded from capture: DSN not set
rake aborted!
ActiveSupport::MessageEncryptor::InvalidMessage: Cannot load `Rails.application.database_configuration`:
ActiveSupport::MessageEncryptor::InvalidMessage
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/message_encryptor.rb:206:in `rescue in _decrypt'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/message_encryptor.rb:183:in `_decrypt'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/message_encryptor.rb:157:in `decrypt_and_verify'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/messages/rotator.rb:21:in `decrypt_and_verify'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/encrypted_file.rb:79:in `decrypt'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/encrypted_file.rb:42:in `read'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/encrypted_configuration.rb:21:in `read'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/encrypted_configuration.rb:33:in `config'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/encrypted_configuration.rb:38:in `options'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/core_ext/module/delegation.rb:271:in `method_missing'
(erb):25:in `<main>'
/app/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/application/configuration.rb:172:in `database_configuration'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/railtie.rb:133:in `block (2 levels) in <class:Railtie>'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:71:in `instance_eval'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:71:in `block in execute_hook'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:62:in `with_execution_control'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:67:in `execute_hook'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:43:in `block in on_load'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:42:in `each'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:42:in `on_load'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/railtie.rb:132:in `block in <class:Railtie>'
/app/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/initializable.rb:32:in `instance_exec'
/app/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/initializable.rb:32:in `run'
/app/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/initializable.rb:61:in `block in run_initializers'
/app/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/initializable.rb:60:in `run_initializers'
/app/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/application.rb:361:in `initialize!'
/app/config/environment.rb:5:in `<main>'
/app/vendor/bundle/ruby/2.3.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
/app/vendor/bundle/ruby/2.3.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
/app/vendor/bundle/ruby/2.3.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
/app/vendor/bundle/ruby/2.3.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
/app/vendor/bundle/ruby/2.3.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `block in require'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:249:in `load_dependency'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `require'
/app/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/application.rb:337:in `require_environment!'
/app/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/application.rb:520:in `block in run_tasks_blocks'
/app/vendor/bundle/ruby/2.3.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb:62:in `block (2 levels) in define'
/app/vendor/bundle/ruby/2.3.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
/rbenv/versions/2.3.7/bin/bundle:22:in `load'
/rbenv/versions/2.3.7/bin/bundle:22:in `<main>'
Caused by:
OpenSSL::Cipher::CipherError: key length too short
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/message_encryptor.rb:193:in `key='
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/message_encryptor.rb:193:in `_decrypt'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/message_encryptor.rb:157:in `decrypt_and_verify'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/messages/rotator.rb:21:in `decrypt_and_verify'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/encrypted_file.rb:79:in `decrypt'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/encrypted_file.rb:42:in `read'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/encrypted_configuration.rb:21:in `read'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/encrypted_configuration.rb:33:in `config'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/encrypted_configuration.rb:38:in `options'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/core_ext/module/delegation.rb:271:in `method_missing'
(erb):25:in `<main>'
/app/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/application/configuration.rb:172:in `database_configuration'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/railtie.rb:133:in `block (2 levels) in <class:Railtie>'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:71:in `instance_eval'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:71:in `block in execute_hook'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:62:in `with_execution_control'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:67:in `execute_hook'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:43:in `block in on_load'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:42:in `each'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:42:in `on_load'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/railtie.rb:132:in `block in <class:Railtie>'
/app/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/initializable.rb:32:in `instance_exec'
/app/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/initializable.rb:32:in `run'
/app/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/initializable.rb:61:in `block in run_initializers'
/app/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/initializable.rb:60:in `run_initializers'
/app/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/application.rb:361:in `initialize!'
/app/config/environment.rb:5:in `<main>'
/app/vendor/bundle/ruby/2.3.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
/app/vendor/bundle/ruby/2.3.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
/app/vendor/bundle/ruby/2.3.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
/app/vendor/bundle/ruby/2.3.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
/app/vendor/bundle/ruby/2.3.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `block in require'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:249:in `load_dependency'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `require'
/app/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/application.rb:337:in `require_environment!'
/app/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/application.rb:520:in `block in run_tasks_blocks'
/app/vendor/bundle/ruby/2.3.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb:62:in `block (2 levels) in define'
/app/vendor/bundle/ruby/2.3.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
/rbenv/versions/2.3.7/bin/bundle:22:in `load'
/rbenv/versions/2.3.7/bin/bundle:22:in `<main>'
Tasks: TOP => environment
The first error (DSN not set) is most likely coming from Sentry, although the DSN was added to the encrypted credentials file and Sentry if configured correctly.
config.dsn = Rails.application.credentials.dig(:sentry, :staging, :raven_dsn)
Second error (Cannot load Rails.application.database_configuration) makes me think that it's something related to database.yml, which works just fine in development and test environments.
default: &default
adapter: postgresql
encoding: unicode
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
timeout: 5000
development:
<<: *default
database: gcpfive_development
test:
<<: *default
database: gcpfive_test
staging:
<<: *default
username: <%= Rails.application.credentials.dig(:gcsql, :staging, :username) %>
password: <%= Rails.application.credentials.dig(:gcsql, :staging, :password) %>
database: <%= Rails.application.credentials.dig(:gcsql, :staging, :database) %>
host: <%= Rails.application.credentials.dig(:gcsql, :staging, :host) %>
The third error (OpenSSL::Cipher::CipherError: key length too short) hints that maybe the master key is not found during the deploy and maybe that's why it also can't find the Sentry DSN? Has anyone else encountered a similar issue?

Related

`method_missing': undefined method `user_class=' for #<Forem::Engine:0x9de6bc0>

When i run rails server,i encountered this error.
'bundle install' has been success.My RVM use ruby 1.9.3 and rails 3.2 but the project need rails 3.1.I think the bundle has already solved the because of the bundle.The rails and ruby might not be the reason.
Anything would be help.Thanks
Your bundle is complete!
It was installed into ./vendor/bundle
magic#magic-ThinkPad-T430u:~/Documents/rails/ticketee-book$ rails server
=> Booting WEBrick
=> Rails 3.1.0.rc2 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/railties/lib/rails/railtie/configurable.rb:30:in `method_missing': undefined method `user_class=' for #<Forem::Engine:0x9de6bc0> (NoMethodError)
from /home/magic/Documents/rails/ticketee-book/config/initializers/forem.rb:1:in `<top (required)>'
from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/activesupport/lib/active_support/dependencies.rb:235:in `load'
from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/activesupport/lib/active_support/dependencies.rb:235:in `block in load'
from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/activesupport/lib/active_support/dependencies.rb:225:in `block in load_dependency'
from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/activesupport/lib/active_support/dependencies.rb:641:in `new_constants_in'
from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/activesupport/lib/active_support/dependencies.rb:225:in `load_dependency'
from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/activesupport/lib/active_support/dependencies.rb:235:in `load'
from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/railties/lib/rails/engine.rb:544:in `block (2 levels) in <class:Engine>'
from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/railties/lib/rails/engine.rb:543:in `each'
from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/railties/lib/rails/engine.rb:543:in `block in <class:Engine>'
from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/railties/lib/rails/initializable.rb:25:in `instance_exec'
from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/railties/lib/rails/initializable.rb:25:in `run'
from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/railties/lib/rails/initializable.rb:50:in `block in run_initializers'
from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/railties/lib/rails/initializable.rb:49:in `each'
from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/railties/lib/rails/initializable.rb:49:in `run_initializers'
from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/railties/lib/rails/application.rb:96:in `initialize!'
from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/railties/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /home/magic/Documents/rails/ticketee-book/config/environment.rb:5:in `<top (required)>'
from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/activesupport/lib/active_support/dependencies.rb:239:in `require'
from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/activesupport/lib/active_support/dependencies.rb:239:in `block in require'
from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/activesupport/lib/active_support/dependencies.rb:225:in `block in load_dependency'
from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/activesupport/lib/active_support/dependencies.rb:641:in `new_constants_in'
from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/activesupport/lib/active_support/dependencies.rb:225:in `load_dependency'
from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/activesupport/lib/active_support/dependencies.rb:239:in `require'
from /home/magic/Documents/rails/ticketee-book/config.ru:4:in `block in <main>'
from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/gems/rack-1.3.0/lib/rack/builder.rb:51:in `instance_eval'
from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/gems/rack-1.3.0/lib/rack/builder.rb:51:in `initialize'
from /home/magic/Documents/rails/ticketee-book/config.ru:1:in `new'
from /home/magic/Documents/rails/ticketee-book/config.ru:1:in `<main>'
from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/gems/rack-1.3.0/lib/rack/builder.rb:40:in `eval'
from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/gems/rack-1.3.0/lib/rack/builder.rb:40:in `parse_file'
from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/gems/rack-1.3.0/lib/rack/server.rb:200:in `app'
from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/railties/lib/rails/commands/server.rb:46:in `app'
from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/gems/rack-1.3.0/lib/rack/server.rb:301:in `wrapped_app'
from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/gems/rack-1.3.0/lib/rack/server.rb:252:in `start'
from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/railties/lib/rails/commands/server.rb:70:in `start'
from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/railties/lib/rails/commands.rb:54:in `block in <top (required)>'
from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/railties/lib/rails/commands.rb:49:in `tap'
from /home/magic/Documents/rails/ticketee-book/vendor/bundle/ruby/1.9.1/bundler/gems/rails-623c16f4f8b7/railties/lib/rails/commands.rb:49:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Try running server with bundle command. It will use all gems that are defined in your Gemfile then:
bundle exec rails server

Couldn't parse YAML at line 7 - RefineryCMS / Rails Issue

Please could someone help me understand what has gone wrong, and how I can lookout/debug these things in the future. I have set-up a RefineryCMS app in Rails, worked on it, uploaded it to Heroku and have had both the local and remote copies working fine. After a period of about a month I return to the local copy to work on it, but it won't load. I can't understand why as nothing has changed. I tried deleting the local copy and cloning again from heroku but same issue exists. The error code is below when I try and create a rails server locally to run the app.
I would welcome help with the error, and perhaps how to spot/avoid these things in the future
/home/adam/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych.rb:148:in `parse': couldn't parse YAML at line 7 column 0 (Psych::SyntaxError)
from /home/adam/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych.rb:148:in `parse_stream'
from /home/adam/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych.rb:119:in `parse'
from /home/adam/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych.rb:106:in `load'
from /home/adam/.rvm/gems/ruby-1.9.2-p290#beloved2/gems/activerecord-3.0.11/lib/active_record/base.rb:1868:in `object_from_yaml'
from /home/adam/.rvm/gems/ruby-1.9.2-p290#beloved2/gems/activerecord-3.0.11/lib/active_record/attribute_methods/read.rb:129:in `unserialize_attribute'
from /home/adam/.rvm/gems/ruby-1.9.2-p290#beloved2/gems/activerecord-3.0.11/lib/active_record/attribute_methods/read.rb:112:in `_read_attribute'
from /home/adam/.rvm/gems/ruby-1.9.2-p290#beloved2/gems/activerecord-3.0.11/lib/active_record/attribute_methods/read.rb:101:in `read_attribute'
from /home/adam/.rvm/gems/ruby-1.9.2-p290#beloved2/gems/activerecord-3.0.11/lib/active_record/base.rb:1525:in `[]'
from /home/adam/.rvm/gems/ruby-1.9.2-p290#beloved2/gems/refinerycms-settings-1.0.9/app/models/refinery_setting.rb:158:in `value'
from /home/adam/.rvm/gems/ruby-1.9.2-p290#beloved2/gems/refinerycms-settings-1.0.9/app/models/refinery_setting.rb:61:in `block in to_cache'
from /home/adam/.rvm/gems/ruby-1.9.2-p290#beloved2/gems/refinerycms-settings-1.0.9/app/models/refinery_setting.rb:58:in `collect'
from /home/adam/.rvm/gems/ruby-1.9.2-p290#beloved2/gems/refinerycms-settings-1.0.9/app/models/refinery_setting.rb:58:in `to_cache'
from /home/adam/.rvm/gems/ruby-1.9.2-p290#beloved2/gems/refinerycms-settings-1.0.9/app/models/refinery_setting.rb:73:in `rewrite_cache'
from /home/adam/.rvm/gems/ruby-1.9.2-p290#beloved2/gems/refinerycms-settings-1.0.9/app/models/refinery_setting.rb:36:in `ensure_cache_exists!'
from /home/adam/.rvm/gems/ruby-1.9.2-p290#beloved2/gems/refinerycms-settings-1.0.9/app/models/refinery_setting.rb:44:in `cache_read'
from /home/adam/.rvm/gems/ruby-1.9.2-p290#beloved2/gems/refinerycms-settings-1.0.9/app/models/refinery_setting.rb:109:in `get'
from /home/adam/.rvm/gems/ruby-1.9.2-p290#beloved2/gems/refinerycms-settings-1.0.9/app/models/refinery_setting.rb:95:in `find_or_set'
from /home/adam/.rvm/gems/ruby-1.9.2-p290#beloved2/gems/refinerycms-images-1.0.9/lib/refinerycms-images.rb:33:in `block (2 levels) in <class:Engine>'
from /home/adam/.rvm/gems/ruby-1.9.2-p290#beloved2/gems/dragonfly-0.9.8/lib/dragonfly/configurable.rb:35:in `configure'
from /home/adam/.rvm/gems/ruby-1.9.2-p290#beloved2/gems/dragonfly-0.9.8/lib/dragonfly/configurable.rb:42:in `configure_with'
from /home/adam/.rvm/gems/ruby-1.9.2-p290#beloved2/gems/refinerycms-images-1.0.9/lib/refinerycms-images.rb:24:in `block in <class:Engine>'
from /home/adam/.rvm/gems/ruby-1.9.2-p290#beloved2/gems/railties-3.0.11/lib/rails/initializable.rb:25:in `instance_exec'
from /home/adam/.rvm/gems/ruby-1.9.2-p290#beloved2/gems/railties-3.0.11/lib/rails/initializable.rb:25:in `run'
from /home/adam/.rvm/gems/ruby-1.9.2-p290#beloved2/gems/railties-3.0.11/lib/rails/initializable.rb:50:in `block in run_initializers'
from /home/adam/.rvm/gems/ruby-1.9.2-p290#beloved2/gems/railties-3.0.11/lib/rails/initializable.rb:49:in `each'
from /home/adam/.rvm/gems/ruby-1.9.2-p290#beloved2/gems/railties-3.0.11/lib/rails/initializable.rb:49:in `run_initializers'
from /home/adam/.rvm/gems/ruby-1.9.2-p290#beloved2/gems/railties-3.0.11/lib/rails/application.rb:134:in `initialize!'
from /home/adam/.rvm/gems/ruby-1.9.2-p290#beloved2/gems/railties-3.0.11/lib/rails/application.rb:77:in `method_missing'
from /home/adam/web/beloved/config/environment.rb:5:in `<top (required)>'
from /home/adam/.rvm/gems/ruby-1.9.2-p290#beloved2/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:239:in `require'
from /home/adam/.rvm/gems/ruby-1.9.2-p290#beloved2/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:239:in `block in require'
from /home/adam/.rvm/gems/ruby-1.9.2-p290#beloved2/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:225:in `block in load_dependency'
from /home/adam/.rvm/gems/ruby-1.9.2-p290#beloved2/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:593:in `new_constants_in'
from /home/adam/.rvm/gems/ruby-1.9.2-p290#beloved2/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:225:in `load_dependency'
from /home/adam/.rvm/gems/ruby-1.9.2-p290#beloved2/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:239:in `require'
from /home/adam/web/beloved/config.ru:3:in `block in <main>'
from /home/adam/.rvm/gems/ruby-1.9.2-p290#beloved2/gems/rack-1.2.4/lib/rack/builder.rb:46:in `instance_eval'
from /home/adam/.rvm/gems/ruby-1.9.2-p290#beloved2/gems/rack-1.2.4/lib/rack/builder.rb:46:in `initialize'
from /home/adam/web/beloved/config.ru:1:in `new'
from /home/adam/web/beloved/config.ru:1:in `<main>'
from /home/adam/.rvm/gems/ruby-1.9.2-p290#beloved2/gems/rack-1.2.4/lib/rack/builder.rb:35:in `eval'
from /home/adam/.rvm/gems/ruby-1.9.2-p290#beloved2/gems/rack-1.2.4/lib/rack/builder.rb:35:in `parse_file'
from /home/adam/.rvm/gems/ruby-1.9.2-p290#beloved2/gems/rack-1.2.4/lib/rack/server.rb:162:in `app'
from /home/adam/.rvm/gems/ruby-1.9.2-p290#beloved2/gems/rack-1.2.4/lib/rack/server.rb:253:in `wrapped_app'
from /home/adam/.rvm/gems/ruby-1.9.2-p290#beloved2/gems/rack-1.2.4/lib/rack/server.rb:204:in `start'
from /home/adam/.rvm/gems/ruby-1.9.2-p290#beloved2/gems/railties-3.0.11/lib/rails/commands/server.rb:65:in `start'
from /home/adam/.rvm/gems/ruby-1.9.2-p290#beloved2/gems/railties-3.0.11/lib/rails/commands.rb:30:in `block in <top (required)>'
from /home/adam/.rvm/gems/ruby-1.9.2-p290#beloved2/gems/railties-3.0.11/lib/rails/commands.rb:27:in `tap'
from /home/adam/.rvm/gems/ruby-1.9.2-p290#beloved2/gems/railties-3.0.11/lib/rails/commands.rb:27:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Thanks for your help,
Adam
Add to config/boot.rb:
require 'yaml'
YAML::ENGINE.yamler = 'syck'
Read more here

devise generating views error

I've got a problem with devise gem, when I enter rails generate devise:install command there is an error:
/home/ofca/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/inflector/methods.rb:124:in `block in constantize': unin
itialized constant View (NameError)
from /home/ofca/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/inflector/methods.rb:123:in `each'
from /home/ofca/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/inflector/methods.rb:123:in `constantize'
from /home/ofca/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/core_ext/string/inflections.rb:43:in `const
antize'
from /home/ofca/.rvm/gems/ruby-1.9.2-p290/gems/devise-1.1.rc1/lib/devise/mapping.rb:87:in `to'
from /home/ofca/.rvm/gems/ruby-1.9.2-p290/gems/devise-1.1.rc1/lib/devise/mapping.rb:80:in `modules'
from /home/ofca/.rvm/gems/ruby-1.9.2-p290/gems/devise-1.1.rc1/lib/devise/mapping.rb:93:in `strategies'
from /home/ofca/.rvm/gems/ruby-1.9.2-p290/gems/devise-1.1.rc1/lib/devise.rb:166:in `register'
from /home/ofca/.rvm/gems/ruby-1.9.2-p290/gems/devise-1.1.rc1/lib/devise/rails/routes.rb:92:in `block in devise_for'
from /home/ofca/.rvm/gems/ruby-1.9.2-p290/gems/devise-1.1.rc1/lib/devise/rails/routes.rb:91:in `each'
from /home/ofca/.rvm/gems/ruby-1.9.2-p290/gems/devise-1.1.rc1/lib/devise/rails/routes.rb:91:in `devise_for'
from /home/ofca/Praca/inzynierka/config/routes.rb:2:in `block in <top (required)>'
from /home/ofca/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/routing/route_set.rb:258:in `instance_exec'
from /home/ofca/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/routing/route_set.rb:258:in `eval_block'
from /home/ofca/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/routing/route_set.rb:235:in `draw'
from /home/ofca/Praca/inzynierka/config/routes.rb:1:in `<top (required)>'
from /home/ofca/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application/routes_reloader.rb:29:in `block in load_paths
'
from /home/ofca/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application/routes_reloader.rb:29:in `each'
from /home/ofca/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application/routes_reloader.rb:29:in `load_paths'
from /home/ofca/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application/routes_reloader.rb:13:in `reload!'
from /home/ofca/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application/routes_reloader.rb:7:in `block in initialize'
from /home/ofca/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/file_update_checker.rb:32:in `call'
from /home/ofca/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/file_update_checker.rb:32:in `execute_if_up
dated'
from /home/ofca/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application/finisher.rb:63:in `block (2 levels) in <modul
e:Finisher>'
from /home/ofca/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application/finisher.rb:64:in `call'
from /home/ofca/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application/finisher.rb:64:in `block in <module:Finisher>
'
from /home/ofca/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/initializable.rb:30:in `instance_exec'
from /home/ofca/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/initializable.rb:30:in `run'
from /home/ofca/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/ofca/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/initializable.rb:54:in `each'
from /home/ofca/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/initializable.rb:54:in `run_initializers'
from /home/ofca/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application.rb:96:in `initialize!'
from /home/ofca/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /home/ofca/Praca/inzynierka/config/environment.rb:5:in `<top (required)>'
from /home/ofca/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application.rb:83:in `require'
from /home/ofca/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application.rb:83:in `require_environment!'
from /home/ofca/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands.rb:22:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I'm using Rails 3.1.1 and Ruby 1.9.2p290 (2011-07-09 revision 32553) on Linux. And db is postgres.
Here is the line mentioned in the first line of the error log:
constant = constant.const_defined?(name, false) ? constant.const_get(name) : constant.const_missing(name)
Oh, and I tried other combinations of this command: rails generate devise:install, rails g devise_install and it gives me the same effect
You are using a very old version of Devise that is not even meant to be used in production (it is a release candidate!). Please update your Devise version.
solution: add to gemfile:
gem 'devise', :git => 'git://github.com/plataformatec/devise.git'

Rails 3 - Moving to / Start Production Server - production database is not configured?

I was looking to deploy my first rails app, and have been experiencing some issues. First off, everything works fine in the development server, so I figured I was good to go. After failed to deploy the app to my host, I tried to launch the server in production mode for the first time, receiving several errors.
Out of curiousity, I created a new app, completely fresh without me editing any code. I'm getting pretty much the same errors about my database:
/home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/activerecord-3.0.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:62:in `establish_connection': =production database is not configured (ActiveRecord::AdapterNotSpecified)
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/activerecord-3.0.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:55:in `establish_connection'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/activerecord-3.0.3/lib/active_record/railtie.rb:59:in `block (2 levels) in <class:Railtie>'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.3/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.3/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.3/lib/active_support/lazy_load_hooks.rb:26:in `on_load'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/activerecord-3.0.3/lib/active_record/railtie.rb:57:in `block in <class:Railtie>'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.3/lib/rails/initializable.rb:25:in `instance_exec'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.3/lib/rails/initializable.rb:25:in `run'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.3/lib/rails/initializable.rb:50:in `block in run_initializers'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.3/lib/rails/initializable.rb:49:in `each'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.3/lib/rails/initializable.rb:49:in `run_initializers'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.3/lib/rails/application.rb:134:in `initialize!'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.3/lib/rails/application.rb:77:in `method_missing'
from /home/sweiss/testapp/config/environment.rb:6:in `<top (required)>'
from /home/sweiss/testapp/config.ru:3:in `require'
from /home/sweiss/testapp/config.ru:3:in `block in <main>'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize'
from /home/sweiss/testapp/config.ru:1:in `new'
from /home/sweiss/testapp/config.ru:1:in `<main>'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/builder.rb:35:in `eval'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/builder.rb:35:in `parse_file'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/server.rb:162:in `app'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/server.rb:248:in `wrapped_app'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/server.rb:213:in `start'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.3/lib/rails/commands/server.rb:65:in `start'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.3/lib/rails/commands.rb:30:in `block in <top (required)>'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.3/lib/rails/commands.rb:27:in `tap'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.3/lib/rails/commands.rb:27:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Has anyone experiences this while trying to launch a production server? The database.yml, just for good measure, is the following default for sqlite3:
production:
adapter: sqlite3
database: db/production.sqlite3
pool: 5
timeout: 5000
I verified the .yml had no tabs (not that it should auto-generated).
Anyway, I appreciate the help.
Have you installed the sqlite3 gem? Sounds to me like it can't find the adapter.

Where do I put Sinatra files intended to be embedded in a Rails3 app?

I want to use the new Rails3 feature that allows you to embed a Sinatra app inside rails.
In my routes file, I have:
# app names changed to protect the (not so) innocent
MyApp::Application.routes.draw do
match "/service", :to => MyService
...
end
And in /lib/my_service.rb I have
class MyService < Sinatra::Base
get "/" do
"Hello World"
end
end
When I try to start the Rails server I get Uninitialized constant MyService (NameError), which I suspect means my Sinatra file is in the wrong directory. Where am I supposed to put it?
Full error text:
rails/my_app ยป rails server
=> Booting WEBrick
=> Rails 3.0.1 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/Users/marshallyount/Projects/clients/method/rails/my_app/config/routes.rb:2:in `block in <top (required)>': uninitialized constant MyService (NameError)
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/actionpack-3.0.1/lib/action_dispatch/routing/route_set.rb:233:in `instance_exec'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/actionpack-3.0.1/lib/action_dispatch/routing/route_set.rb:233:in `draw'
from /Users/marshallyount/Projects/clients/method/rails/my_app/config/routes.rb:1:in `<top (required)>'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/railties-3.0.1/lib/rails/application.rb:127:in `block in reload_routes!'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/railties-3.0.1/lib/rails/application.rb:127:in `each'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/railties-3.0.1/lib/rails/application.rb:127:in `reload_routes!'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/railties-3.0.1/lib/rails/application.rb:120:in `block in routes_reloader'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/activesupport-3.0.1/lib/active_support/file_update_checker.rb:32:in `call'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/activesupport-3.0.1/lib/active_support/file_update_checker.rb:32:in `execute_if_updated'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/actionpack-3.0.1/lib/action_dispatch/railtie.rb:14:in `block (2 levels) in <class:Railtie>'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/activesupport-3.0.1/lib/active_support/callbacks.rb:419:in `_run_prepare_callbacks'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/actionpack-3.0.1/lib/action_dispatch/middleware/callbacks.rb:40:in `initialize'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/actionpack-3.0.1/lib/action_dispatch/middleware/stack.rb:33:in `new'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/actionpack-3.0.1/lib/action_dispatch/middleware/stack.rb:33:in `build'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/actionpack-3.0.1/lib/action_dispatch/middleware/stack.rb:79:in `block in build'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/actionpack-3.0.1/lib/action_dispatch/middleware/stack.rb:79:in `each'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/actionpack-3.0.1/lib/action_dispatch/middleware/stack.rb:79:in `inject'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/actionpack-3.0.1/lib/action_dispatch/middleware/stack.rb:79:in `build'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/railties-3.0.1/lib/rails/application.rb:162:in `app'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/railties-3.0.1/lib/rails/application/finisher.rb:35:in `block in <module:Finisher>'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/railties-3.0.1/lib/rails/initializable.rb:25:in `instance_exec'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/railties-3.0.1/lib/rails/initializable.rb:25:in `run'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/railties-3.0.1/lib/rails/initializable.rb:50:in `block in run_initializers'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/railties-3.0.1/lib/rails/initializable.rb:49:in `each'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/railties-3.0.1/lib/rails/initializable.rb:49:in `run_initializers'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/railties-3.0.1/lib/rails/application.rb:134:in `initialize!'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/railties-3.0.1/lib/rails/application.rb:77:in `method_missing'
from /Users/marshallyount/Projects/clients/method/rails/my_app/config/environment.rb:5:in `<top (required)>'
from /Users/marshallyount/Projects/clients/method/rails/my_app/config.ru:3:in `require'
from /Users/marshallyount/Projects/clients/method/rails/my_app/config.ru:3:in `block in <main>'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize'
from /Users/marshallyount/Projects/clients/method/rails/my_app/config.ru:1:in `new'
from /Users/marshallyount/Projects/clients/method/rails/my_app/config.ru:1:in `<main>'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/rack-1.2.1/lib/rack/builder.rb:35:in `eval'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/rack-1.2.1/lib/rack/builder.rb:35:in `parse_file'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/rack-1.2.1/lib/rack/server.rb:162:in `app'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/rack-1.2.1/lib/rack/server.rb:248:in `wrapped_app'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/rack-1.2.1/lib/rack/server.rb:213:in `start'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/railties-3.0.1/lib/rails/commands/server.rb:65:in `start'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/railties-3.0.1/lib/rails/commands.rb:30:in `block in <top (required)>'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/railties-3.0.1/lib/rails/commands.rb:27:in `tap'
from /Users/marshallyount/.rvm/gems/ruby-1.9.2-p0#my_app/gems/railties-3.0.1/lib/rails/commands.rb:27:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I found a good answer for this question, thanks to this article.
I was missing the all important requires header at the top of my routes file:
require 'my_service.rb'
# app names changed to protect the (not so) innocent
MyApp::Application.routes.draw do
match "/service", :to => MyService
...
end