Unable to debug in rubymine with rspec - rubymine

When running rubymine debug getting Test framework quit unexpectedly error.
Testing started at 11:41 AM ...
/bin/bash -c "env RBENV_VERSION=2.7.0 /home/workstation/.rbenv/libexec/rbenv exec bundle exec ruby /home/workstation/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/ruby-debug-ide-0.8.0.beta19/bin/rdebug-ide --key-value --step-over-in-blocks --disable-int-handler --evaluation-timeout 10 --evaluation-control --time-limit 100 --memory-limit 0 --rubymine-protocol-extensions --port 41145 --host 0.0.0.0 --dispatcher-port 37297 -- /home/workstation/.rbenv/versions/2.7.0/bin/rspec /home/workstation/workspace/railsprojects/labx/spec/requests/api/v1/sellers_request_spec.rb --require teamcity/spec/runner/formatter/teamcity/formatter --format 'Spec::Runner::Formatter::TeamcityFormatter' --example 'Api::V1::Sellers POST register'"
/home/workstation/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/debase-0.3.0.beta19/lib/debase.rb:7:in `require': cannot load such file -- debase_internals (LoadError)
from /home/workstation/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/debase-0.3.0.beta19/lib/debase.rb:7:in `<top (required)>'
from /home/workstation/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/ruby-debug-ide-0.8.0.beta19/lib/ruby-debug-ide.rb:9:in `require'
from /home/workstation/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/ruby-debug-ide-0.8.0.beta19/lib/ruby-debug-ide.rb:9:in `<top (required)>'
from /home/workstation/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/ruby-debug-ide-0.8.0.beta19/bin/rdebug-ide:8:in `require_relative'
from /home/workstation/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/ruby-debug-ide-0.8.0.beta19/bin/rdebug-ide:8:in `<main>'
Process finished with exit code 1
Versions
ruby: 2.7.0, rspec-rails: 4.0.0.pre, rails: 6-0-stable, Rubymine
2019.3.1
Only debug is failing if I run tests normally without debug it works fine. What could be the issue?

Related

Flutter iOS Error : Invalid `Podfile` file: no implicit conversion of nil into String

I just upgraded my flutter version to the latest stable version 2.0.1. But when I build iOS there is an error like below:
Launching lib/main.dart on iPhone in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: XXXXXXXX
Running pod install...
CocoaPods' output:
↳
[!] Invalid `Podfile` file: no implicit conversion of nil into String.
# from <my-project-path>/ios/Podfile:57
# -------------------------------------------
# unless File.exist?(copied_framework_path)
> FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir)
# end
# -------------------------------------------
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.1/lib/cocoapods-core/podfile.rb:318:in `rescue in block in from_ruby'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.1/lib/cocoapods-core/podfile.rb:312:in `block in from_ruby'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.1/lib/cocoapods-core/podfile.rb:50:in `instance_eval'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.1/lib/cocoapods-core/podfile.rb:50:in `initialize'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.1/lib/cocoapods-core/podfile.rb:310:in `new'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.1/lib/cocoapods-core/podfile.rb:310:in `from_ruby'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.1/lib/cocoapods-core/podfile.rb:276:in `from_file'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/config.rb:205:in `podfile'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:160:in `verify_podfile_exists!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command/install.rb:46:in `run'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'
Exception: Error running pod install
I have been looking for a solution in few days but i have not found a solution, is there anyone who can help?
thank you,

Vagrant access denied: launch error after windows update

I can't run any more my vagrant virtual machine on the command line under Windows Powershell since a big Windows update.
I always get the following error:
> vagrant up
==> All dependencies are satisfied
C:/HashiCorp/Vagrant/embedded/gems/2.2.7/gems/vagrant-2.2.7/lib/vagrant/util/subprocess.rb:158:in 'rescue in execute': Zugriff verweigert (5) (Vagrant::Util::Subprocess::LaunchError)
from C:/HashiCorp/Vagrant/embedded/gems/2.2.7/gems/vagrant-2.2.7/lib/vagrant/util/subprocess.rb:151:in `execute'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.7/gems/vagrant-2.2.7/lib/vagrant/util/subprocess.rb:22:in `execute'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.7/gems/vagrant-2.2.7/lib/vagrant/util/powershell.rb:115:in `execute_cmd'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.7/gems/vagrant-2.2.7/lib/vagrant/util/platform.rb:82:in `block in windows_admin?'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.7/gems/vagrant-2.2.7/lib/vagrant/util/platform.rb:84:in `windows_admin?'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.7/gems/vagrant-2.2.7/plugins/providers/hyperv/provider.rb:20:in `usable?'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.7/gems/vagrant-2.2.7/lib/vagrant/environment.rb:361:in `block in default_provider'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.7/gems/vagrant-2.2.7/lib/vagrant/registry.rb:49:in `block in each'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.7/gems/vagrant-2.2.7/lib/vagrant/registry.rb:48:in `each'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.7/gems/vagrant-2.2.7/lib/vagrant/registry.rb:48:in `each'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.7/gems/vagrant-2.2.7/lib/vagrant/environment.rb:347:in `default_provider'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.7/gems/vagrant-2.2.7/lib/vagrant/environment.rb:943:in `guess_provider'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.7/gems/vagrant-2.2.7/lib/vagrant/environment.rb:955:in `find_configured_plugins'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.7/gems/vagrant-2.2.7/lib/vagrant/environment.rb:983:in `process_configured_plugins'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.7/gems/vagrant-2.2.7/lib/vagrant/environment.rb:178:in `initialize'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.7/gems/vagrant-2.2.7/bin/vagrant:145:in `new'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.7/gems/vagrant-2.2.7/bin/vagrant:145:in `<main>'
Here is my setup:
Windows 10 Pro
Vagrant 2.2.7
Virtual Box 6.0.16
I also tried to launch run vagrant on Powershell administrator and Git bash too but I still got the same error.
Could you help me solve this error?
Thanks!
it seems that you are missing some privileges to run vagrant,
try to check if you can run it from a cmd opened as administrator

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.

"Could not find a JavaScript runtime." during executing the refinerycms command

I am working on Ubuntu 12.04.
I am trying to create a new website with Refinery CMS.
I read the official Getting Started guide, and executed the following command.
$ refinerycms rickrockstar
But I got the following error message:
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
rake db:create
rake aborted!
Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes.
(See full trace by running task with --trace)
generate refinery:cms --fresh-installation
/home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/execjs-1.4.0/lib/execjs/runtimes.rb:51:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/execjs-1.4.0/lib/execjs.rb:5:in `<module:ExecJS>'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/execjs-1.4.0/lib/execjs.rb:4:in `<top (required)>'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `require'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `<top (required)>'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `require'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `<top (required)>'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `require'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `<top (required)>'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.2.1/lib/bundler/runtime.rb:68:in `require'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.2.1/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.2.1/lib/bundler/runtime.rb:66:in `each'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.2.1/lib/bundler/runtime.rb:66:in `block in require'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.2.1/lib/bundler/runtime.rb:55:in `each'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.2.1/lib/bundler/runtime.rb:55:in `require'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.2.1/lib/bundler.rb:128:in `require'
from /srv/samba/share/refinery2test/rickrockstar/config/application.rb:13:in `<top (required)>'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.8/lib/rails/commands.rb:24:in `require'
from /home/jharai/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.8/lib/rails/commands.rb:24:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I've pasted the entire output on Gist because it was too long.
Strangely, I tried the same command some days before, and at that time everything worked fine.
Why does this happen? How can I solve it?
Maybe you could sudo apt-get install nodejs or see this post ExecJS and could not find a JavaScript runtime
To solve it I did:
Run refinerycms rickrockstar - it will fail with exception you described
Edit rickrockstar/Gemfile and uncomment *gem 'therubyracer', :platforms => :ruby* and save changes;
Run refinerycms rickrockstar again
Gemfile will have a conflict and ask if you want to override it. Answer no;
Override other files with conflicts
cd rickrockstar
rails s