I'm trying to connect my sidekiq to a twemproxy instead of a direct Redis connection, but I'm getting the following error:
2013-09-30T17:16:53Z 23329 TID-3q3o4 INFO: Booting Sidekiq 2.12.1 using redis://localhost:22121 with options {}
2013-09-30T17:16:53Z 23329 TID-3q3o4 INFO: Running in ruby 1.9.3p448 (2013-06-27 revision 41675) [x86_64-linux]
2013-09-30T17:16:53Z 23329 TID-3q3o4 INFO: See LICENSE and the LGPL-3.0 for licensing details.
Connection lost (ECONNRESET)
/mnt/-production/shared/bundle/ruby/1.9.1/gems/redis-3.0.4/lib/redis/client.rb:210:in `rescue in io'
/mnt/-production/shared/bundle/ruby/1.9.1/gems/redis-3.0.4/lib/redis/client.rb:206:in `io'
/mnt/-production/shared/bundle/ruby/1.9.1/gems/redis-3.0.4/lib/redis/client.rb:214:in `read'
/mnt/-production/shared/bundle/ruby/1.9.1/gems/redis-3.0.4/lib/redis/client.rb:84:in `block in call'
/mnt/-production/shared/bundle/ruby/1.9.1/gems/redis-3.0.4/lib/redis/client.rb:187:in `block (2 levels) in process'
/mnt/-production/shared/bundle/ruby/1.9.1/gems/redis-3.0.4/lib/redis/client.rb:295:in `ensure_connected'
/mnt/-production/shared/bundle/ruby/1.9.1/gems/redis-3.0.4/lib/redis/client.rb:177:in `block in process'
/mnt/-production/shared/bundle/ruby/1.9.1/gems/redis-3.0.4/lib/redis/client.rb:256:in `logging'
/mnt/-production/shared/bundle/ruby/1.9.1/gems/redis-3.0.4/lib/redis/client.rb:176:in `process'
/mnt/-production/shared/bundle/ruby/1.9.1/gems/redis-3.0.4/lib/redis/client.rb:84:in `call'
/mnt/-production/shared/bundle/ruby/1.9.1/gems/redis-3.0.4/lib/redis.rb:410:in `block in keys'
/mnt/-production/shared/bundle/ruby/1.9.1/gems/redis-3.0.4/lib/redis.rb:36:in `block in synchronize'
/usr/local/rubies/1.9.3-p448/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/mnt/-production/shared/bundle/ruby/1.9.1/gems/redis-3.0.4/lib/redis.rb:36:in `synchronize'
/mnt/-production/shared/bundle/ruby/1.9.1/gems/redis-3.0.4/lib/redis.rb:409:in `keys'
/mnt/-production/shared/bundle/ruby/1.9.1/gems/sidekiq-2.12.1/lib/sidekiq/api.rb:71:in `block in cleanup'
/mnt/-production/shared/bundle/ruby/1.9.1/gems/connection_pool-1.1.0/lib/connection_pool.rb:49:in `with'
/mnt/-production/shared/bundle/ruby/1.9.1/gems/sidekiq-2.12.1/lib/sidekiq.rb:67:in `redis'
/mnt/-production/shared/bundle/ruby/1.9.1/gems/sidekiq-2.12.1/lib/sidekiq/api.rb:70:in `cleanup'
/mnt/-production/shared/bundle/ruby/1.9.1/gems/sidekiq-2.12.1/lib/sidekiq/cli.rb:55:in `run'
/mnt/-production/shared/bundle/ruby/1.9.1/gems/sidekiq-2.12.1/bin/sidekiq:8:in `<top (required)>'
/mnt/-production/shared/bundle/ruby/1.9.1/bin/sidekiq:23:in `load'
/mnt/-production/shared/bundle/ruby/1.9.1/bin/sidekiq:23:in `<main>'
It seems that I'm loosing the connection, but I could not identify what is the root cause. Do you know if it is compatible to try this kind of connection?
The latest version of sidekiq (by the time 2.14.1) is able to connect to twemproxy instead of a redis server.
But due to the use of brpop command, it is not compatible.
Related
I am trying to run msfdb but I can't seem to do so because I get a LoadError and 2 ThreadErrors. Here is the full stack:
/usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in `require': cannot load such file -- net/smtp (LoadError)
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in `require'
from /usr/share/metasploit-framework/lib/rex/proto/sms/model.rb:29:in `<top (required)>'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:27:in `require'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:27:in `require'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader/helpers.rb:95:in `const_get'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader/helpers.rb:95:in `cget'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader.rb:237:in `block (2 levels) in eager_load'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader/helpers.rb:26:in `block in ls'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader/helpers.rb:18:in `each_child'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader/helpers.rb:18:in `ls'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader.rb:232:in `block in eager_load'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader.rb:217:in `synchronize'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader.rb:217:in `eager_load'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader.rb:317:in `each'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader.rb:317:in `eager_load_all'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/railties-6.1.5/lib/rails/application/finisher.rb:133:in `block in <module:Finisher>'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/railties-6.1.5/lib/rails/initializable.rb:32:in `instance_exec'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/railties-6.1.5/lib/rails/initializable.rb:32:in `run'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/railties-6.1.5/lib/rails/initializable.rb:61:in `block in run_initializers'
from /home/johnmap007/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/tsort.rb:228:in `block in tsort_each'
from /home/johnmap007/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
from /home/johnmap007/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/tsort.rb:431:in `each_strongly_connected_component_from'
from /home/johnmap007/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/tsort.rb:349:in `block in each_strongly_connected_component'
from /home/johnmap007/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/tsort.rb:347:in `each'
from /home/johnmap007/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/tsort.rb:347:in `call'
from /home/johnmap007/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/tsort.rb:347:in `each_strongly_connected_component'
from /home/johnmap007/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/tsort.rb:226:in `tsort_each'
from /home/johnmap007/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/tsort.rb:205:in `tsort_each'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/railties-6.1.5/lib/rails/initializable.rb:60:in `run_initializers'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/railties-6.1.5/lib/rails/application.rb:391:in `initialize!'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/railties-6.1.5/lib/rails/railtie.rb:207:in `public_send'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/railties-6.1.5/lib/rails/railtie.rb:207:in `method_missing'
from /usr/share/metasploit-framework/config/environment.rb:4:in `<top (required)>'
from /usr/share/metasploit-framework/lib/msfenv.rb:17:in `require'
from /usr/share/metasploit-framework/lib/msfenv.rb:17:in `<top (required)>'
from /usr/bin/msfconsole:18:in `require'
from /usr/bin/msfconsole:18:in `<main>'
/usr/bin/msfconsole: warning: Exception in finalizer #<Proc:0x00007f4a9fb4fc80 /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/ruby_thread_local_var.rb:85>
/usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/logging-2.3.0/lib/logging/diagnostic_context.rb:471:in `new': can't alloc thread (ThreadError)
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/logging-2.3.0/lib/logging/diagnostic_context.rb:471:in `create_with_logging_context'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/logging-2.3.0/lib/logging/diagnostic_context.rb:436:in `new'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/ruby_thread_local_var.rb:86:in `block in threadlocal_finalizer'
/usr/bin/msfconsole: warning: Exception in finalizer #<Proc:0x00007f4a9fb4fde8 /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/ruby_thread_local_var.rb:85>
/usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/logging-2.3.0/lib/logging/diagnostic_context.rb:471:in `new': can't alloc thread (ThreadError)
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/logging-2.3.0/lib/logging/diagnostic_context.rb:471:in `create_with_logging_context'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/logging-2.3.0/lib/logging/diagnostic_context.rb:436:in `new'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/ruby_thread_local_var.rb:86:in `block in threadlocal_finalizer'
Side Note: From what I understand, the 2 ThreadErrors that were thrown were because I have insufficient memory? I have 16GB total though, that should be enough.
Before this, I was unable to install certain dependencies because of some weird reason but I installed Oracle Instant Client, which allowed me to install ruby-oci8, which then let me continue with the rest of the dependency installation. I reran bundle install for that and that fixed most of it (I had to manually install certain gems with gem install <gem> but reran bundle install to make sure I had everything at the end). Now I'm getting these weird LoadErrors and ThreadErrors. One thing to note is that I'm executing msfdb run and msfconsole as root (It's necessary for msfdb run because it won't let me run it as a normal user), but when I run msfconsole as a normal user, metasploit loads as expected without any errors. Can someone please help me fix this?
Starting with Ruby 3.1, net-smtp is a bundled gem.
Probably, you just need to add
gem 'net-smtp'
to your Gemfile.
I try to migrate diaspora from a damaged debian 8 to another gentoo. I want to be able to can run diaspora before I deploy the web server. I crashes because of Ruby Errors, maybe kind of PATH errors.
When I run diaspora with script/server in production mode it crashes because the thing behind web.pid crashes. In the log eye_processes_stderr.log is:
bin/bundle:3:in `load': cannot load such file -- /usr/lib/ruby/bin/bundle (LoadError)
from bin/bundle:3:in `<main>'
In development mode I can not execute correctly (I tried it to get better error message reporting):
RAILS_ENV=development bin/rake db:migrate RAILS_ENV=development
bin/rake assets:precompile
because of the stdout and stderr of script/server I run: bin/bundle exec unicorn -c config/unicorn.rb
In production mode it returns:
that I shall look into stderr
and in the log there is nothing helpful, in:
tail log/eye_processes_stderr.log:
bin/bundle:3:in `load': cannot load such file -- /usr/lib/ruby/bin/bundle (LoadError)
from bin/bundle:3:in `<main>' bin/bundle:3:in `load': cannot load such file -- /usr/lib/ruby/bin/bundle (LoadError)
from bin/bundle:3:in `<main>'
But in development mode it returns:
I, [2019-10-07T11:14:20.840060 #20262] INFO -- : Refreshing Gem list
/home/diaspora/diaspora-2017-07-07-newest/config/environments/development.rb:64:in `block in <top (required)>': uninitialized constant TurboDevAssets (NameError)
from /home/diaspora/diaspora-2017-07-07-newest/vendor/bundle/ruby/2.4.0/gems/railties-5.1.6.2/lib/rails/railtie.rb:211:in `instance_eval'
from /home/diaspora/diaspora-2017-07-07-newest/vendor/bundle/ruby/2.4.0/gems/railties-5.1.6.2/lib/rails/railtie.rb:211:in `configure'
from /home/diaspora/diaspora-2017-07-07-newest/config/environments/development.rb:3:in `<top (required)>'
from /home/diaspora/diaspora-2017-07-07-newest/vendor/bundle/ruby/2.4.0/gems/railties-5.1.6.2/lib/rails/engine.rb:600:in `block (2 levels) in <class:Engine>'
from /home/diaspora/diaspora-2017-07-07-newest/vendor/bundle/ruby/2.4.0/gems/railties-5.1.6.2/lib/rails/engine.rb:599:in `each'
from /home/diaspora/diaspora-2017-07-07-newest/vendor/bundle/ruby/2.4.0/gems/railties-5.1.6.2/lib/rails/engine.rb:599:in `block in <class:Engine>'
from /home/diaspora/diaspora-2017-07-07-newest/vendor/bundle/ruby/2.4.0/gems/railties-5.1.6.2/lib/rails/initializable.rb:30:in `instance_exec'
from /home/diaspora/diaspora-2017-07-07-newest/vendor/bundle/ruby/2.4.0/gems/railties-5.1.6.2/lib/rails/initializable.rb:30:in `run'
from /home/diaspora/diaspora-2017-07-07-newest/vendor/bundle/ruby/2.4.0/gems/railties-5.1.6.2/lib/rails/initializable.rb:59:in `block in run_initializers'
from /usr/lib/ruby/2.4.0/tsort.rb:228:in `block in tsort_each'
from /usr/lib/ruby/2.4.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
from /usr/lib/ruby/2.4.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
from /usr/lib/ruby/2.4.0/tsort.rb:431:in `each_strongly_connected_component_from'
from /usr/lib/ruby/2.4.0/tsort.rb:421:in `block in each_strongly_connected_component_from'
from /home/diaspora/diaspora-2017-07-07-newest/vendor/bundle/ruby/2.4.0/gems/railties-5.1.6.2/lib/rails/initializable.rb:48:in `each'
from /home/diaspora/diaspora-2017-07-07-newest/vendor/bundle/ruby/2.4.0/gems/railties-5.1.6.2/lib/rails/initializable.rb:48:in `tsort_each_child'
from /usr/lib/ruby/2.4.0/tsort.rb:415:in `call'
from /usr/lib/ruby/2.4.0/tsort.rb:415:in `each_strongly_connected_component_from'
from /usr/lib/ruby/2.4.0/tsort.rb:349:in `block in each_strongly_connected_component'
from /usr/lib/ruby/2.4.0/tsort.rb:347:in `each'
from /usr/lib/ruby/2.4.0/tsort.rb:347:in `call'
from /usr/lib/ruby/2.4.0/tsort.rb:347:in `each_strongly_connected_component'
from /usr/lib/ruby/2.4.0/tsort.rb:226:in `tsort_each'
from /usr/lib/ruby/2.4.0/tsort.rb:205:in `tsort_each'
from /home/diaspora/diaspora-2017-07-07-newest/vendor/bundle/ruby/2.4.0/gems/railties-5.1.6.2/lib/rails/initializable.rb:58:in `run_initializers'
from /home/diaspora/diaspora-2017-07-07-newest/vendor/bundle/ruby/2.4.0/gems/railties-5.1.6.2/lib/rails/application.rb:353:in `initialize!'
from /home/diaspora/diaspora-2017-07-07-newest/config/environment.rb:7:in `<top (required)>'
from config.ru:10:in `require'
from config.ru:10:in `block in <main>'
from /home/diaspora/diaspora-2017-07-07-newest/vendor/bundle/ruby/2.4.0/gems/rack-2.0.6/lib/rack/builder.rb:55:in `instance_eval'
from /home/diaspora/diaspora-2017-07-07-newest/vendor/bundle/ruby/2.4.0/gems/rack-2.0.6/lib/rack/builder.rb:55:in `initialize'
from config.ru:1:in `new'
from config.ru:1:in `<main>'
from /home/diaspora/diaspora-2017-07-07-newest/vendor/bundle/ruby/2.4.0/gems/unicorn-5.5.0/lib/unicorn.rb:54:in `eval'
from /home/diaspora/diaspora-2017-07-07-newest/vendor/bundle/ruby/2.4.0/gems/unicorn-5.5.0/lib/unicorn.rb:54:in `block in builder'
from /home/diaspora/diaspora-2017-07-07-newest/vendor/bundle/ruby/2.4.0/gems/unicorn-5.5.0/lib/unicorn/http_server.rb:794:in `build_app!'
from /home/diaspora/diaspora-2017-07-07-newest/vendor/bundle/ruby/2.4.0/gems/unicorn-5.5.0/lib/unicorn/http_server.rb:141:in `start'
from /home/diaspora/diaspora-2017-07-07-newest/vendor/bundle/ruby/2.4.0/gems/unicorn-5.5.0/bin/unicorn:128:in `<top (required)>'
from /home/diaspora/diaspora-2017-07-07-newest/vendor/bundle/ruby/2.4.0/bin/unicorn:23:in `load'
from /home/diaspora/diaspora-2017-07-07-newest/vendor/bundle/ruby/2.4.0/bin/unicorn:23:in `<main>'
and now it returns that also in production mode, after I executed it in development mode.
line 64 in
/home/diaspora/diaspora-2017-07-07-newest/config/environments/development.rb
is:
# Speed up asset serving
config.middleware.insert 0, TurboDevAssets
It shall run as it did with every working diaspora as it has worked on debian 8 when I used rvm in the home directory. (as I also tried that on the Gentoo machine)
The problem is that the server will not start.
I have set up the following:
Windows 10 build 1607 (Anniversary edition)
Windows subsystem for Linux
GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu)
Ubuntu 14.04.5 LTS \n \l
Rails ver 5.0.0.1
Ruby ver 2.3.1 (using - rbenv)
MySQL 5.5.53
I am very new to Linux and Ruby / Rails so please forgive me if I use incorrect terminology.
After a few days of installing, configuring and debugging, I was able to get everything working (Linux shell, rails, ruby mysql etc.).
I began a tutorial at Lynda called "Ruby on Rails 5 Essential Training" and was able to do the following:
Create a new rails project called Simple CMS
Create MySQL databases for development and test
Create users in MySQL
** When it came time to start the web server (Puma via the 'rails server' command) I received pages of errors as shown. I've searched every stackoverflow, google, Microsoft and GitHub result that had anything to do with "Failed to watch" and the above noted configuration. There were no solutions and the latest result stated that it was not possible to run the server because of the way Windows works.
Before scrapping my installation I wanted to ask here if anyone had run across this and/or had a solution.
Thank you very much in advance for any help and for taking the time to read this.
Mike
Here is the error including the command I used to initiate it:(Sorry its huge)
mike#MIKES-PC:~/sites/simple_cms$ rails server
=> 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/mike/.rbenv/versions/2.3.1/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/mike/.rbenv/versions/2.3.1/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/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rb-inotify-0.9.7/lib/rb-inotify/notifier.rb:190:in `new'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rb-inotify-0.9.7/lib/rb-inotify/notifier.rb:190:in `watch'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rb-inotify-0.9.7/lib/rb-inotify/notifier.rb:204:in `watch'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/adapter/linux.rb:32:in `_configure'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/adapter/base.rb:45:in `block in configure'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/adapter/base.rb:40:in `each'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/adapter/base.rb:40:in `configure'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/adapter/base.rb:63:in `start'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/backend.rb:28:in `start'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/listener.rb:67:in `block in <class:Listener>'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/fsm.rb:120:in `instance_eval'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/fsm.rb:120:in `call'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/fsm.rb:91:in `transition_with_callbacks!'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/fsm.rb:57:in `transition' from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/listener.rb:90:in `start' from /home/mike/.rbenv/versions/2.3.1/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/mike/.rbenv/versions/2.3.1/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/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/i18n_railtie.rb:59:in `new'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/i18n_railtie.rb:59:in `initialize_i18n'
from /home/mike/.rbenv/versions/2.3.1/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/mike/.rbenv/versions/2.3.1/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/mike/.rbenv/versions/2.3.1/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/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/lazy_load_hooks.rb:44:in `each'
from /home/mike/.rbenv/versions/2.3.1/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/mike/.rbenv/versions/2.3.1/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/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:30:in `instance_exec'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:30:in `run'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:347:in `each'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:347:in `call'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:54:in `run_initializers'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/application.rb:352:in `initialize!'
from /home/mike/sites/simple_cms/config/environment.rb:5:in `<top (required)>'
from /home/mike/sites/simple_cms/config.ru:3:in `require_relative'
from /home/mike/sites/simple_cms/config.ru:3:in `block in <main>'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:55:in `instance_eval'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:55:in `initialize' from /home/mike/sites/simple_cms/config.ru:in `new'
from /home/mike/sites/simple_cms/config.ru:in `<main>'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:49:in `eval'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:49:in `new_from_string'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:40:in `parse_file' from /home/mike/.rbenv/versions/2.3.1/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/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/server.rb:218:in `app'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/server.rb:59:in `app'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/server.rb:353:in `wrapped_app'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/server.rb:124:in `log_to_stdout'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/server.rb:77:in `start'
from /home/mike/.rbenv/versions/2.3.1/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/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:85:in `tap'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:85:in `server'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands.rb:18:in `<top (required)>'
from /home/mike/sites/simple_cms/bin/rails:9:in `require'
from /home/mike/sites/simple_cms/bin/rails:9:in `<top (required)>'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-2.0.0/lib/spring/client/rails.rb:28:in `load'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-2.0.0/lib/spring/client/rails.rb:28:in `call'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-2.0.0/lib/spring/client/command.rb:7:in `call'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-2.0.0/lib/spring/client.rb:30:in `run'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-2.0.0/bin/spring:49:in `<top (required)>'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-2.0.0/lib/spring/binstub.rb:31:in `load'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-2.0.0/lib/spring/binstub.rb:31:in `<top (required)>'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /home/mike/sites/simple_cms/bin/spring:14:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
Found a solution in #jwsloan's comment on this Github issue:
When creating a new rails app, use --skip-listen to avoid problems with inotify, like so:
rails new myproject --skip-listen
That should allow the server to start - worked for me! :)
Blockquote
When i try to run bin/rails server,my server wont start up it will just display some connection errors or whatever.I tried bundle exec rails server but it didnt work either.
Warning: You're using Rubygems 2.0.14 with Spring. Upgrade to at least Rubygems 2.1.0 and run `gem pristine --all` for better startup performance.
=> Booting WEBrick
=> Rails 4.2.1 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Exiting
/Users/i/blog/config/routes.rb:7:in `<top (required)>': undefined method `resources' for main:Object (NoMethodError)
from /Library/Ruby/Gems/2.0.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `load'
from /Library/Ruby/Gems/2.0.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `block in load'
from /Library/Ruby/Gems/2.0.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_dependency'
from /Library/Ruby/Gems/2.0.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `load'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.1/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.1/lib/rails/application/routes_reloader.rb:40:in `each'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.1/lib/rails/application/routes_reloader.rb:40:in `load_paths'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.1/lib/rails/application/routes_reloader.rb:16:in `reload!'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.1/lib/rails/application/routes_reloader.rb:26:in `block in updater'
from /Library/Ruby/Gems/2.0.0/gems/activesupport-4.2.1/lib/active_support/file_update_checker.rb:75:in `call'
from /Library/Ruby/Gems/2.0.0/gems/activesupport-4.2.1/lib/active_support/file_update_checker.rb:75:in `execute'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.1/lib/rails/application/routes_reloader.rb:27:in `updater'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.1/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.1/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `instance_exec'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `run'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.1/lib/rails/initializable.rb:55:in `block in run_initializers'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tsort.rb:180:in `each'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.1/lib/rails/initializable.rb:54:in `run_initializers'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.1/lib/rails/application.rb:352:in `initialize!'
from /Users/i/blog/config/environment.rb:5:in `<top (required)>'
from /Users/i/blog/config.ru:3:in `require'
from /Users/i/blog/config.ru:3:in `block in <main>'
from /Library/Ruby/Gems/2.0.0/gems/rack-1.6.0/lib/rack/builder.rb:55:in `instance_eval'
from /Library/Ruby/Gems/2.0.0/gems/rack-1.6.0/lib/rack/builder.rb:55:in `initialize'
from /Users/i/blog/config.ru:in `new'
from /Users/i/blog/config.ru:in `<main>'
from /Library/Ruby/Gems/2.0.0/gems/rack-1.6.0/lib/rack/builder.rb:49:in `eval'
from /Library/Ruby/Gems/2.0.0/gems/rack-1.6.0/lib/rack/builder.rb:49:in `new_from_string'
from /Library/Ruby/Gems/2.0.0/gems/rack-1.6.0/lib/rack/builder.rb:40:in `parse_file'
from /Library/Ruby/Gems/2.0.0/gems/rack-1.6.0/lib/rack/server.rb:299:in `build_app_and_options_from_config'
from /Library/Ruby/Gems/2.0.0/gems/rack-1.6.0/lib/rack/server.rb:208:in `app'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.1/lib/rails/commands/server.rb:61:in `app'
from /Library/Ruby/Gems/2.0.0/gems/rack-1.6.0/lib/rack/server.rb:336:in `wrapped_app'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.1/lib/rails/commands/server.rb:139:in `log_to_stdout'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.1/lib/rails/commands/server.rb:78:in `start'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:80:in `block in server'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:in `server'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.1/lib/rails/commands.rb:17:in `<top (required)>'
from /Users/i/blog/bin/rails:8:in `require'
from /Users/i/blog/bin/rails:8:in `<top (required)>'
from /Library/Ruby/Gems/2.0.0/gems/spring-1.3.3/lib/spring/client/rails.rb:27:in `load'
from /Library/Ruby/Gems/2.0.0/gems/spring-1.3.3/lib/spring/client/rails.rb:27:in `call'
from /Library/Ruby/Gems/2.0.0/gems/spring-1.3.3/lib/spring/client/command.rb:7:in `call'
from /Library/Ruby/Gems/2.0.0/gems/spring-1.3.3/lib/spring/client.rb:26:in `run'
from /Library/Ruby/Gems/2.0.0/gems/spring-1.3.3/bin/spring:48:in `<top (required)>'
from /Library/Ruby/Gems/2.0.0/gems/spring-1.3.3/lib/spring/binstub.rb:11:in `load'
from /Library/Ruby/Gems/2.0.0/gems/spring-1.3.3/lib/spring/binstub.rb:11:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/i/blog/bin/spring:13:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
heres my config/routes file
Rails.application.routes.draw do
resources :articles
root 'welcome#index'
end
resources :articles do
resources :comments
end
You have to read stacktraces from the top to understand wat is going on:
Warning: You're using Rubygems 2.0.14 with Spring. Upgrade to at least Rubygems 2.1.0 and run `gem pristine --all` for better startup performance.
This is just a warning, you may want to fix that later. But you can ignore that at the moment, since it is just a warning.
=> Booting WEBrick
=> Rails 4.2.1 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
This is the default output when Rails boots.
But now the interesting part:
Exiting
/Users/i/blog/config/routes.rb:7:in `<top (required)>': undefined method `resources' for main:Object (NoMethodError)
This line tells you that you have a undefined method 'resources' in the 7th line (or before that line) of your config/routes.rb.
The problem is caused by the second resources :articles block that is not within the outer Rails.application.routes.draw block. Furthermore you have two resources :articles, but you only need one. Copy the following version to config/routes.rb to fix your issue:
Rails.application.routes.draw do
root 'welcome#index'
resources :articles do
resources :comments
end
end
I was tasked with upgrading the ruby installation on a machine the other day. I installed from source (typically ./configure, make, make install) and updated all gems. Currently, the site won't load with a Ruby Rack error, which I have no idea how to solve:
[ pid=21855 thr=104368260 file=utils.rb:176 time=2013-02-19 11:33:32.952 ]: *** Exception PhusionPassenger::UnknownError in PhusionPassenger::Rack::ApplicationSpawner (undefined method `<<' for nil:NilClass (NoMethodError)) (process 21855, thread #<Thread:0x0000000c711108>):
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-flash-0.1.2/lib/rack/flash.rb:20:in `run'
from config.ru:7:in `block in <main>'
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
from config.ru:1:in `new'
from config.ru:1:in `<main>'
from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/rack/application_spawner.rb:225:in `eval'
from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/rack/application_spawner.rb:225:in `load_rack_app'
from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/rack/application_spawner.rb:157:in `block in initialize_server'
from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/utils.rb:563:in `report_app_init_status'
from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/rack/application_spawner.rb:154:in `initialize_server'
from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb:204:in `start_synchronously'
from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb:180:in `start'
from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/rack/application_spawner.rb:129:in `start'
from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb:253:in `block (2 levels) in spawn_rack_application'
from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb:246:in `block in spawn_rack_application'
from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server_collection.rb:82:in `block in synchronize'
from <internal:prelude>:10:in `synchronize'
from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb:244:in `spawn_rack_application'
from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb:137:in `spawn_application'
from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
from /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/helper-scripts/passenger-spawn-server:99:in `<main>'
Have any of you seen this type of error before? Any thoughts on how to solve it?
I found my issue. When looking at the error, I noticed that the first module in the trace is rack-flash. Turns out that the new verison of it is incompatible with sinatra which this app is also using. I commented out the flash related code and the app runs.
Now I just need to figure out the proper way to port the flash related code to sinatra-flash and I think I'm good to go.