Run rails server command - ruby-on-rails

I'm using ActiveAdmin framework, I followed the ActiveAdmin's getting started and in the last step rails generate active_admin:resource [MyModelName] I write this: rails generate active_admin:resource User then I tried to see the results in the browser so I run the server rails s and then I get this problem:
edu#edu-ThinkPad-Edge:~/Desktop/rails_proyects/fulbo$ rails server
=> Booting WEBrick
=> Rails 3.2.13 application starting in development on `http://0.0.0.0:3000`
=> Call with -d to detach
=> Ctrl-C to shutdown server Exiting /home/edu/Desktop/rails_proyects/fulbo/app/admin/users.rb:1:in `<top
(required)>': uninitialized constant User (NameError) from
/home/edu/.rvm/gems/ruby-1.9.3-p392#fulbo/gems/activeadmin-0.6.0/lib/active_admin/application.rb:179:in
`block in load!' from
/home/edu/.rvm/gems/ruby-1.9.3-p392#fulbo/gems/activeadmin-0.6.0/lib/active_admin/application.rb:179:in
`each' from
/home/edu/.rvm/gems/ruby-1.9.3-p392#fulbo/gems/activeadmin-0.6.0/lib/active_admin/application.rb:179:in
`load!' from
/home/edu/.rvm/gems/ruby-1.9.3-p392#fulbo/gems/activeadmin-0.6.0/lib/active_admin/application.rb:197:in
`routes' from
/home/edu/.rvm/gems/ruby-1.9.3-p392#fulbo/gems/activeadmin-0.6.0/lib/active_admin.rb:83:in
`routes' from
/home/edu/Desktop/rails_proyects/fulbo/config/routes.rb:3:in `block in
<top (required)>' from
/home/edu/.rvm/gems/ruby-1.9.3-p392#fulbo/gems/actionpack-3.2.13/lib/action_dispatch/routing/route_set.rb:289:in
`instance_exec' from
/home/edu/.rvm/gems/ruby-1.9.3-p392#fulbo/gems/actionpack-3.2.13/lib/action_dispatch/routing/route_set.rb:289:in
`eval_block' from
/home/edu/.rvm/gems/ruby-1.9.3-p392#fulbo/gems/actionpack-3.2.13/lib/action_dispatch/routing/route_set.rb:267:in
`draw' from
/home/edu/Desktop/rails_proyects/fulbo/config/routes.rb:1:in `<top
(required)>' from
/home/edu/.rvm/gems/ruby-1.9.3-p392#fulbo/gems/railties-3.2.13/lib/rails/application/routes_reloader.rb:40:in
`block in load_paths' from
/home/edu/.rvm/gems/ruby-1.9.3-p392#fulbo/gems/railties-3.2.13/lib/rails/application/routes_reloader.rb:40:in
`each' from
/home/edu/.rvm/gems/ruby-1.9.3-p392#fulbo/gems/railties-3.2.13/lib/rails/application/routes_reloader.rb:40:in
`load_paths' from
/home/edu/.rvm/gems/ruby-1.9.3-p392#fulbo/gems/railties-3.2.13/lib/rails/application/routes_reloader.rb:16:in
`reload!' from
/home/edu/.rvm/gems/ruby-1.9.3-p392#fulbo/gems/railties-3.2.13/lib/rails/application.rb:108:in `reload_routes!' from
/home/edu/.rvm/gems/ruby-1.9.3-p392#fulbo/gems/activeadmin-0.6.0/lib/active_admin/reloader.rb:34:in
`reload!' from
/home/edu/.rvm/gems/ruby-1.9.3-p392#fulbo/gems/activeadmin-0.6.0/lib/active_admin/reloader.rb:61:in
`block in attach!' from
/home/edu/.rvm/gems/ruby-1.9.3-p392#fulbo/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:429:in
`_run__246534365__prepare__874865436__callbacks' from
/home/edu/.rvm/gems/ruby-1.9.3-p392#fulbo/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:405:in
`__run_callback' from
/home/edu/.rvm/gems/ruby-1.9.3-p392#fulbo/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:385:in
`_run_prepare_callbacks' from
/home/edu/.rvm/gems/ruby-1.9.3-p392#fulbo/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:81:in
`run_callbacks' from
/home/edu/.rvm/gems/ruby-1.9.3-p392#fulbo/gems/actionpack-3.2.13/lib/action_dispatch/middleware/reloader.rb:74:in
`prepare!' from
/home/edu/.rvm/gems/ruby-1.9.3-p392#fulbo/gems/actionpack-3.2.13/lib/action_dispatch/middleware/reloader.rb:48:in
`prepare!' from
/home/edu/.rvm/gems/ruby-1.9.3-p392#fulbo/gems/railties-3.2.13/lib/rails/application/finisher.rb:47:in
`block in <module:Finisher>' from
/home/edu/.rvm/gems/ruby-1.9.3-p392#fulbo/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `instance_exec' from
/home/edu/.rvm/gems/ruby-1.9.3-p392#fulbo/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `run' from
/home/edu/.rvm/gems/ruby-1.9.3-p392#fulbo/gems/railties-3.2.13/lib/rails/initializable.rb:55:in `block in run_initializers' from
/home/edu/.rvm/gems/ruby-1.9.3-p392#fulbo/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `each' from
/home/edu/.rvm/gems/ruby-1.9.3-p392#fulbo/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `run_initializers' from
/home/edu/.rvm/gems/ruby-1.9.3-p392#fulbo/gems/railties-3.2.13/lib/rails/application.rb:136:in `initialize!' from
/home/edu/.rvm/gems/ruby-1.9.3-p392#fulbo/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:in
`method_missing' from
/home/edu/Desktop/rails_proyects/fulbo/config/environment.rb:5:in
`<top (required)>' from
/home/edu/Desktop/rails_proyects/fulbo/config.ru:3:in `block in
<main>' from
/home/edu/.rvm/gems/ruby-1.9.3-p392#fulbo/gems/rack-1.4.5/lib/rack/builder.rb:51:in
`instance_eval' from
/home/edu/.rvm/gems/ruby-1.9.3-p392#fulbo/gems/rack-1.4.5/lib/rack/builder.rb:51:in
`initialize' from /home/edu/Desktop/rails_proyects/fulbo/config.ru:in
`new' from /home/edu/Desktop/rails_proyects/fulbo/config.ru:in
`<main>' from
/home/edu/.rvm/gems/ruby-1.9.3-p392#fulbo/gems/rack-1.4.5/lib/rack/builder.rb:40:in
`eval' from
/home/edu/.rvm/gems/ruby-1.9.3-p392#fulbo/gems/rack-1.4.5/lib/rack/builder.rb:40:in
`parse_file' from
/home/edu/.rvm/gems/ruby-1.9.3-p392#fulbo/gems/rack-1.4.5/lib/rack/server.rb:200:in
`app' from
/home/edu/.rvm/gems/ruby-1.9.3-p392#fulbo/gems/railties-3.2.13/lib/rails/commands/server.rb:46:in `app' from
/home/edu/.rvm/gems/ruby-1.9.3-p392#fulbo/gems/rack-1.4.5/lib/rack/server.rb:304:in
`wrapped_app' from
/home/edu/.rvm/gems/ruby-1.9.3-p392#fulbo/gems/rack-1.4.5/lib/rack/server.rb:254:in
`start' from
/home/edu/.rvm/gems/ruby-1.9.3-p392#fulbo/gems/railties-3.2.13/lib/rails/commands/server.rb:70:in `start' from
/home/edu/.rvm/gems/ruby-1.9.3-p392#fulbo/gems/railties-3.2.13/lib/rails/commands.rb:55:in
`block in <top (required)>' from
/home/edu/.rvm/gems/ruby-1.9.3-p392#fulbo/gems/railties-3.2.13/lib/rails/commands.rb:50:in
`tap' from
/home/edu/.rvm/gems/ruby-1.9.3-p392#fulbo/gems/railties-3.2.13/lib/rails/commands.rb:50:in
`<top (required)>' from script/rails:6:in `require' from
script/rails:6:in `<main>'
someone knows how to fix it or what's wrong.

The problem you are encountering is - ActiveAdmin is trying to generate resource on users, but model for users doesn't exist. Therefore, you will have to create a model User before you generate active_admin resource on User.
Do it as follows:
rm app/admin/users.rb
rails generate model User username: string email: string
bundle exec rake db:migrate
#this should be successful
rails generate active_admin:resource User
rails server
Let me know, if it helps you out. Comment with the errors you encounter.
Good luck

Related

How to fix Circular dependency detected while autoloading constant error in 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.

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

Error shows up in server when using private_pub gem

I've been trying to use the private_pub gem for real-time updates in sample app so I can learn it and use it on the app I'm working on . But it always throws the following error when I type
rails s
shyam#shyam-SATELLITE-C50-B:~/Ajaxtry$ rails s
=> Booting Thin
=> Rails 4.2.2 application starting in development on
http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Exiting
/home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/private_pub-1.0.3/lib/private_pub.rb:21:in `load_config': uninitialized constant YAML (NameError)
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/private_pub-1.0.3/lib/private_pub/engine.rb:8:in `block in <class:Engine>'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/initializable.rb:30:in `instance_exec'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/initializable.rb:30:in `run'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `each'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `call'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/initializable.rb:54:in `run_initializers'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/application.rb:352:in `initialize!'
from /home/shyam/Ajaxtry/config/environment.rb:5:in `<top (required)>'
from /home/shyam/Ajaxtry/config.ru:3:in `require'
from /home/shyam/Ajaxtry/config.ru:3:in `block in <main>'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `instance_eval'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `initialize'
from /home/shyam/Ajaxtry/config.ru:in `new'
from /home/shyam/Ajaxtry/config.ru:in `<main>'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `eval'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `new_from_string'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:40:in `parse_file'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:299:in `build_app_and_options_from_config'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:208:in `app'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/commands/server.rb:61:in `app'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:336:in `wrapped_app'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/commands/server.rb:139:in `log_to_stdout'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/commands/server.rb:78:in `start'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:80:in `block in server'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:75:in `server'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/commands.rb:17:in `<top (required)>'
from /home/shyam/Ajaxtry/bin/rails:9:in `require'
from /home/shyam/Ajaxtry/bin/rails:9:in `<top (required)>'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.5.0/lib/spring/client/rails.rb:28:in `load'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.5.0/lib/spring/client/rails.rb:28:in `call'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.5.0/lib/spring/client/command.rb:7:in `call'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.5.0/lib/spring/client.rb:28:in `run'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.5.0/bin/spring:49:in `<top (required)>'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.5.0/lib/spring/binstub.rb:11:in `load'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.5.0/lib/spring/binstub.rb:11:in `<top (required)>'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /home/shyam/.rbenv/versions/2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /home/shyam/Ajaxtry/bin/spring:13:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
The thin server seems to be working fine. Would appreciate any help .
I'm using ruby -v 2.2.2p95 and rails 4.2.2
UPDATE:
I do not think that it is with either the private_pub gem or the Sync gem(I tried using Sync just to make sure). Its still showing the same error. Since it says YAML is an uninitialized constant, i checked the function storing the YAML load and it looks like the following:
#.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sync-0.3.5/lib/sync.rb
def load_config(filename, environment)
reset_config
yaml = YAML.load(ERB.new(File.read(filename)).result)[environment.to_s]
raise ArgumentError, "The #{environment} environment does not exist in #{filename}" if yaml.nil?
yaml.each{|key, value| config[key.to_sym] = value }
setup_logger
if adapter
setup_client
else
setup_dummy_client
end
end
Why doesn't ruby recognize that YAML?
Private Pub does not work with Rails 4. It has been forked to this gem:
https://github.com/gregmolnar/chatter
See this thread and comment: https://github.com/ryanb/private_pub/issues/83#issuecomment-23869164

Gem errors when upgrading rails app from 3 to 4, unable to run rails s

I inherited a rails app that I believe was written in rails 3. I am now running rails 4.2.3. When I try to run the app locally (rails s) I get a host of errors related to active record and initializers. I have searched for these errors individually, but nothing I have done so far has worked.
I have added the protected attributes gem as mentioned here https://github.com/rails/protected_attributes/issues/5
I upgraded the gem file to use rails 4
I have upgraded the gems using bundle upgrade. No luck.
I have sent a message to the original dev and he has no idea why this is happening.
What do I need to do in order to make this app run locally without errors?
This is the errors I get when running rails s in terminal:
Astrids-MacBook-Air% rails s
=> Booting WEBrick
=> Rails 4.2.3 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
config.eager_load is set to nil. Please update your config/environments/*.rb files accordingly:
* development - set it to false
* test - set it to false (unless you use a tool that preloads your test environment)
* production - set it to true
Exiting
/Users/Astrid/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.3/lib/active_record/dynamic_matchers.rb:26:in `method_missing': undefined method `auto_explain_threshold_in_seconds=' for ActiveRecord::Base:Class (NoMethodError)
from /Users/Astrid/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.3/lib/active_record/railtie.rb:108:in `block (3 levels) in <class:Railtie>'
from /Users/Astrid/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.3/lib/active_record/railtie.rb:107:in `each'
from /Users/Astrid/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.3/lib/active_record/railtie.rb:107:in `block (2 levels) in <class:Railtie>'
from /Users/Astrid/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.3/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
from /Users/Astrid/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.3/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
from /Users/Astrid/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.3/lib/active_support/lazy_load_hooks.rb:28:in `block in on_load'
from /Users/Astrid/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.3/lib/active_support/lazy_load_hooks.rb:27:in `each'
from /Users/Astrid/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.3/lib/active_support/lazy_load_hooks.rb:27:in `on_load'
from /Users/Astrid/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.3/lib/active_record/railtie.rb:106:in `block in <class:Railtie>'
from /Users/Astrid/.rvm/gems/ruby-2.2.1/gems/railties-4.2.3/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/Astrid/.rvm/gems/ruby-2.2.1/gems/railties-4.2.3/lib/rails/initializable.rb:30:in `run'
from /Users/Astrid/.rvm/gems/ruby-2.2.1/gems/railties-4.2.3/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/Astrid/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
from /Users/Astrid/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /Users/Astrid/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
from /Users/Astrid/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /Users/Astrid/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:345:in `each'
from /Users/Astrid/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:345:in `call'
from /Users/Astrid/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
from /Users/Astrid/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
from /Users/Astrid/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
from /Users/Astrid/.rvm/gems/ruby-2.2.1/gems/railties-4.2.3/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/Astrid/.rvm/gems/ruby-2.2.1/gems/railties-4.2.3/lib/rails/application.rb:352:in `initialize!'
from /Users/Astrid/.rvm/gems/ruby-2.2.1/gems/railties-4.2.3/lib/rails/railtie.rb:194:in `public_send'
from /Users/Astrid/.rvm/gems/ruby-2.2.1/gems/railties-4.2.3/lib/rails/railtie.rb:194:in `method_missing'
from /Users/Astrid/Documents/Development/Handled/ticketsnap_server/config/environment.rb:5:in `<top (required)>'
from /Users/Astrid/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:274:in `require'
from /Users/Astrid/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:274:in `block in require'
from /Users/Astrid/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:240:in `load_dependency'
from /Users/Astrid/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:274:in `require'
from /Users/Astrid/Documents/Development/Handled/ticketsnap_server/config.ru:3:in `block in <main>'
from /Users/Astrid/.rvm/gems/ruby-2.2.1/gems/rack-1.6.4/lib/rack/builder.rb:55:in `instance_eval'
from /Users/Astrid/.rvm/gems/ruby-2.2.1/gems/rack-1.6.4/lib/rack/builder.rb:55:in `initialize'
from /Users/Astrid/Documents/Development/Handled/ticketsnap_server/config.ru:in `new'
from /Users/Astrid/Documents/Development/Handled/ticketsnap_server/config.ru:in `<main>'
from /Users/Astrid/.rvm/gems/ruby-2.2.1/gems/rack-1.6.4/lib/rack/builder.rb:49:in `eval'
from /Users/Astrid/.rvm/gems/ruby-2.2.1/gems/rack-1.6.4/lib/rack/builder.rb:49:in `new_from_string'
from /Users/Astrid/.rvm/gems/ruby-2.2.1/gems/rack-1.6.4/lib/rack/builder.rb:40:in `parse_file'
from /Users/Astrid/.rvm/gems/ruby-2.2.1/gems/rack-1.6.4/lib/rack/server.rb:299:in `build_app_and_options_from_config'
from /Users/Astrid/.rvm/gems/ruby-2.2.1/gems/rack-1.6.4/lib/rack/server.rb:208:in `app'
from /Users/Astrid/.rvm/gems/ruby-2.2.1/gems/railties-4.2.3/lib/rails/commands/server.rb:61:in `app'
from /Users/Astrid/.rvm/gems/ruby-2.2.1/gems/rack-1.6.4/lib/rack/server.rb:336:in `wrapped_app'
from /Users/Astrid/.rvm/gems/ruby-2.2.1/gems/railties-4.2.3/lib/rails/commands/server.rb:139:in `log_to_stdout'
from /Users/Astrid/.rvm/gems/ruby-2.2.1/gems/railties-4.2.3/lib/rails/commands/server.rb:78:in `start'
from /Users/Astrid/.rvm/gems/ruby-2.2.1/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:80:in `block in server'
from /Users/Astrid/.rvm/gems/ruby-2.2.1/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /Users/Astrid/.rvm/gems/ruby-2.2.1/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:75:in `server'
from /Users/Astrid/.rvm/gems/ruby-2.2.1/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /Users/Astrid/.rvm/gems/ruby-2.2.1/gems/railties-4.2.3/lib/rails/commands.rb:17:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Remove auto_explain_threshold_in_seconds as said on release notes.

Unable to start WEBrick with Rails 3.2.6

I update my Rails version 3.2.3 to 3.2.6. After running the server getting following error:
=> 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
/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.6/lib/active_record/dynamic_matchers.rb:50:in `method_missing': undefined method `instance' for #<Class:0x9844050> (NoMethodError)
from /usr/local/lib/ruby/gems/1.9.1/gems/activemodel-3.2.6/lib/active_model/observing.rb:86:in `instantiate_observer'
from /usr/local/lib/ruby/gems/1.9.1/gems/activemodel-3.2.6/lib/active_model/observing.rb:59:in `block in instantiate_observers'
from /usr/local/lib/ruby/gems/1.9.1/gems/activemodel-3.2.6/lib/active_model/observing.rb:59:in `each'
from /usr/local/lib/ruby/gems/1.9.1/gems/activemodel-3.2.6/lib/active_model/observing.rb:59:in `instantiate_observers'
from /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.6/lib/active_record/railtie.rb:117:in `block (2 levels) in <class:Railtie>'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:26:in `block in on_load'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:25:in `each'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:25:in `on_load'
from /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.6/lib/active_record/railtie.rb:116:in `block in <class:Railtie>'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:34:in `call'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:34:in `execute_hook'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:43:in `block in run_load_hooks'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:42:in `each'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/application/finisher.rb:59:in `block in <module:Finisher>'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/initializable.rb:30:in `instance_exec'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/initializable.rb:30:in `run'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/initializable.rb:55:in `block in run_initializers'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/initializable.rb:54:in `each'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/initializable.rb:54:in `run_initializers'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/application.rb:136:in `initialize!'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /home/prasanna/Projects/Petcare/config/environment.rb:5:in `<top (required)>'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in `require'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in `block in require'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:236:in `load_dependency'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in `require'
from /home/prasanna/Projects/Petcare/config.ru:4:in `block in <main>'
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval'
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize'
from /home/prasanna/Projects/Petcare/config.ru:1:in `new'
from /home/prasanna/Projects/Petcare/config.ru:1:in `<main>'
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:40:in `eval'
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:40:in `parse_file'
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:200:in `app'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/commands/server.rb:46:in `app'
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:301:in `wrapped_app'
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:252:in `start'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/commands/server.rb:70:in `start'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/commands.rb:55:in `block in <top (required)>'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/commands.rb:50:in `tap'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
environment.rb
# Load the rails application
require File.expand_path('../application', __FILE__)
# Initialize the rails application
Petcare::Application.initialize!
This is because Rails 3.x has problem with Ruby 1.9.1. Try updating your Ruby to 1.9.3.
Source: http://guides.rubyonrails.org/getting_started.html
Do you have any observers? If so make sure that they inherit from ActiveModel::Observer. If they are custom classes, make sure they include Singleton module.

Resources