How to fix Circular dependency detected while autoloading constant error in rails? - ruby-on-rails

I've created multiple rails application from scratch, but somehow I'm not able fix Circular dependency error. For reproducing the error, I created new app with following commands,
rails new circular_test -d mysql
cd circular_test
rails g model MyImage
rails g scaffold MachineImage
rm db/migrate/20170419063916_create_my_image.rb
rails db:create
rails db:migrate
After this I edited the models, which are as follows,
app/models/machine_image.rb
class MachineImage < ApplicationRecord
AVAILABLE_FLAVORS = { "MyImage" => MyImage}
end
app/models/my_image.rb
class MyImage < MachineImage
end
Everything else was left with default setting. Nothing was changed. Note that, MyImage is inheriting from MachineImage, instead of ApplicationRecord. When I ran this application in development environment, everything works. But when I run the application in production mode (I made sure db:create & db:migrate is done for prod environment as well),
RAILS_ENV=production rails s
I get following error on running above command,
=> Booting Puma
=> Rails 5.0.2 application starting in production on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
Exiting
/Users/abhigup/.rvm/gems/ruby-2.2.2/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:509:in `load_missing_constant': Circular dependency detected while autoloading constant MyImage (RuntimeError)
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:203:in `const_missing'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:543:in `load_missing_constant'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:203:in `const_missing'
from /Users/abhigup/Work/git/circular_test/app/models/machine_image.rb:2:in `<class:MachineImage>'
from /Users/abhigup/Work/git/circular_test/app/models/machine_image.rb:1:in `<top (required)>'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:293:in `require'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:293:in `block in require'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:259:in `load_dependency'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:293:in `require'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:380:in `block in require_or_load'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:37:in `block in load_interlock'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/activesupport-5.0.2/lib/active_support/dependencies/interlock.rb:12:in `block in loading'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/activesupport-5.0.2/lib/active_support/concurrency/share_lock.rb:150:in `exclusive'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/activesupport-5.0.2/lib/active_support/dependencies/interlock.rb:11:in `loading'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:37:in `load_interlock'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:358:in `require_or_load'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:511:in `load_missing_constant'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:203:in `const_missing'
from /Users/abhigup/Work/git/circular_test/app/models/my_image.rb:1:in `<top (required)>'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:293:in `require'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:293:in `block in require'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:259:in `load_dependency'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:293:in `require'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:380:in `block in require_or_load'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:37:in `block in load_interlock'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/activesupport-5.0.2/lib/active_support/dependencies/interlock.rb:12:in `block in loading'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/activesupport-5.0.2/lib/active_support/concurrency/share_lock.rb:150:in `exclusive'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/activesupport-5.0.2/lib/active_support/dependencies/interlock.rb:11:in `loading'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:37:in `load_interlock'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:358:in `require_or_load'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:336:in `depend_on'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:252:in `require_dependency'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/railties-5.0.2/lib/rails/engine.rb:476:in `block (2 levels) in eager_load!'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/railties-5.0.2/lib/rails/engine.rb:475:in `each'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/railties-5.0.2/lib/rails/engine.rb:475:in `block in eager_load!'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/railties-5.0.2/lib/rails/engine.rb:473:in `each'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/railties-5.0.2/lib/rails/engine.rb:473:in `eager_load!'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/railties-5.0.2/lib/rails/engine.rb:354:in `eager_load!'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/railties-5.0.2/lib/rails/application/finisher.rb:59:in `each'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/railties-5.0.2/lib/rails/application/finisher.rb:59:in `block in <module:Finisher>'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/railties-5.0.2/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/railties-5.0.2/lib/rails/initializable.rb:30:in `run'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/railties-5.0.2/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/abhigup/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
from /Users/abhigup/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /Users/abhigup/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
from /Users/abhigup/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /Users/abhigup/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `each'
from /Users/abhigup/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `call'
from /Users/abhigup/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
from /Users/abhigup/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
from /Users/abhigup/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/railties-5.0.2/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/railties-5.0.2/lib/rails/application.rb:352:in `initialize!'
from /Users/abhigup/Work/git/circular_test/config/environment.rb:5:in `<top (required)>'
from /Users/abhigup/Work/git/circular_test/config.ru:3:in `require_relative'
from /Users/abhigup/Work/git/circular_test/config.ru:3:in `block in <main>'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/rack-2.0.1/lib/rack/builder.rb:55:in `instance_eval'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/rack-2.0.1/lib/rack/builder.rb:55:in `initialize'
from /Users/abhigup/Work/git/circular_test/config.ru:in `new'
from /Users/abhigup/Work/git/circular_test/config.ru:in `<main>'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/rack-2.0.1/lib/rack/builder.rb:49:in `eval'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/rack-2.0.1/lib/rack/builder.rb:49:in `new_from_string'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/rack-2.0.1/lib/rack/builder.rb:40:in `parse_file'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/rack-2.0.1/lib/rack/server.rb:318:in `build_app_and_options_from_config'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/rack-2.0.1/lib/rack/server.rb:218:in `app'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/railties-5.0.2/lib/rails/commands/server.rb:59:in `app'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/rack-2.0.1/lib/rack/server.rb:353:in `wrapped_app'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/rack-2.0.1/lib/rack/server.rb:282:in `start'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/railties-5.0.2/lib/rails/commands/server.rb:79:in `start'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:90:in `block in server'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:85:in `tap'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:85:in `server'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/railties-5.0.2/lib/rails/commands.rb:18:in `<top (required)>'
from /Users/abhigup/Work/git/circular_test/bin/rails:9:in `require'
from /Users/abhigup/Work/git/circular_test/bin/rails:9:in `<top (required)>'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/spring-2.0.1/lib/spring/client/rails.rb:28:in `load'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/spring-2.0.1/lib/spring/client/rails.rb:28:in `call'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/spring-2.0.1/lib/spring/client/command.rb:7:in `call'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/spring-2.0.1/lib/spring/client.rb:30:in `run'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/spring-2.0.1/bin/spring:49:in `<top (required)>'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/spring-2.0.1/lib/spring/binstub.rb:31:in `load'
from /Users/abhigup/.rvm/gems/ruby-2.2.2/gems/spring-2.0.1/lib/spring/binstub.rb:31:in `<top (required)>'
from /Users/abhigup/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
from /Users/abhigup/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
from /Users/abhigup/Work/git/circular_test/bin/spring:15:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
I was able to solve the problem by making config.eager_load = false in production.rb, but that is not ideal way to solve this issue. To addon, in my previous application I had similar structure, but it works flawlessly in production mode. Only difference is, that it is using SQLite. Is MySQL creating issue with this kind of structure? If not, What is the ideal way to solve this issue?
Note: I've tried looked into this, but it doesn't apply to me. As this error is related to load_missing_constant.
Ruby version: 2.2.2
Rails version: 5.0.2
OS: macOS Sierra 10.12.4
MySQL version: 5.7.17 Homebrew
Update: I found this article, which talks about possible reason. But it didn't specify, why the logic fails only when I try to use MySQL.

I would say that superclass shouldn't really know about sublclasses, however if you have to do so, in your specific case instead of having a constant AVAILABLE_FLAVORS, make it a class method:
def self.available_flavors
{ "MyImage" => MyImage}
end
This method won't be called when loading the class, then no circular dependency is there.

Related

Ruby On Rails Server Issue (Ubuntu Bash on Windows 10)

In another thread I explained I am a newbie RoR. I had a problem with the puma 3.8.0 gem then I downgraded to fixed one issue. But, it created another problem:
/root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/railties-5.0.2/lib/rails/app_loader.rb:40: warning: Insecure world writable dir /root/.rbenv/versions in PATH, mode 040777
=> Booting Puma
=> Rails 5.0.2 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
Exiting
/root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rb-inotify-0.9.8/lib/rb-inotify/watcher.rb:74:in `initialize': Invalid argument - Failed to watch "/root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-5.0.2/lib/active_support/locale": the given event mask contains no legal events; or fd is not an inotify file descriptor. (Errno::EINVAL)
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rb-inotify-0.9.8/lib/rb-inotify/notifier.rb:190:in `new'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rb-inotify-0.9.8/lib/rb-inotify/notifier.rb:190:in `watch'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rb-inotify-0.9.8/lib/rb-inotify/notifier.rb:208:in `watch'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/listen-3.0.8/lib/listen/adapter/linux.rb:32:in `_configure'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/listen-3.0.8/lib/listen/adapter/base.rb:45:in `block in configure'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/listen-3.0.8/lib/listen/adapter/base.rb:40:in `each'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/listen-3.0.8/lib/listen/adapter/base.rb:40:in `configure'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/listen-3.0.8/lib/listen/adapter/base.rb:63:in `start'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/listen-3.0.8/lib/listen/backend.rb:28:in `start'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/listen-3.0.8/lib/listen/listener.rb:67:in `block in <class:Listener>'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/listen-3.0.8/lib/listen/fsm.rb:120:in `instance_eval'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/listen-3.0.8/lib/listen/fsm.rb:120:in `call'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/listen-3.0.8/lib/listen/fsm.rb:91:in `transition_with_callbacks!'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/listen-3.0.8/lib/listen/fsm.rb:57:in `transition'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/listen-3.0.8/lib/listen/listener.rb:90:in `start'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-5.0.2/lib/active_support/evented_file_update_checker.rb:90:in `boot!'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-5.0.2/lib/active_support/evented_file_update_checker.rb:61:in `initialize'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-5.0.2/lib/active_support/i18n_railtie.rb:59:in `new'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-5.0.2/lib/active_support/i18n_railtie.rb:59:in `initialize_i18n'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-5.0.2/lib/active_support/i18n_railtie.rb:15:in `block in <class:Railtie>'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-5.0.2/lib/active_support/lazy_load_hooks.rb:41:in `execute_hook'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-5.0.2/lib/active_support/lazy_load_hooks.rb:50:in `block in run_load_hooks'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-5.0.2/lib/active_support/lazy_load_hooks.rb:49:in `each'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-5.0.2/lib/active_support/lazy_load_hooks.rb:49:in `run_load_hooks'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/railties-5.0.2/lib/rails/application/finisher.rb:65:in `block in <module:Finisher>'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/railties-5.0.2/lib/rails/initializable.rb:30:in `instance_exec'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/railties-5.0.2/lib/rails/initializable.rb:30:in `run'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/railties-5.0.2/lib/rails/initializable.rb:55:in `block in run_initializers'
from /root/.rbenv/versions/2.4.0/lib/ruby/2.4.0/tsort.rb:228:in `block in tsort_each'
from /root/.rbenv/versions/2.4.0/lib/ruby/2.4.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
from /root/.rbenv/versions/2.4.0/lib/ruby/2.4.0/tsort.rb:431:in `each_strongly_connected_component_from'
from /root/.rbenv/versions/2.4.0/lib/ruby/2.4.0/tsort.rb:349:in `block in each_strongly_connected_component'
from /root/.rbenv/versions/2.4.0/lib/ruby/2.4.0/tsort.rb:347:in `each'
from /root/.rbenv/versions/2.4.0/lib/ruby/2.4.0/tsort.rb:347:in `call'
from /root/.rbenv/versions/2.4.0/lib/ruby/2.4.0/tsort.rb:347:in `each_strongly_connected_component'
from /root/.rbenv/versions/2.4.0/lib/ruby/2.4.0/tsort.rb:226:in `tsort_each'
from /root/.rbenv/versions/2.4.0/lib/ruby/2.4.0/tsort.rb:205:in `tsort_each'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/railties-5.0.2/lib/rails/initializable.rb:54:in `run_initializers'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/railties-5.0.2/lib/rails/application.rb:352:in `initialize!'
from /root/appnew/config/environment.rb:5:in `<top (required)>'
from /root/appnew/config.ru:3:in `require_relative'
from /root/appnew/config.ru:3:in `block in <main>'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rack-2.0.1/lib/rack/builder.rb:55:in `instance_eval'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rack-2.0.1/lib/rack/builder.rb:55:in `initialize'
from /root/appnew/config.ru:in `new'
from /root/appnew/config.ru:in `<main>'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rack-2.0.1/lib/rack/builder.rb:49:in `eval'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rack-2.0.1/lib/rack/builder.rb:49:in `new_from_string'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rack-2.0.1/lib/rack/builder.rb:40:in `parse_file'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rack-2.0.1/lib/rack/server.rb:318:in `build_app_and_options_from_config'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rack-2.0.1/lib/rack/server.rb:218:in `app'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/railties-5.0.2/lib/rails/commands/server.rb:59:in `app'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rack-2.0.1/lib/rack/server.rb:353:in `wrapped_app'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/railties-5.0.2/lib/rails/commands/server.rb:124:in `log_to_stdout'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/railties-5.0.2/lib/rails/commands/server.rb:77:in `start'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:90:in `block in server'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:85:in `tap'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:85:in `server'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/railties-5.0.2/lib/rails/commands.rb:18:in `<top (required)>'
from /root/appnew/bin/rails:9:in `require'
from /root/appnew/bin/rails:9:in `<top (required)>'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/spring-2.0.1/lib/spring/client/rails.rb:28:in `load'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/spring-2.0.1/lib/spring/client/rails.rb:28:in `call'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/spring-2.0.1/lib/spring/client/command.rb:7:in `call'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/spring-2.0.1/lib/spring/client.rb:30:in `run'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/spring-2.0.1/bin/spring:49:in `<top (required)>'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/spring-2.0.1/lib/spring/binstub.rb:31:in `load'
from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/spring-2.0.1/lib/spring/binstub.rb:31:in `<top (required)>'
from /root/.rbenv/versions/2.4.0/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /root/.rbenv/versions/2.4.0/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /root/appnew/bin/spring:15:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
I'm not too sure what I am looking at? Hoping someone can point me in the right direction.
According to https://github.com/rails/rails/issues/26054 you can create an app with:
rails new --skip-spring --skip-listen APP_NAME
As noted in the link above this should be fixed in Windows 10 Insider builds >= 14942.
I got rails server working using the command above to create my rails app.
My ruby version is 2.4.0p0, rails version is 5.1.0.beta1 and puma version 3.7.1.

Running rails server on bash a linux system on windows

I am following this steps to install ruby on rails in ubuntu or linux subsystem on windows 10.
But this time, I used the updated ruby which is version 2.3.3, rails which is version 5.0.0.1, but after successfull installation of all the requirements, I tried to run this
rails new ruby_app
in the path /mnt/c/xampp/htdocs/ which is in windows local c and after a successfull installation I tried running this.
rails server
I got this problem
/home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/app_loader.rb:40: warning: Insecure world writable dir /home/fil/.rbenv/versions in PATH, mode 040777
=> Booting Puma
=> Rails 5.0.0.1 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
Exiting
/home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rb-inotify-0.9.7/lib/rb-inotify/watcher.rb:74:in `initialize': Invalid argument - Failed to watch "/home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/locale": the given event mask contains no legal events; or fd is not an inotify file descriptor. (Errno::EINVAL)
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rb-inotify-0.9.7/lib/rb-inotify/notifier.rb:190:in `new'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rb-inotify-0.9.7/lib/rb-inotify/notifier.rb:190:in `watch'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rb-inotify-0.9.7/lib/rb-inotify/notifier.rb:204:in `watch'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/adapter/linux.rb:32:in `_configure'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/adapter/base.rb:45:in `block in configure'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/adapter/base.rb:40:in `each'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/adapter/base.rb:40:in `configure'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/adapter/base.rb:63:in `start'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/backend.rb:28:in `start'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/listener.rb:67:in `block in <class:Listener>'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/fsm.rb:120:in `instance_eval'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/fsm.rb:120:in `call'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/fsm.rb:91:in `transition_with_callbacks!'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/fsm.rb:57:in `transition'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/listener.rb:90:in `start'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/evented_file_update_checker.rb:90:in `boot!'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/evented_file_update_checker.rb:61:in `initialize'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/i18n_railtie.rb:59:in `new'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/i18n_railtie.rb:59:in `initialize_i18n'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/i18n_railtie.rb:15:in `block in <class:Railtie>'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/lazy_load_hooks.rb:44:in `each'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/application/finisher.rb:65:in `block in <module:Finisher>'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:30:in `instance_exec'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:30:in `run'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/2.3.0/tsort.rb:347:in `each'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/2.3.0/tsort.rb:347:in `call'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:54:in `run_initializers'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/application.rb:352:in `initialize!'
from /mnt/c/xampp/htdocs/ruby_app/config/environment.rb:5:in `<top (required)>'
from /mnt/c/xampp/htdocs/ruby_app/config.ru:3:in `require_relative'
from /mnt/c/xampp/htdocs/ruby_app/config.ru:3:in `block in <main>'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:55:in `instance_eval'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:55:in `initialize'
from /mnt/c/xampp/htdocs/ruby_app/config.ru:in `new'
from /mnt/c/xampp/htdocs/ruby_app/config.ru:in `<main>'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:49:in `eval'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:49:in `new_from_string'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:40:in `parse_file'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/server.rb:318:in `build_app_and_options_from_config'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/server.rb:218:in `app'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/server.rb:59:in `app'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/server.rb:353:in `wrapped_app'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/server.rb:124:in `log_to_stdout'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/server.rb:77:in `start'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:90:in `block in server'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:85:in `tap'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:85:in `server'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands.rb:18:in `<top (required)>'
from /mnt/c/xampp/htdocs/ruby_app/bin/rails:9:in `require'
from /mnt/c/xampp/htdocs/ruby_app/bin/rails:9:in `<top (required)>'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/spring-2.0.0/lib/spring/client/rails.rb:28:in `load'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/spring-2.0.0/lib/spring/client/rails.rb:28:in `call'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/spring-2.0.0/lib/spring/client/command.rb:7:in `call'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/spring-2.0.0/lib/spring/client.rb:30:in `run'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/spring-2.0.0/bin/spring:49:in `<top (required)>'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/spring-2.0.0/lib/spring/binstub.rb:31:in `load'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/spring-2.0.0/lib/spring/binstub.rb:31:in `<top (required)>'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /home/fil/.rbenv/versions/2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /mnt/c/xampp/htdocs/ruby_app/bin/spring:14:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
Can you give idea what is this? how to solve it?
Don't have enough reputation to post as comment but this should provide some answers: https://github.com/rails/rails/issues/26054
Seems to be a windows related issue from last month.
Haven't used ruby on rails in quite a while so I can't reproduce or test (right now) to see if this is true.
From a comment wich was helpful to others:
Go to you config/environments/development.rb and comment out the last
line, something about watching files and listen gem. can't remember
from the top of my head the exact wording, but it is the last line of
config
this is new a new method that rails uses to watch changed files, but
it doesn't work on WSL
I think guard gem will also fail because of this
Bottom line:
Using rails new --skip-spring --skip-listen gives you a working app

Receiving syntax error message when trying to start application server for first Rails application after configuration [noob]

The following message pops up when I enter $ rails server in the Terminal (Mac, running latest version of Yosemite). I'm pretty lost, other topics have recommended altering the text in the config folder of my project, but what I've tried hasn't worked and I'm guessing because those are slightly dated topics.
I'm learning from the Learn Ruby on Rails book trying to get this MailChimp application working, completed up to the 13th chapter without any big issues. Any help is appreciated.
=> Booting WEBrick
=> Rails 4.1.1 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (-- binding option)
=> Ctrl-C to shutdown server
Exiting
/Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/psych.rb:370:in `parse': (<unknown>): found character that cannot start any token while scanning for the next token at line 14 column 1 (Psych::SyntaxError)
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/psych.rb:370:in `parse_stream'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/psych.rb:318:in `parse'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/psych.rb:245:in `load'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/application.rb:313:in `secrets'
from /Users/dengel29/workspace/learn-rails/config/environments/development.rb:32:in `block in <top (required)>'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/railtie.rb:210:in `instance_eval'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/railtie.rb:210:in `configure'
from /Users/dengel29/workspace/learn-rails/config/environments/development.rb:1:in `<top (required)>'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `block in require'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:232:in `load_dependency'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/engine.rb:594:in `block (2 levels) in <class:Engine>'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/engine.rb:593:in `each'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/engine.rb:593:in `block in <class:Engine>'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/initializable.rb:30:in `run'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:226:in `block in tsort_each'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:418:in `block (2 levels) in each_strongly_connected_component_from'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:427:in `each_strongly_connected_component_from'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:417:in `block in each_strongly_connected_component_from'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/initializable.rb:44:in `each'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/initializable.rb:44:in `tsort_each_child'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:411:in `call'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:411:in `each_strongly_connected_component_from'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:345:in `each'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:345:in `call'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:345:in `each_strongly_connected_component'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:224:in `tsort_each'
from /Users/dengel29/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:205:in `tsort_each'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/application.rb:288:in `initialize!'
from /Users/dengel29/workspace/learn-rails/config/environment.rb:5:in `<top (required)>'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `block in require'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:232:in `load_dependency'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
from /Users/dengel29/workspace/learn-rails/config.ru:3:in `block in <main>'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
from /Users/dengel29/workspace/learn-rails/config.ru:in `new'
from /Users/dengel29/workspace/learn-rails/config.ru:in `<main>'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/commands/server.rb:50:in `app'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/commands/server.rb:130:in `log_to_stdout'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/commands/server.rb:67:in `start'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:81:in `block in server'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:76:in `tap'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:76:in `server'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/commands.rb:17:in `<top (required)>'
from /Users/dengel29/workspace/learn-rails/bin/rails:8:in `require'
from /Users/dengel29/workspace/learn-rails/bin/rails:8:in `<top (required)>'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in `load'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in `call'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/spring-1.1.3/lib/spring/client/command.rb:7:in `call'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/spring-1.1.3/lib/spring/client.rb:26:in `run'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/spring-1.1.3/bin/spring:48:in `<top (required)>'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `load'
from /Users/dengel29/.rvm/gems/ruby-2.1.1/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `<top (required)>'
from /Users/dengel29/workspace/learn-rails/bin/spring:16:in `require'
from /Users/dengel29/workspace/learn-rails/bin/spring:16:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
Perhaps your ENV variables are not set up correctly, or you have an unusual character in one of the variables. Be careful there are not tab characters or any unusual characters in the config/secrets.yml file.
I suggest you replace all ENV values in the config/secrets.yml with hardcoded strings. Don't check the file into git with your private credentials in the file. Just test it to see if you can isolate the problem.

rails server not starting after switching form version 4 to version 3

I am using rails version 3.2.6 and i recently downgraded from 4.0 because i wanted to work on a 3 version environment because the tutorial im following they are using version 3.
I am on a windows 7 machine and this is what i have done so far.
i first did gem install rails -v 3.2.6
then i did gem uninstall rails, and chose the version i wanted to install.
i then downgraded the gem that were dependent on rails version 4 and i was not getting any errors when running bundle install.
now when i try to do rails s to see what broke on my page the server never starts and i get a bunch of file names:
=> Booting WEBrick
=> Rails 3.2.6 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activerecord-3.2.6/lib/active_record/dynamic_matchers.rb:50:in `method_missing'C:/Ruby200- x64/lib/ruby/gems/2.0.0/gems/orm_adapter-0.5.0/lib/orm_adapter/adapters/active_record.rb:81: warning: already initialized constant ActiveRecord::Base::OrmAdapter
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/orm_adapter-0.5.0/lib/orm_adapter/adapters/active_record.rb:81: warning: previous definition of OrmAdapter was here
: undefined method `migration_error=' for #<Class:0x000000053c7850> (NoMethodError)
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activerecord-3.2.6/lib/active_record/railtie.rb:66:in `block (3 levels) in <class:Railtie>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activerecord-3.2.6/lib/active_record/railtie.rb:65:in `each'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activerecord-3.2.6/lib/active_record/railtie.rb:65:in `block (2 levels) in <class:Railtie>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:43:in `block in run_load_hooks'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:42:in `each'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activerecord-3.2.6/lib/active_record/base.rb:721:in `<top (required)>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/devise-3.2.4/lib/devise/orm/active_record.rb:3:in `<top (required)>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in `require'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in `block in require'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:236:in `load_dependency'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in `require'
from C:/Users/Beans/Desktop/TestMaker/config/initializers/devise.rb:22:in `block in <top (required)>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/devise-3.2.4/lib/devise.rb:288:in `setup'
from C:/Users/Beans/Desktop/TestMaker/config/initializers/devise.rb:3:in `<top (required)>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:245:in `load'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:245:in `block in load'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:236:in `load_dependency'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:245:in `load'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.6/lib/rails/engine.rb:588:in `block (2 levels) in <class:Engine>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.6/lib/rails/engine.rb:587:in `each'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.6/lib/rails/engine.rb:587:in `block in <class:Engine>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.6/lib/rails/initializable.rb:30:in `instance_exec'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.6/lib/rails/initializable.rb:30:in `run'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.6/lib/rails/initializable.rb:55:in `block in run_initializers'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.6/lib/rails/initializable.rb:54:in `each'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.6/lib/rails/initializable.rb:54:in `run_initializers'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.6/lib/rails/application.rb:136:in `initialize!'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.6/lib/rails/railtie/configurable.rb:30:in `method_missing'
from C:/Users/Beans/Desktop/TestMaker/config/environment.rb:5:in `<top (required)>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in `require'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in `block in require'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:236:in `load_dependency'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in `require'
from C:/Users/Beans/Desktop/TestMaker/config.ru:3:in `block in <main>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
from C:/Users/Beans/Desktop/TestMaker/config.ru:in `new'
from C:/Users/Beans/Desktop/TestMaker/config.ru:in `<main>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rack-1.4.5/lib/rack/builder.rb:40:in `eval'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rack-1.4.5/lib/rack/builder.rb:40:in `parse_file'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rack-1.4.5/lib/rack/server.rb:200:in `app'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.6/lib/rails/commands/server.rb:46:in `app'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rack-1.4.5/lib/rack/server.rb:304:in `wrapped_app'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rack-1.4.5/lib/rack/server.rb:254:in `start'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.6/lib/rails/commands/server.rb:70:in `start'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.6/lib/rails/commands.rb:55:in `block in <top (required)>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.6/lib/rails/commands.rb:50:in `tap'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.6/lib/rails/commands.rb:50:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
i know this might be a bunch of garbage to some, but if someone could help me that would be awesome. if you need more information, please let me know.
thank you in advance.
Since i am using rails on windows, RVM does not work, so i used the pik gem and with that i changed my environment to 3.2.6 and then it worked fine.

Spree 2 - Advanced Reporting - Rails 4 - Run Error

Has anyone successfully tried to install Advanced Reporting using Rails 4?
I've successfully installed Spree 2 and was able to get the initial site up and running without this gem. However, this gem throws an error while running rails s, in the development environmnet.
Error message received when: rails s
D:\work\projects\ror\clientsite.com\sites\deals.clientsite.com>rails s
DL is deprecated, please use Fiddle
D:/work/projects/ror/clientsite.com/sites/deals.clientsite.com/vendor/extensions/advanced_reporting/ruby/2.0.0/gems/ruport-util-0.14.0/lib/ruport/util/graph/amline.rb:105: warning: undefining `object_id' may cause serious problems
=> Booting WEBrick
=> Rails 4.0.0 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Exiting
D:/work/projects/ror/clientsite.com/sites/deals.clientsite.com/vendor/extensions/advanced_reporting/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in `load': cannot load such file -- D:/work/projects/ror/clientsite.com/sites/deals.clientsite.com/vendor/extensions/advanced_reporting/ruby/2.0.0/bundler/gems/spree_active_shipping-057d7d306cdc/lib/spree_active_shipping/../../app/models/spree/calculator/shipping/canada_post/priority_worldwide_intl.rb (LoadError)
from D:/work/projects/ror/clientsite.com/sites/deals.clientsite.com/vendor/extensions/advanced_reporting/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in `block in load'
from D:/work/projects/ror/clientsite.com/sites/deals.clientsite.com/vendor/extensions/advanced_reporting/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
from D:/work/projects/ror/clientsite.com/sites/deals.clientsite.com/vendor/extensions/advanced_reporting/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in `load'
from D:/work/projects/ror/clientsite.com/sites/deals.clientsite.com/vendor/extensions/advanced_reporting/ruby/2.0.0/bundler/gems/spree_active_shipping-057d7d306cdc/lib/spree_active_shipping/engine.rb:32:in `block (2 levels) in <class:Engine>'
from D:/work/projects/ror/clientsite.com/sites/deals.clientsite.com/vendor/extensions/advanced_reporting/ruby/2.0.0/bundler/gems/spree_active_shipping-057d7d306cdc/lib/spree_active_shipping/engine.rb:31:in `each'
from D:/work/projects/ror/clientsite.com/sites/deals.clientsite.com/vendor/extensions/advanced_reporting/ruby/2.0.0/bundler/gems/spree_active_shipping-057d7d306cdc/lib/spree_active_shipping/engine.rb:31:in `block in <class:Engine>'
from D:/work/projects/ror/clientsite.com/sites/deals.clientsite.com/vendor/extensions/advanced_reporting/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `instance_exec'
from D:/work/projects/ror/clientsite.com/sites/deals.clientsite.com/vendor/extensions/advanced_reporting/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `run'
from D:/work/projects/ror/clientsite.com/sites/deals.clientsite.com/vendor/extensions/advanced_reporting/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:55:in `block in run_initializers'
from C:/ruby/Ruby200/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
from C:/ruby/Ruby200/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
from C:/ruby/Ruby200/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
from C:/ruby/Ruby200/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
from C:/ruby/Ruby200/lib/ruby/2.0.0/tsort.rb:180:in `each'
from C:/ruby/Ruby200/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
from C:/ruby/Ruby200/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
from D:/work/projects/ror/clientsite.com/sites/deals.clientsite.com/vendor/extensions/advanced_reporting/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:54:in `run_initializers'
from D:/work/projects/ror/clientsite.com/sites/deals.clientsite.com/vendor/extensions/advanced_reporting/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:215:in `initialize!'
from D:/work/projects/ror/clientsite.com/sites/deals.clientsite.com/vendor/extensions/advanced_reporting/ruby/2.0.0/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
from D:/work/projects/ror/clientsite.com/sites/deals.clientsite.com/config/environment.rb:5:in `<top (required)>'
from D:/work/projects/ror/clientsite.com/sites/deals.clientsite.com/vendor/extensions/advanced_reporting/ruby/2.0.0/gems/polyglot-0.3.3/lib/polyglot.rb:63:in `require'
from D:/work/projects/ror/clientsite.com/sites/deals.clientsite.com/vendor/extensions/advanced_reporting/ruby/2.0.0/gems/polyglot-0.3.3/lib/polyglot.rb:63:in `require'
from D:/work/projects/ror/clientsite.com/sites/deals.clientsite.com/vendor/extensions/advanced_reporting/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `block in require'
from D:/work/projects/ror/clientsite.com/sites/deals.clientsite.com/vendor/extensions/advanced_reporting/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
from D:/work/projects/ror/clientsite.com/sites/deals.clientsite.com/vendor/extensions/advanced_reporting/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
from D:/work/projects/ror/clientsite.com/sites/deals.clientsite.com/config.ru:3:in `block in <main>'
from D:/work/projects/ror/clientsite.com/sites/deals.clientsite.com/vendor/extensions/advanced_reporting/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
from D:/work/projects/ror/clientsite.com/sites/deals.clientsite.com/vendor/extensions/advanced_reporting/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
from D:/work/projects/ror/clientsite.com/sites/deals.clientsite.com/config.ru:in `new'
from D:/work/projects/ror/clientsite.com/sites/deals.clientsite.com/config.ru:in `<main>'
from D:/work/projects/ror/clientsite.com/sites/deals.clientsite.com/vendor/extensions/advanced_reporting/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
from D:/work/projects/ror/clientsite.com/sites/deals.clientsite.com/vendor/extensions/advanced_reporting/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
from D:/work/projects/ror/clientsite.com/sites/deals.clientsite.com/vendor/extensions/advanced_reporting/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
from D:/work/projects/ror/clientsite.com/sites/deals.clientsite.com/vendor/extensions/advanced_reporting/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
from D:/work/projects/ror/clientsite.com/sites/deals.clientsite.com/vendor/extensions/advanced_reporting/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
from D:/work/projects/ror/clientsite.com/sites/deals.clientsite.com/vendor/extensions/advanced_reporting/ruby/2.0.0/gems/railties-4.0.0/lib/rails/commands/server.rb:48:in `app'
from D:/work/projects/ror/clientsite.com/sites/deals.clientsite.com/vendor/extensions/advanced_reporting/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
from D:/work/projects/ror/clientsite.com/sites/deals.clientsite.com/vendor/extensions/advanced_reporting/ruby/2.0.0/gems/railties-4.0.0/lib/rails/commands/server.rb:75:in `start'
from D:/work/projects/ror/clientsite.com/sites/deals.clientsite.com/vendor/extensions/advanced_reporting/ruby/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:78:in `block in <top (required)>'
from D:/work/projects/ror/clientsite.com/sites/deals.clientsite.com/vendor/extensions/advanced_reporting/ruby/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:73:in `tap'
from D:/work/projects/ror/clientsite.com/sites/deals.clientsite.com/vendor/extensions/advanced_reporting/ruby/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:73:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'

Resources