NoMethodError - undefined method `collection' for nil:NilClass:
Closed this issue · 1 comments
typpo commented
I'm getting the following error with HEAD (cc7c444) when loading /admin/experiments, only when running in production (thin start -e production
). Have I configured something incorrectly?
NoMethodError - undefined method `collection' for nil:NilClass:
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/mongo_mapper-0.12.0/lib/mongo_mapper/plugins/persistence.rb:49:in `collection'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/mongo_mapper-0.12.0/lib/mongo_mapper/plugins/querying.rb:61:in `query'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/mongo_mapper-0.12.0/lib/mongo_mapper/plugins/sci.rb:45:in `query'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/mongo_mapper-0.12.0/lib/mongo_mapper/plugins/identity_map.rb:90:in `query'
/home/username/abba/admin.rb:101:in `block in <top (required)>'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/sinatra-1.3.3/lib/sinatra/base.rb:1265:in `call'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/sinatra-1.3.3/lib/sinatra/base.rb:1265:in `block in compile!'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/sinatra-1.3.3/lib/sinatra/base.rb:835:in `[]'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/sinatra-1.3.3/lib/sinatra/base.rb:835:in `block (3 levels) in route!'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/sinatra-1.3.3/lib/sinatra/base.rb:851:in `route_eval'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/sinatra-1.3.3/lib/sinatra/base.rb:835:in `block (2 levels) in route!'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/sinatra-1.3.3/lib/sinatra/base.rb:872:in `block in process_route'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/sinatra-1.3.3/lib/sinatra/base.rb:870:in `catch'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/sinatra-1.3.3/lib/sinatra/base.rb:870:in `process_route'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/sinatra-1.3.3/lib/sinatra/base.rb:834:in `block in route!'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/sinatra-1.3.3/lib/sinatra/base.rb:833:in `each'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/sinatra-1.3.3/lib/sinatra/base.rb:833:in `route!'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/sinatra-1.3.3/lib/sinatra/base.rb:936:in `dispatch!'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/sinatra-1.3.3/lib/sinatra/base.rb:769:in `block in call!'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/sinatra-1.3.3/lib/sinatra/base.rb:921:in `block in invoke'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/sinatra-1.3.3/lib/sinatra/base.rb:921:in `catch'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/sinatra-1.3.3/lib/sinatra/base.rb:921:in `invoke'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/sinatra-1.3.3/lib/sinatra/base.rb:769:in `call!'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/sinatra-1.3.3/lib/sinatra/base.rb:755:in `call'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/rack-protection-1.3.2/lib/rack/protection/xss_header.rb:27:in `call'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/rack-protection-1.3.2/lib/rack/protection/path_traversal.rb:16:in `call'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/rack-protection-1.3.2/lib/rack/protection/json_csrf.rb:17:in `call'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/rack-protection-1.3.2/lib/rack/protection/base.rb:48:in `call'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/rack-protection-1.3.2/lib/rack/protection/base.rb:48:in `call'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/rack-protection-1.3.2/lib/rack/protection/xss_header.rb:27:in `call'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.3/lib/rack/logger.rb:15:in `call'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.3/lib/rack/commonlogger.rb:33:in `call'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/sinatra-1.3.3/lib/sinatra/base.rb:136:in `call'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/sinatra-1.3.3/lib/sinatra/base.rb:129:in `call'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.3/lib/rack/head.rb:9:in `call'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.3/lib/rack/methodoverride.rb:21:in `call'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/sinatra-1.3.3/lib/sinatra/base.rb:99:in `call'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/sinatra-1.3.3/lib/sinatra/base.rb:1389:in `block in call'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/sinatra-1.3.3/lib/sinatra/base.rb:1471:in `synchronize'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/sinatra-1.3.3/lib/sinatra/base.rb:1389:in `call'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/thin-1.5.0/lib/thin/connection.rb:81:in `block in pre_process'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/thin-1.5.0/lib/thin/connection.rb:79:in `catch'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/thin-1.5.0/lib/thin/connection.rb:79:in `pre_process'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/thin-1.5.0/lib/thin/connection.rb:54:in `process'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/thin-1.5.0/lib/thin/connection.rb:39:in `receive_data'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/eventmachine-1.0.0/lib/eventmachine.rb:187:in `run_machine'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/eventmachine-1.0.0/lib/eventmachine.rb:187:in `run'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/thin-1.5.0/lib/thin/backends/base.rb:63:in `start'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/thin-1.5.0/lib/thin/server.rb:159:in `start'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/thin-1.5.0/lib/thin/controllers/controller.rb:86:in `start'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/thin-1.5.0/lib/thin/runner.rb:187:in `run_command'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/thin-1.5.0/lib/thin/runner.rb:152:in `run!'
/home/username/.rvm/gems/ruby-1.9.3-p392/gems/thin-1.5.0/bin/thin:6:in `<top (required)>'
/home/username/.rvm/gems/ruby-1.9.3-p392/bin/thin:19:in `load'
/home/username/.rvm/gems/ruby-1.9.3-p392/bin/thin:19:in `<main>'
/home/username/.rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `eval'
/home/username/.rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `<main>'
Some version info:
$ ruby --version
ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-linux]
$ bundle
Using i18n (0.6.1)
Using multi_json (1.5.0)
Using activesupport (3.2.11)
Using builder (3.0.4)
Using activemodel (3.2.11)
Using backports (2.6.5)
Using bson (1.8.0)
Using bson_ext (1.8.0)
Using coffee-script-source (1.4.0)
Using execjs (1.4.0)
Using coffee-script (2.2.0)
Using daemons (1.1.9)
Using eco-source (1.1.0.rc.1)
Using eco (1.0.0)
Using erubis (2.7.0)
Using eventmachine (1.0.0)
Using hike (1.2.1)
Using mongo (1.8.0)
Using plucky (0.5.2)
Using mongo_mapper (0.12.0)
Using rack (1.4.3)
Using rack-protection (1.3.2)
Using rack-test (0.6.2)
Using tilt (1.3.3)
Using sinatra (1.3.3)
Using sinatra-contrib (1.3.2)
Using sprockets (2.4.5)
Using sprockets-commonjs (0.0.6.pre)
Using stylus-source (0.31.0)
Using stylus (0.6.2)
Using thin (1.5.0)
Using uglifier (1.3.0)
Using useragent (0.4.16)
Using bundler (1.3.4)
config.yml:
ssl: false
username: username123
password: password123
typpo commented
This was my mistake; I didn't set a MongoMapper production uri instead of the MONGOHQ_URL envar.