i configured mongoid rails project, ran rails g mongoid:config edited mongoid.yml below.
development: clients: default: database: abacus_development # provides hosts default client can connect to. must array # of host:port pairs. (required) hosts: - localhost options: test: clients: default: database: abacus_test hosts: - localhost options: read: mode: primary max_pool_size: 1 then went on thinking running fine, scaffold controller , model called activity. ran rails s. app runs fine @ localhost:3000, moment localhost:3000/activites spits out this.
actionview::template::error (no server available matching preference: #<mongo::serverselector::primary:0x007fbda47c4110 @tag_sets=[], @options={:database=>:abacus_development}, @server_selection_timeout=30>): 15: </thead> 16: 17: <tbody> 18: <% @activities.each |activity| %> 19: <tr> 20: <td><%= activity.amount %></td> 21: <td><%= activity.indicator %></td> app/views/activities/index.html.erb:18:in `_app_views_activities_index_html_erb___73038992978597028_70226242222820' any ideas?
you running mongo right? 'mongod' if you're on mac or 'sudo service mongod start'. might stupid answer never know
Comments
Post a Comment