Ruby Passenger wont start - ruby

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.

Related

Unable to start msfconsole or msfdb due to LoadError and ThreadError

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.

undefined method `each_child' for #<Dir:0x00007fcc34ccf6e8> Did you mean? each_slice

Since I run flutter upgrade when I try to run my flutter app I get this error :
[!] An error occurred while processing the post-install hook of the Podfile
undefined method `each_child' for #<Dir:0x00007fcc34ccf6e8>
Did you mean? each_slice
/Users/youcefdahmani/Dev/flutter/packages/flutter_tools/bin/podhelper.rb:54:in `block in flutter_additional_ios_build_settings'
/Users/youcefdahmani/Dev/flutter/packages/flutter_tools/bin/podhelper.rb:51:in `each'
/Users/youcefdahmani/Dev/flutter/packages/flutter_tools/bin/podhelper.rb:51:in `flutter_additional_ios_build_settings'
/Users/youcefdahmani/Work/Projects/MyShop/my_shop_app/ios/Podfile:39:in `block (3 levels) in from_ruby'
/Users/youcefdahmani/Work/Projects/MyShop/my_shop_app/ios/Podfile:38:in `each'
/Users/youcefdahmani/Work/Projects/MyShop/my_shop_app/ios/Podfile:38:in `block (2 levels) in from_ruby'
/Users/youcefdahmani/.rbenv/versions/2.5.8/lib/ruby/gems/2.5.0/gems/cocoapods-core-1.10.1/lib/cocoapods-core/podfile.rb:179:in `post_install!'
/Users/youcefdahmani/.rbenv/versions/2.5.8/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:897:in `run_podfile_post_install_hook'
/Users/youcefdahmani/.rbenv/versions/2.5.8/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:885:in `block in run_podfile_post_install_hooks'
/Users/youcefdahmani/.rbenv/versions/2.5.8/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:145:in `message'
/Users/youcefdahmani/.rbenv/versions/2.5.8/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:884:in `run_podfile_post_install_hooks'
/Users/youcefdahmani/.rbenv/versions/2.5.8/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:329:in `block (2 levels) in create_and_save_projects'
/Users/youcefdahmani/.rbenv/versions/2.5.8/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/xcode/pods_project_generator/pods_project_writer.rb:61:in
`write!'
/Users/youcefdahmani/.rbenv/versions/2.5.8/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:328:in `block in create_and_save_projects'
/Users/youcefdahmani/.rbenv/versions/2.5.8/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section'
/Users/youcefdahmani/.rbenv/versions/2.5.8/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:307:in `create_and_save_projects'
/Users/youcefdahmani/.rbenv/versions/2.5.8/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:299:in `generate_pods_project'
/Users/youcefdahmani/.rbenv/versions/2.5.8/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:178:in `integrate'
/Users/youcefdahmani/.rbenv/versions/2.5.8/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:166:in `install!'
/Users/youcefdahmani/.rbenv/versions/2.5.8/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/command/install.rb:52:in `run'
/Users/youcefdahmani/.rbenv/versions/2.5.8/lib/ruby/gems/2.5.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Users/youcefdahmani/.rbenv/versions/2.5.8/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:52:in `run'
/Users/youcefdahmani/.rbenv/versions/2.5.8/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/bin/pod:55:in `<top (required)>'
/Users/youcefdahmani/.rbenv/versions/2.5.8/bin/pod:23:in `load'
/Users/youcefdahmani/.rbenv/versions/2.5.8/bin/pod:23:in `<main>'
/Users/youcefdahmani/.rbenv/versions/2.5.8/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:899:in `rescue in run_podfile_post_install_hook'
/Users/youcefdahmani/.rbenv/versions/2.5.8/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:896:in `run_podfile_post_install_hook'
/Users/youcefdahmani/.rbenv/versions/2.5.8/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:885:in `block in run_podfile_post_install_hooks'
/Users/youcefdahmani/.rbenv/versions/2.5.8/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:145:in `message'
/Users/youcefdahmani/.rbenv/versions/2.5.8/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:884:in `run_podfile_post_install_hooks'
/Users/youcefdahmani/.rbenv/versions/2.5.8/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:329:in `block (2 levels) in create_and_save_projects'
/Users/youcefdahmani/.rbenv/versions/2.5.8/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/xcode/pods_project_generator/pods_project_writer.rb:61:in
`write!'
/Users/youcefdahmani/.rbenv/versions/2.5.8/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:328:in `block in create_and_save_projects'
/Users/youcefdahmani/.rbenv/versions/2.5.8/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section'
/Users/youcefdahmani/.rbenv/versions/2.5.8/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:307:in `create_and_save_projects'
/Users/youcefdahmani/.rbenv/versions/2.5.8/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:299:in `generate_pods_project'
/Users/youcefdahmani/.rbenv/versions/2.5.8/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:178:in `integrate'
/Users/youcefdahmani/.rbenv/versions/2.5.8/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:166:in `install!'
/Users/youcefdahmani/.rbenv/versions/2.5.8/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/command/install.rb:52:in `run'
/Users/youcefdahmani/.rbenv/versions/2.5.8/lib/ruby/gems/2.5.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Users/youcefdahmani/.rbenv/versions/2.5.8/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:52:in `run'
/Users/youcefdahmani/.rbenv/versions/2.5.8/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/bin/pod:55:in `<top (required)>'
/Users/youcefdahmani/.rbenv/versions/2.5.8/bin/pod:23:in `load'
/Users/youcefdahmani/.rbenv/versions/2.5.8/bin/pod:23:in `<main>'
Error output from CocoaPods:
↳
[!] Automatically assigning platform `iOS` with version `11.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your
Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
Error running pod install
Error launching application on iPhone 12 Pro Max.
It seems to be an error linked to my ruby version but when I check my version It the 2.5.8. I try to search an answer to this issue but I found nothing. Please can you help to fix this.
Update your ruby version to at least 2.6.x
Flutter relies on ruby in the background, the each_child command was introduced in ruby since 2.6

Can't start rails server - "Failed to watch" error - Bash - Ubuntu - Windows 10

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! :)

vagrant-proxyconf "`split': bad URI" error on installing plugin for Vagrant

Note, I'm running this on a Windows Environment.
I'm working behind a corporate proxy, and trying to get the vagrant-proxyconf plug-in working so the vagrant machines can be set up to work through a proxy. However, on executing vagrant plugin install vagrant-proxyconf I got the following error:
Bundler, the underlying system Vagrant uses to install plugins, reported an error. The error is shown below. These errors are usually caused by misconfigured plugin installations or transient network issues. The error from Bundler is:
Could not fetch specs from http://gems.hashicorp.com/
Retrying source fetch due to error (2/3): Bundler::HTTPError Could not fetch specs from http://gems.hashicorp.com/Retrying source fetch due to error (3/3): Bundler::HTTPError Could not fetch specs from http://gems.hashicorp.com/
Figuring it was probably a proxy issue, I tried setting my environment variable:
set HTTP_PROXY="http://username:password#proxy:port"
After re-executing the plug-in install command, I got a different error:
C:/Vagrant/embedded/lib/ruby/2.0.0/uri/common.rb:176:in `split': bad URI(is not
URI?): http://"http://username:password#proxy:port" (URI::InvalidURIError)
from C:/Vagrant/embedded/lib/ruby/2.0.0/uri/common.rb:211:in `parse'
from C:/Vagrant/embedded/lib/ruby/2.0.0/uri/common.rb:747:in `parse'
from C:/Vagrant/embedded/lib/ruby/2.0.0/uri/common.rb:996:in `URI'
from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/vendor/net/
http/persistent.rb:908:in `proxy_from_env'
from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/vendor/net/
http/persistent.rb:858:in `proxy='
from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/vendor/net/
http/persistent.rb:528:in `initialize'
from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/fetcher.rb:
113:in `new'
from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/fetcher.rb:
113:in `connection'
from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/fetcher.rb:
103:in `initialize'
from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/source/ruby
gems.rb:262:in `new'
from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/source/ruby
gems.rb:262:in `block in remote_specs'
from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/source/ruby
gems.rb:262:in `map'
from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/source/ruby
gems.rb:262:in `remote_specs'
from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/source/ruby
gems.rb:202:in `fetch_specs'
from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/source/ruby
gems.rb:66:in `specs'
from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/definition.
rb:216:in `block (2 levels) in index'
from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/definition.
rb:213:in `each'
from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/definition.
rb:213:in `block in index'
from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/index.rb:9:
in `build'
from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/definition.
rb:209:in `index'
from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/definition.
rb:203:in `resolve'
from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/definition.
rb:133:in `specs'
from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/definition.
rb:122:in `resolve_remotely!'
from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/installer.r
b:76:in `run'
from C:/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/installer.r
b:15:in `install'
from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/bundler.rb:
226:in `block in internal_install'
from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/bundler.rb:
284:in `block in with_isolated_gem'
from C:/Vagrant/embedded/lib/ruby/2.0.0/rubygems/user_interaction.rb:40:
in `use_ui'
from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/bundler.rb:
283:in `with_isolated_gem'
from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/bundler.rb:
225:in `internal_install'
from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/bundler.rb:
92:in `install'
from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/plugin/mana
ger.rb:62:in `block in install_plugin'
from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/plugin/mana
ger.rb:72:in `call'
from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/plugin/mana
ger.rb:72:in `install_plugin'
from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/commands/plugin
/action/install_gem.rb:37:in `call'
from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/action/ward
en.rb:34:in `call'
from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/action/buil
der.rb:116:in `call'
from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/action/runn
er.rb:66:in `block in run'
from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/util/busy.r
b:19:in `busy'
from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/action/runn
er.rb:66:in `run'
from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/commands/plugin
/command/base.rb:14:in `action'
from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/commands/plugin
/command/install.rb:32:in `block in execute'
from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/commands/plugin
/command/install.rb:31:in `each'
from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/commands/plugin
/command/install.rb:31:in `execute'
from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/plugins/commands/plugin
/command/root.rb:56:in `execute'
from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/cli.rb:42:i
n `execute'
from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/environment
.rb:292:in `cli'
from C:/Vagrant/embedded/gems/gems/vagrant-1.6.5/bin/vagrant:174:in `<ma
in>'
Note the error:
C:/Vagrant/embedded/lib/ruby/2.0.0/uri/common.rb:176:in 'split': bad URI(is not URI?): http://"http://username:password#proxy:port" (URI::InvalidURIError) from C:/Vagrant/embedded/lib/ruby/2.0.0/uri/common.rb:211:in parse'
Seems it's interpreting the environment variable incorrectly and having issues interpreting it? Anyone know how to address this issue?
You don't probably even need the quotes (unless the password includes some funny characters). So you could just try:
set HTTP_PROXY=http://username:password#proxy:port
If you need the quotes, the correct form is:
set "HTTP_PROXY=http://username:password#proxy:port"

Ruby NoMethodError on every method in a random class in a single Passenger process

On two separate occasions, we have seen a single Passenger process having NoMethodError issue with a single class. It would throw NoMethodError on any method in a single class the code tries to access. It was as if the class was empty. The same code is ran on 10+ other hosts and also many other Passenger processes on the same host, but none of them would experience this issue. The issue would go away if the problematic process gets killed and restarted.
We initially suspected something overloaded the class at runtime. However, when this issue happened for the second time, the issue occurred on a different class. Our suspicion is on Ruby interpreter or Passenger, but we do not have any lead on the root cause.
Ruby version: 1.9.3
Rails version: 2.3.18
Redacted stack trace from the 2nd occurrence. In this case, it was a module, but the first occurrence was on an ActiveRecord class:
NoMethodError (undefined method `exponential_bounded' for Retry:Module):
app/controllers/pack_controller.rb:242:in `pack'
app/controllers/application_controller.rb:321:in `save_html'
lib/memory_usage_filter.rb:58:in `call'
lib/memory_usage_filter.rb:58:in `filter'
lib/query_log_filter.rb:34:in `call'
lib/query_log_filter.rb:34:in `block in filter'
.../ruby1.9/site_ruby/1.9.1/amazon/querylog.rb:646:in `time'
lib/query_log_filter.rb:26:in `filter'
<internal:prelude>:10:in `synchronize'
.../lib/phusion_passenger/lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
.../lib/phusion_passenger/lib/phusion_passenger/abstract_request_handler.rb:513:in `accept_and_process_next_request'
.../lib/phusion_passenger/lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
.../lib/phusion_passenger/lib/phusion_passenger/rack/application_spawner.rb:206:in `start_request_handler'
.../lib/phusion_passenger/lib/phusion_passenger/rack/application_spawner.rb:171:in `block in handle_spawn_application'
.../lib/phusion_passenger/lib/phusion_passenger/utils.rb:479:in `safe_fork'
.../lib/phusion_passenger/lib/phusion_passenger/rack/application_spawner.rb:166:in `handle_spawn_application'
.../lib/phusion_passenger/lib/phusion_passenger/abstract_server.rb:358:in `server_main_loop'
.../lib/phusion_passenger/lib/phusion_passenger/abstract_server.rb:207:in `start_synchronously'
.../lib/phusion_passenger/lib/phusion_passenger/abstract_server.rb:181:in `start'
.../lib/phusion_passenger/lib/phusion_passenger/rack/application_spawner.rb:129:in `start'
.../lib/phusion_passenger/lib/phusion_passenger/spawn_manager.rb:253:in `block (2 levels) in spawn_rack_application'
.../lib/phusion_passenger/lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
.../lib/phusion_passenger/lib/phusion_passenger/spawn_manager.rb:246:in `block in spawn_rack_application'
.../lib/phusion_passenger/lib/phusion_passenger/abstract_server_collection.rb:82:in `block in synchronize'
<internal:prelude>:10:in `synchronize'
.../lib/phusion_passenger/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
.../lib/phusion_passenger/lib/phusion_passenger/spawn_manager.rb:244:in `spawn_rack_application'
.../lib/phusion_passenger/lib/phusion_passenger/spawn_manager.rb:137:in `spawn_application'
.../lib/phusion_passenger/lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
.../lib/phusion_passenger/lib/phusion_passenger/abstract_server.rb:358:in `server_main_loop'
.../lib/phusion_passenger/lib/phusion_passenger/abstract_server.rb:207:in `start_synchronously'
.../lib/phusion_passenger/helper-scripts/passenger-spawn-server:99:in `<main>'

Resources