Upgraded from Rails 2.3.5 to 2.3.11 and am getting this error now: "uninitialized constant AssignmentsPresenter::OrderedHash - upgrade

After upgrading, when I try to login to my Rails app, I get the following:
NameError in ApplicationsController#index
uninitialized constant AssignmentsPresenter::OrderedHash
RAILS_ROOT: /Users/jasonbodak
Application Trace | Framework Trace | Full Trace
/Users/jasonbodak/.rvm/gems/ree-1.8.7-2011.03#janova-local_app/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:131:in `const_missing'
/Users/jasonbodak/janova/janova/lib/assignments_presenter.rb:4:in `present'
/Users/jasonbodak/janova/janova/app/controllers/applications_controller.rb:12:in `index'
/Users/jasonbodak/.rvm/gems/ree-1.8.7-2011.03#janova-local_app/gems/actionpack-2.3.11/lib/action_controller/base.rb:1333:in `send'
/Users/jasonbodak/.rvm/gems/ree-1.8.7-2011.03#janova-local_app/gems/actionpack-2.3.11/lib/action_controller/base.rb:1333:in `perform_action_without_filters'
/Users/jasonbodak/.rvm/gems/ree-1.8.7-2011.03#janova-local_app/gems/actionpack-2.3.11/lib/action_controller/filters.rb:617:in `call_filters'
/Users/jasonbodak/.rvm/gems/ree-1.8.7-2011.03#janova-local_app/gems/actionpack-2.3.11/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/Users/jasonbodak/.rvm/gems/ree-1.8.7-2011.03#janova-local_app/gems/actionpack-2.3.11/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/Users/jasonbodak/.rvm/gems/ree-1.8.7-2011.03#janova-local_app/gems/activesupport-2.3.11/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/Users/jasonbodak/.rvm/gems/ree-1.8.7-2011.03#janova-local_app/gems/activesupport-2.3.11/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/Users/jasonbodak/.rvm/gems/ree-1.8.7-2011.03#janova-local_app/gems/actionpack-2.3.11/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/Users/jasonbodak/.rvm/gems/ree-1.8.7-2011.03#janova-local_app/gems/actionpack-2.3.11/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/Users/jasonbodak/.rvm/gems/ree-1.8.7-2011.03#janova-local_app/gems/actionpack-2.3.11/lib/action_controller/flash.rb:151:in `perform_action'
/Users/jasonbodak/.rvm/gems/ree-1.8.7-2011.03#janova-local_app/gems/actionpack-2.3.11/lib/action_controller/base.rb:532:in `send'
/Users/jasonbodak/.rvm/gems/ree-1.8.7-2011.03#janova-local_app/gems/actionpack-2.3.11/lib/action_controller/base.rb:532:in `process_without_filters'
/Users/jasonbodak/.rvm/gems/ree-1.8.7-2011.03#janova-local_app/gems/actionpack-2.3.11/lib/action_controller/filters.rb:606:in `process'
/Users/jasonbodak/.rvm/gems/ree-1.8.7-2011.03#janova-local_app/gems/actionpack-2.3.11/lib/action_controller/base.rb:391:in `process'
/Users/jasonbodak/.rvm/gems/ree-1.8.7-2011.03#janova-local_app/gems/actionpack-2.3.11/lib/action_controller/base.rb:386:in `call'
/Users/jasonbodak/.rvm/gems/ree-1.8.7-2011.03#janova-local_app/gems/actionpack-2.3.11/lib/action_controller/routing/route_set.rb:438:in `call'
Request
Parameters:
None
Show session dump
Response
Headers:
{"Content-Type"=>"",
"Cache-Control"=>"no-cache"}
Does this mean anything to anyone? Thanks.

OK, I figured it out. I don't know why upgrading Rails from 2.3.5 to 2.3.11 did this, but I had to change the line assignments_by_status = OrderedHash.new to assignments_by_status = ActiveSupport::OrderedHash.new and now it works just fine.

Related

Could not parse for environment production: no 'environments'

I have already installed puppet-server 3.7.5 and foreman. But when I am running this command I am getting below error.
~]# foreman-installer --foreman-db-type mysql
Error:
/usr/lib/ruby/site_ruby/1.8/puppet/context.rb:54:in `lookup': Could not parse for environment production: no 'environments' in {:root_environment=>#<Puppet::Node::Environment:0x7fe3646d9620 #modulepath=[], #watching=true, #config_version=nil, #manifest=:no_manifest, #name=:"*root*">, :current_environment=>#<Puppet::Node::Environment:0x7fe3646d9620 #modulepath=[], #watching=true, #config_version=nil, #manifest=:no_manifest, #name=:"*root*">} at top of [[0, nil, nil]] (Puppet::Error)
from /usr/lib/ruby/site_ruby/1.8/puppet.rb:236:in `lookup'
from /usr/lib/ruby/site_ruby/1.8/puppet.rb:264:in `future_parser?'
from /usr/lib/ruby/site_ruby/1.8/puppet/parser/parser_factory.rb:12:in `parser'
from /usr/lib/ruby/site_ruby/1.8/puppet/node/environment.rb:541:in `perform_initial_import'
from /usr/lib/ruby/site_ruby/1.8/puppet/node/environment.rb:276:in `known_resource_types'
from /usr/lib/ruby/site_ruby/1.8/puppet/resource/type_collection_helper.rb:5:in `known_resource_types'
from /usr/lib/ruby/site_ruby/1.8/puppet/parser/parser_support.rb:120:in `import'
from /usr/lib/ruby/gems/1.8/gems/kafo_parsers-0.0.3/lib/kafo_parsers/puppet_module_parser.rb:38:in `initialize'
from /usr/lib/ruby/gems/1.8/gems/kafo_parsers-0.0.3/lib/kafo_parsers/puppet_module_parser.rb:16:in `new'
from /usr/lib/ruby/gems/1.8/gems/kafo_parsers-0.0.3/lib/kafo_parsers/puppet_module_parser.rb:16:in `parse'
from /usr/lib/ruby/gems/1.8/gems/kafo-0.6.5/lib/kafo/puppet_module.rb:44:in `parse'
from /usr/lib/ruby/gems/1.8/gems/kafo-0.6.5/lib/kafo/configuration.rb:84:in `modules'
from /usr/lib/ruby/gems/1.8/gems/kafo-0.6.5/lib/kafo/configuration.rb:84:in `map'
from /usr/lib/ruby/gems/1.8/gems/kafo-0.6.5/lib/kafo/configuration.rb:84:in `modules'
from /usr/lib/ruby/gems/1.8/gems/kafo-0.6.5/lib/kafo/kafo_configure.rb:170:in `modules'
from /usr/lib/ruby/gems/1.8/gems/kafo-0.6.5/lib/kafo/kafo_configure.rb:152:in `params'
from /usr/lib/ruby/gems/1.8/gems/kafo-0.6.5/lib/kafo/kafo_configure.rb:185:in `set_parameters'
from /usr/lib/ruby/gems/1.8/gems/kafo-0.6.5/lib/kafo/kafo_configure.rb:66:in `initialize'
from /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:126:in `new'
from /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:126:in `run'
from /usr/lib/ruby/gems/1.8/gems/kafo-0.6.5/lib/kafo/kafo_configure.rb:116:in `run'
from /usr/sbin/foreman-installer:58
Looks like this is a bug introduced due to some changes in the way environments work in Puppet 3.7 and is not compatible with previous version. Based on bug filed here you will need to supply arguments to foreman installer.

Watir-webdriver gem in cloud9ide

Below is the error I receive in the Cloud9 IDE when attempting to run my very basic watir test script
require 'rubygems'
require 'watir-webdriver'
browser = Watir::Browser.new :firefox
browser.goto 'http://apple.com'
-- BEGIN ERROR --
/usr/local/rvm/gems/ruby-2.1.1#rails4/gems/selenium-webdriver-2.42.0/lib/selenium/webdriver/firefox/binary.rb:120:in `path': Could not find Firefox binary (os=linux). Make sure Firefox is installed or set the path manually with Selenium::WebDriver::Firefox::Binary.path= (Selenium::WebDriver::Error::WebDriverError)
from /usr/local/rvm/gems/ruby-2.1.1#rails4/gems/selenium-webdriver-2.42.0/lib/selenium/webdriver/firefox/binary.rb:53:in `execute'
from /usr/local/rvm/gems/ruby-2.1.1#rails4/gems/selenium-webdriver-2.42.0/lib/selenium/webdriver/firefox/binary.rb:34:in `start_with'
from /usr/local/rvm/gems/ruby-2.1.1#rails4/gems/selenium-webdriver-2.42.0/lib/selenium/webdriver/firefox/launcher.rb:70:in `start_silent_and_wait'
from /usr/local/rvm/gems/ruby-2.1.1#rails4/gems/selenium-webdriver-2.42.0/lib/selenium/webdriver/firefox/launcher.rb:35:in `block in launch'
from /usr/local/rvm/gems/ruby-2.1.1#rails4/gems/selenium-webdriver-2.42.0/lib/selenium/webdriver/firefox/socket_lock.rb:20:in `locked'
from /usr/local/rvm/gems/ruby-2.1.1#rails4/gems/selenium-webdriver-2.42.0/lib/selenium/webdriver/firefox/launcher.rb:32:in `launch'
from /usr/local/rvm/gems/ruby-2.1.1#rails4/gems/selenium-webdriver-2.42.0/lib/selenium/webdriver/firefox/bridge.rb:24:in `initialize'
from /usr/local/rvm/gems/ruby-2.1.1#rails4/gems/selenium-webdriver-2.42.0/lib/selenium/webdriver/common/driver.rb:31:in `new'
from /usr/local/rvm/gems/ruby-2.1.1#rails4/gems/selenium-webdriver-2.42.0/lib/selenium/webdriver/common/driver.rb:31:in `for'
from /usr/local/rvm/gems/ruby-2.1.1#rails4/gems/selenium-webdriver-2.42.0/lib/selenium/webdriver.rb:67:in `for'
from /usr/local/rvm/gems/ruby-2.1.1#rails4/gems/watir-webdriver-0.6.10/lib/watir-webdriver/browser.rb:46:in `initialize'
from /home/ubuntu/workspace/test_puppies/first_script.rb:3:in `new'
from /home/ubuntu/workspace/test_puppies/first_script.rb:3:in `<main>'
I had the same problem. After a lot of trial and error I found running Install firefox and xvfb: sudo apt-get install firefox xvfb fixed it for me.
I should note that I am using the headless gem you mentioned above and this code on the watirwebdriver.com website.
require 'watir-webdriver'
require 'headless'
headless = Headless.new
headless.start
b = Watir::Browser.start 'www.google.com'
puts b.title
b.close
headless.destroy

rails-api not allowing any generation

I'm struggling trying to get the configuration of rails-api with the mongo_mapper gem.
I'm using rails v 4.1.1
gemfile looks as follows
source 'https://rubygems.org'
gem 'mongo'
gem 'mongo_mapper', :git => "git://github.com/mongomapper/mongomapper.git", :tag => "v0.13.0.beta2"
gem 'bson_ext'
gem 'railties'
I ran rails-api new test-app --skip-active-record which generates a simple file structure.
.
├── Gemfile
├── Gemfile.lock
├── README.rdoc
├── Rakefile
└── config.ru
After that, per the instructions on the README for mongo_mapper I specified the correct version in my gemfile so that it's compatible with Rails 4.
gem 'mongo_mapper', :git => "git://github.com/mongomapper/mongomapper.git", :tag => "v0.13.0.beta2"
According to
- http://mongomapper.com/documentation/getting-started/rails.html
- How can I get mongo mapper to generate the config/mongo.yml file in Rails 4
I should then be able to run bundle exec rails generate mongo_mapper:config. It was here I started running into issues.
I first realized I need railsties gem since it wasn't even letting me run rails generate.
$ bundle exec rails generate mongo_mapper:config
/Users/colinhhart/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.6.1/lib/bundler/rubygems_integration.rb:248:in `block in replace_gem': railties is not part of the bundle. Add it to Gemfile. (Gem::LoadError)
from /Users/colinhhart/.rbenv/versions/2.1.0/bin/rails:22:in `<main>'
After adding that gem it allowed me to run bundle exec rails generate mongo_mapper:config but doesn't actually have access to that mongo generator. The output from the command is the standard rails help info including usage, options etc.
Usage:
rails new APP_PATH [options]
Options:
-r, [--ruby=PATH] # Path to the Ruby binary of your choice
# Default: /Users/colinhhart/.rbenv/versions/2.1.0/bin/ruby
-m, [--template=TEMPLATE] # Path to some application template (can be a filesystem path or URL)
What I've tried so far
I've tried building out what the generator is supposed to build as is described in this guide
http://technicaldebt.com/getting-started-with-ruby/mongomapper-ith-rails-quickstart/
But then realized that even if I build that out there's obviously still some "glue" that I'm missing, which ties everything together. I built it out just in case and of course it still didn't work.
I've made sure to bundle and and reload the terminal appropriately.
Like I said, I'm pretty sure there's something necessary that gets skipped when I build the rails-api without active record.
Any thoughts on this? Would greatly appreciate the help.
For what it's worth this is the full output when I ran rails-api new my_app --skip-active-record.
$ rails-api new pitfworld_wide_atrocities_db --skip-active-record
create
create README.rdoc
create Rakefile
create config.ru
create .gitignore
create Gemfile
(erb):19:in `template': undefined method `name' for []:Array (NoMethodError)
from /Users/colinhhart/.rbenv/versions/2.1.0/lib/ruby/2.1.0/erb.rb:850:in `eval'
from /Users/colinhhart/.rbenv/versions/2.1.0/lib/ruby/2.1.0/erb.rb:850:in `result'
from /Users/colinhhart/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/actions/file_manipulation.rb:116:in `block in template'
from /Users/colinhhart/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/actions/create_file.rb:53:in `call'
from /Users/colinhhart/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/actions/create_file.rb:53:in `render'
from /Users/colinhhart/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/actions/create_file.rb:62:in `block (2 levels) in invoke!'
from /Users/colinhhart/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/actions/create_file.rb:62:in `open'
from /Users/colinhhart/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/actions/create_file.rb:62:in `block in invoke!'
from /Users/colinhhart/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/actions/empty_directory.rb:116:in `call'
from /Users/colinhhart/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/actions/empty_directory.rb:116:in `invoke_with_conflict_check'
from /Users/colinhhart/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/actions/create_file.rb:60:in `invoke!'
from /Users/colinhhart/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/actions.rb:94:in `action'
from /Users/colinhhart/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/actions/create_file.rb:25:in `create_file'
from /Users/colinhhart/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/actions/file_manipulation.rb:115:in `template'
from /Users/colinhhart/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.1/lib/rails/generators/rails/app/app_generator.rb:17:in `template'
from /Users/colinhhart/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.1/lib/rails/generators/rails/app/app_generator.rb:45:in `gemfile'
from /Users/colinhhart/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.1/lib/rails/generators/app_base.rb:133:in `build'
from /Users/colinhhart/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.1/lib/rails/generators/rails/app/app_generator.rb:176:in `create_root_files'
from /Users/colinhhart/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
from /Users/colinhhart/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
from /Users/colinhhart/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `block in invoke_all'
from /Users/colinhhart/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `each'
from /Users/colinhhart/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `map'
from /Users/colinhhart/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `invoke_all'
from /Users/colinhhart/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/group.rb:232:in `dispatch'
from /Users/colinhhart/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
from /Users/colinhhart/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.1/lib/rails/commands/application.rb:17:in `<top (required)>'
from /Users/colinhhart/.rbenv/versions/2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
from /Users/colinhhart/.rbenv/versions/2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
from /Users/colinhhart/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.1/lib/rails/cli.rb:14:in `<top (required)>'
from /Users/colinhhart/.rbenv/versions/2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
from /Users/colinhhart/.rbenv/versions/2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
from /Users/colinhhart/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rails-api-0.2.1/bin/rails-api:4:in `<top (required)>'
from /Users/colinhhart/.rbenv/versions/2.1.0/bin/rails-api:23:in `load'
from /Users/colinhhart/.rbenv/versions/2.1.0/bin/rails-api:23:in `<main>'
Solution
I came across that rails-api issue right as I was writing this post and it turned out that that was the issue, after banging my head forever thinking it was a mongo issue.
The issue has been fixed and closed but hasn't yet been released and will probably be released in rails-api v0.2.2.
Ultimately, I decided to just go into the rails-api source code and apply the changes locally.

Rails app with mongoid ... (Mongoid::Errors::NoSessionConfig): No configuration could be found for a session named 'default'

With reference to https://github.com/mongoid/mongoid/issues/2894#issuecomment-14903927
I've done all the necessary changes ... still the issue is there ...
spec_helper.rb file
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", FILE)
require 'rspec/rails'
require 'rspec/autorun'
require 'rails/mongoid'
Gemfile
gem 'rails', '4.0.0'
gem 'rspec-rails', '~>2.14.0'
gem 'mongoid', git: 'https://github.com/mongoid/mongoid.git'
gem 'bson_ext'
mongoid.yml
development:
sessions:
default:
database: mongo_demo_development
hosts:
- localhost:27017
options:
options:
test:
sessions:
default:
database: mongo_demo_test
hosts:
- localhost:27017
options:
consistency: :strong
max_retries: 1
retry_interval: 0
Following is the Error Log which is generated when I run my rails server with $rails s ...
/home/nikunj/.rvm/gems/ruby-1.9.3-p385/bundler/gems/mongoid-d52c33bce36a/lib/mongoid/sessions/factory.rb:27:in create': (Mongoid::Errors::NoSessionConfig)
Problem:
No configuration could be found for a session named 'default'.
Summary:
When attempting to create the new session, Mongoid could not find a session configuration for the name: 'default'. This is necessary in order to know the host, port, and options needed to connect.
Resolution:
Double check your mongoid.yml to make sure under the sessions key that a configuration exists for 'default'. If you have set the configuration programatically, ensure that 'default' exists in the configuration hash.
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385/bundler/gems/mongoid-d52c33bce36a/lib/mongoid/sessions.rb:137:inwith_name'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385/bundler/gems/mongoid-d52c33bce36a/lib/mongoid/sessions.rb:390:in __session__'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385/bundler/gems/mongoid-d52c33bce36a/lib/mongoid/sessions.rb:227:inmongo_session'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385/bundler/gems/mongoid-d52c33bce36a/lib/mongoid/sessions.rb:171:in collection'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385/bundler/gems/mongoid-d52c33bce36a/lib/mongoid/contextual/mongo.rb:265:ininitialize'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385/bundler/gems/mongoid-d52c33bce36a/lib/mongoid/contextual.rb:51:in new'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385/bundler/gems/mongoid-d52c33bce36a/lib/mongoid/contextual.rb:51:increate_context'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385/bundler/gems/mongoid-d52c33bce36a/lib/mongoid/contextual.rb:34:in context'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385/bundler/gems/mongoid-d52c33bce36a/lib/mongoid/contextual.rb:18:inlast'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385/bundler/gems/mongoid-d52c33bce36a/lib/mongoid/findable.rb:130:in last'
from /home/nikunj/Practice/mongo_demo/app/rules/myrule_book.rb:5:inclass:Myrule_Book'
from /home/nikunj/Practice/mongo_demo/app/rules/myrule_book.rb:3:in <top (required)>'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:423:inload'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:423:in block in load_file'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:615:innew_constants_in'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:422:in load_file'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:323:inrequire_or_load'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:462:in load_missing_constant'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:183:inconst_missing'
from /home/nikunj/Practice/mongo_demo/config/environments/development.rb:30:in block in <top (required)>'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:24:inclass_eval'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:24:in configure'
from /home/nikunj/Practice/mongo_demo/config/environments/development.rb:1:in'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in require'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:inblock in require'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in load_dependency'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:inrequire'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385/gems/railties-4.0.0/lib/rails/engine.rb:591:in block (2 levels) in <class:Engine>'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385/gems/railties-4.0.0/lib/rails/engine.rb:590:ineach'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385/gems/railties-4.0.0/lib/rails/engine.rb:590:in block in <class:Engine>'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385/gems/railties-4.0.0/lib/rails/initializable.rb:30:ininstance_exec'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385/gems/railties-4.0.0/lib/rails/initializable.rb:30:in run'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385/gems/railties-4.0.0/lib/rails/initializable.rb:55:inblock in run_initializers'
from /home/nikunj/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/tsort.rb:150:in block in tsort_each'
from /home/nikunj/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/tsort.rb:183:inblock (2 levels) in each_strongly_connected_component'
from /home/nikunj/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/tsort.rb:210:in block (2 levels) in each_strongly_connected_component_from'
from /home/nikunj/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/tsort.rb:219:ineach_strongly_connected_component_from'
from /home/nikunj/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/tsort.rb:209:in block in each_strongly_connected_component_from'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385/gems/railties-4.0.0/lib/rails/initializable.rb:44:ineach'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385/gems/railties-4.0.0/lib/rails/initializable.rb:44:in tsort_each_child'
from /home/nikunj/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/tsort.rb:203:ineach_strongly_connected_component_from'
from /home/nikunj/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/tsort.rb:182:in block in each_strongly_connected_component'
from /home/nikunj/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/tsort.rb:180:ineach'
from /home/nikunj/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/tsort.rb:180:in each_strongly_connected_component'
from /home/nikunj/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/tsort.rb:148:intsort_each'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385/gems/railties-4.0.0/lib/rails/initializable.rb:54:in run_initializers'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385/gems/railties-4.0.0/lib/rails/application.rb:215:ininitialize!'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:in method_missing'
from /home/nikunj/Practice/mongo_demo/config/environment.rb:5:in'
from /home/nikunj/Practice/mongo_demo/config.ru:3:in require'
from /home/nikunj/Practice/mongo_demo/config.ru:3:inblock in '
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385#global/gems/rack-1.5.2/lib/rack/builder.rb:55:in instance_eval'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385#global/gems/rack-1.5.2/lib/rack/builder.rb:55:ininitialize'
from /home/nikunj/Practice/mongo_demo/config.ru:in new'
from /home/nikunj/Practice/mongo_demo/config.ru:in'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385#global/gems/rack-1.5.2/lib/rack/builder.rb:49:in eval'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385#global/gems/rack-1.5.2/lib/rack/builder.rb:49:innew_from_string'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385#global/gems/rack-1.5.2/lib/rack/builder.rb:40:in parse_file'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385#global/gems/rack-1.5.2/lib/rack/server.rb:277:inbuild_app_and_options_from_config'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385#global/gems/rack-1.5.2/lib/rack/server.rb:199:in app'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385/gems/railties-4.0.0/lib/rails/commands/server.rb:48:inapp'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385#global/gems/rack-1.5.2/lib/rack/server.rb:314:in wrapped_app'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385/gems/railties-4.0.0/lib/rails/commands/server.rb:75:instart'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385/gems/railties-4.0.0/lib/rails/commands.rb:78:in block in <top (required)>'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385/gems/railties-4.0.0/lib/rails/commands.rb:73:intap'
from /home/nikunj/.rvm/gems/ruby-1.9.3-p385/gems/railties-4.0.0/lib/rails/commands.rb:73:in <top (required)>'
from bin/rails:4:inrequire'
from bin/rails:4:in `'
Your mongoid.yml has an error "hosts:" key should be inside of "default:" because it is a required configuration for sessions
Please check http://mongoid.org/en/mongoid/docs/installation.html#configuration
I had the same issue and error message - In my case it was caused because the yml config file wasn't loaded. I added the following line
Mongoid.load!('config/mongoid.yml')
to config/application.rb and it solved the problem
may be The problem is in the gem file, you did't mention the version of mongoid gem. in gem file change gem "mongoid" to gem "mongoid" , '~> 4.0.2' and run bundle install restart server and console.

uninitialized constant Rake::Pipeline::ManifestEntry::DateTime

I'm not a ruby person and i'm working on a project with Ember.js and i'm using Rake pipeline for compile my scripts.
# AssetFile
$: << 'lib'
require 'rake-pipeline-web-filters'
output BUILD
input SRC_DIR do
match '**/*.handlebars' do
handlebars :precompile => true
concat 'templates.js'
end
match '**/*.coffee' do
coffee_script
end
end
output JS_DIR
input BUILD_DIR do
match '*.js' do
concat 'app.js'
end
end
when i execute rakep on the console works fine the first time but the second time i get an const_missing error
c:/Ruby193/lib/ruby/1.9.1/rake/ext/module.rb:36:in `const_missing': uninitialized constant Rake::Pipeline::ManifestEntry::DateTime (NameError)
from c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-pipeline-0.7.0/lib/rake-pipeline/manifest_entry.rb:9:in `from_hash'
from c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-pipeline-0.7.0/lib/rake-pipeline/manifest.rb:24:in `block in read_manifest'
from c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-pipeline-0.7.0/lib/rake-pipeline/manifest.rb:23:in `each'
from c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-pipeline-0.7.0/lib/rake-pipeline/manifest.rb:23:in `read_manifest'
from c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-pipeline-0.7.0/lib/rake-pipeline/project.rb:225:in `last_manifest'
from c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-pipeline-0.7.0/lib/rake-pipeline/filter.rb:219:in `create_file_task'
from c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-pipeline-0.7.0/lib/rake-pipeline/filter.rb:197:in `block (2 levels) in generate_rake_tasks'
from c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-pipeline-0.7.0/lib/rake-pipeline/filter.rb:196:in `each'
from c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-pipeline-0.7.0/lib/rake-pipeline/filter.rb:196:in `block in generate_rake_tasks'
from c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-pipeline-0.7.0/lib/rake-pipeline/filter.rb:194:in `each'
from c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-pipeline-0.7.0/lib/rake-pipeline/filter.rb:194:in `map'
from c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-pipeline-0.7.0/lib/rake-pipeline/filter.rb:194:in `generate_rake_tasks'
from c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-pipeline-0.7.0/lib/rake-pipeline.rb:410:in `block in generate_rake_tasks'
from c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-pipeline-0.7.0/lib/rake-pipeline.rb:407:in `each'
from c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-pipeline-0.7.0/lib/rake-pipeline.rb:407:in `generate_rake_tasks'
from c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-pipeline-0.7.0/lib/rake-pipeline.rb:333:in `setup'
from c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-pipeline-0.7.0/lib/rake-pipeline.rb:308:in `block in invoke'
from <internal:prelude>:10:in `synchronize'
from c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-pipeline-0.7.0/lib/rake-pipeline.rb:305:in `invoke'
from c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-pipeline-0.7.0/lib/rake-pipeline/project.rb:111:in `each'
from c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-pipeline-0.7.0/lib/rake-pipeline/project.rb:111:in `block in invoke'
from <internal:prelude>:10:in `synchronize'
from c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-pipeline-0.7.0/lib/rake-pipeline/project.rb:110:in `invoke'
from c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-pipeline-0.7.0/lib/rake-pipeline/cli.rb:19:in `build'
from c:/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.16.0/lib/thor/task.rb:27:in `run'
from c:/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.16.0/lib/thor/invocation.rb:120:in `invoke_task'
from c:/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.16.0/lib/thor.rb:275:in `dispatch'
from c:/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.16.0/lib/thor/base.rb:425:in `start'
from c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-pipeline-0.7.0/bin/rakep:4:in `<top (required)>'
from c:/Ruby193/bin/rakep:23:in `load'
from c:/Ruby193/bin/rakep:23:in `<main>'
the rakep command works fine when i remove the files manually or let pass time
Note:I am also having problems to sort the files to concatenate
I just hit upon the same problem. I'm using rake-pipeline to minify stylesheets for a static site.
What's happening here is that rake-pipeline is trying to parse a datetime using the DateTime class, but since you're not working on a Ruby project, the class isn't available. I guess because rake-pipeline is mostly used in Ruby projects, nobody noticed that this was a problem at the time. I can see that this problem has been fixed on the master branch, but a new gem version hasn't been released yet.
In the meantime, you can add the following code to your Assetfile (before your input and output), which will delete the tmp directory before your filters run. This is only a temporary fix as it means that your inputs will be filtered every time, regardless of whether they've changed, but it does negate the need for any dodgy datetime parsing.
require 'fileutils'
FileUtils.rm_rf 'tmp'
Be careful with rm_rf! Make sure it's pointing at your tmp directory and nothing else.
Re: sorting your files, I don't know the specifics of your problem, but you might find this example helpful.