I keep getting the follow server error when running unicorn on my local machine:
E, [2012-08-17T10:25:11.961002 #95265] ERROR -- : app error: Content-Length header was 780958, but should be 781014 (Rack::Lint::LintError)
E, [2012-08-17T10:25:11.961578 #95265] ERROR -- : /Users/cscairns/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/lint.rb:19:in `assert'
E, [2012-08-17T10:25:11.961893 #95265] ERROR -- : /Users/cscairns/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/lint.rb:501:in `verify_content_length'
E, [2012-08-17T10:25:11.962173 #95265] ERROR -- : /Users/cscairns/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/lint.rb:525:in `each'
E, [2012-08-17T10:25:11.962806 #95265] ERROR -- : /Users/cscairns/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/body_proxy.rb:26:in `method_missing'
E, [2012-08-17T10:25:11.963116 #95265] ERROR -- : /Users/cscairns/.rvm/gems/ruby-1.9.3-p194/gems/unicorn-4.3.1/lib/unicorn/http_response.rb:41:in `http_response_write'
E, [2012-08-17T10:25:11.963416 #95265] ERROR -- : /Users/cscairns/.rvm/gems/ruby-1.9.3-p194/gems/unicorn-4.3.1/lib/unicorn/http_server.rb:539:in `process_client'
E, [2012-08-17T10:25:11.963702 #95265] ERROR -- : /Users/cscairns/.rvm/gems/ruby-1.9.3-p194/gems/unicorn-4.3.1/lib/unicorn/http_server.rb:606:in `worker_loop'
E, [2012-08-17T10:25:11.963985 #95265] ERROR -- : /Users/cscairns/.rvm/gems/ruby-1.9.3-p194/gems/unicorn-4.3.1/lib/unicorn/http_server.rb:487:in `spawn_missing_workers'
E, [2012-08-17T10:25:11.964288 #95265] ERROR -- : /Users/cscairns/.rvm/gems/ruby-1.9.3-p194/gems/unicorn-4.3.1/lib/unicorn/http_server.rb:137:in `start'
E, [2012-08-17T10:25:11.964744 #95265] ERROR -- : /Users/cscairns/.rvm/gems/ruby-1.9.3-p194/gems/unicorn-4.3.1/bin/unicorn:121:in `<top (required)>'
E, [2012-08-17T10:25:11.965043 #95265] ERROR -- : /Users/cscairns/.rvm/gems/ruby-1.9.3-p194/bin/unicorn:19:in `load'
E, [2012-08-17T10:25:11.965339 #95265] ERROR -- : /Users/cscairns/.rvm/gems/ruby-1.9.3-p194/bin/unicorn:19:in `<main>'
E, [2012-08-17T10:25:11.965624 #95265] ERROR -- : /Users/cscairns/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval'
E, [2012-08-17T10:25:11.966223 #95265] ERROR -- : /Users/cscairns/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `<main>'
Has anyone run into the same issue?
I had this issue as well in a Rails 3.2 app running unicorn and nginx. I don't think using nginx vs. Apache vs. ??? will matter.
This fixed my issue: Rack::Lint Content-Length header error with unicorn/nginx Curious if this works for you too.
This gem, unicorn-rails, fixed the issue: https://github.com/samuelkadolph/unicorn-rails.
Your response and content length differ, use bytesize to determine the length of your response instead of length.
Related
I'm unable to run bundle exec srb init in an existing Rails project. The first errors I see are LoadErrors for gems and things just go downhill from there.
This is a larger project that has been around for a few years. I believe it started on Rails 4.2 and has been upgraded up to 6. I've been able to get sorbet up and running with smaller, younger projects and I'm not sure where to start looking for issues with this one.
Terminal output:
Would you like to continue? [Y/n]
Generating: sorbet/config
Generating: sorbet/rbi/sorbet-typed/
Generating: sorbet/rbi/gems/
W, [2020-09-25T11:24:07.658621 #91284] WARN -- : Cumulus::Company: overriding method 'may_queue?'!
W, [2020-09-25T11:24:07.658719 #91284] WARN -- : Cumulus::Company: overriding method 'queue!'!
W, [2020-09-25T11:24:07.658761 #91284] WARN -- : Cumulus::Company: overriding method 'queue'!
W, [2020-09-25T11:24:07.658930 #91284] WARN -- : Cumulus::Company: overriding method 'may_start?'!
W, [2020-09-25T11:24:07.658992 #91284] WARN -- : Cumulus::Company: overriding method 'start!'!
W, [2020-09-25T11:24:07.659101 #91284] WARN -- : Cumulus::Company: overriding method 'start'!
W, [2020-09-25T11:24:07.659294 #91284] WARN -- : Cumulus::Company: overriding method 'may_done?'!
W, [2020-09-25T11:24:07.659340 #91284] WARN -- : Cumulus::Company: overriding method 'done!'!
W, [2020-09-25T11:24:07.659542 #91284] WARN -- : Cumulus::Company: overriding method 'done'!
W, [2020-09-25T11:24:07.659791 #91284] WARN -- : Cumulus::Company: overriding method 'may_error?'!
W, [2020-09-25T11:24:07.659842 #91284] WARN -- : Cumulus::Company: overriding method 'error!'!
W, [2020-09-25T11:24:07.659884 #91284] WARN -- : Cumulus::Company: overriding method 'error'!
W, [2020-09-25T11:24:07.661010 #91284] WARN -- : Cumulus::Company: overriding method 'may_queue?'!
W, [2020-09-25T11:24:07.661075 #91284] WARN -- : Cumulus::Company: overriding method 'queue!'!
W, [2020-09-25T11:24:07.661121 #91284] WARN -- : Cumulus::Company: overriding method 'queue'!
W, [2020-09-25T11:24:07.661496 #91284] WARN -- : Cumulus::Company: overriding method 'may_start?'!
W, [2020-09-25T11:24:07.661552 #91284] WARN -- : Cumulus::Company: overriding method 'start!'!
W, [2020-09-25T11:24:07.661597 #91284] WARN -- : Cumulus::Company: overriding method 'start'!
W, [2020-09-25T11:24:07.661796 #91284] WARN -- : Cumulus::Company: overriding method 'may_done?'!
W, [2020-09-25T11:24:07.661851 #91284] WARN -- : Cumulus::Company: overriding method 'done!'!
W, [2020-09-25T11:24:07.661896 #91284] WARN -- : Cumulus::Company: overriding method 'done'!
W, [2020-09-25T11:24:07.662141 #91284] WARN -- : Cumulus::Company: overriding method 'may_error?'!
W, [2020-09-25T11:24:07.662218 #91284] WARN -- : Cumulus::Company: overriding method 'error!'!
W, [2020-09-25T11:24:07.662286 #91284] WARN -- : Cumulus::Company: overriding method 'error'!
LoadError: cannot load such file -- action_controller/middleware
LoadError: cannot load such file -- activerecord-postgres_enum
LoadError: cannot load such file -- image_processing
LoadError: cannot load such file -- archive-zip
LoadError: cannot load such file -- aws-sdk
LoadError: cannot load such file -- babel-source
LoadError: cannot load such file -- bundle-audit
LoadError: cannot load such file -- capistrano-harrow
LoadError: cannot load such file -- chromedriver-helper
LoadError: cannot load such file -- debase-ruby_core_source
LoadError: cannot load such file -- fog-core
LoadError: cannot load such file -- fog-json
LoadError: cannot load such file -- fog-xml
LoadError: cannot load such file -- guard-compat
LoadError: cannot load such file -- guard-livereload
LoadError: cannot load such file -- guard-minitest
LoadError: cannot load such file -- mechanize
LoadError: cannot load such file -- minitest-reporters
LoadError: cannot load such file -- webrobots
LoadError: cannot load such file -- passenger
LoadError: cannot load such file -- rack/session/dalli
LoadError: cannot load such file -- rack-contrib
LoadError: cannot load such file -- railties
LoadError: Function 'inotify_init' not found in [libc.dylib]
NameError: uninitialized constant Selenium::WebDriver::Chrome::Driver
Did you mean? Selenium::WebDriver::Driver
LoadError: cannot load such file -- skylight-core
LoadError: cannot load such file -- sorbet
LoadError: cannot load such file -- sorbet-static
LoadError: cannot load such file -- spring
LoadError: cannot load such file -- spring-watcher-listen
LoadError: cannot load such file -- sprockets-es6
LoadError: cannot load such file -- sprockets-rails
LoadError: cannot load such file -- turbolinks-source
LoadError: cannot load such file -- wkhtmltopdf-binary
[892/1192] require_relative './db/migrate/20190204160125_fix_fks_on_deprecated_tables.rb'/Users/rrosen/projects/verite-app/db/migrate/20190204160125_fix_fks_on_deprecated_tables.rb:20: warning: key :on_delete is duplicated and overwritten on line 20
/Users/rrosen/projects/verite-app/db/migrate/20190204160125_fix_fks_on_deprecated_tables.rb:22: warning: key :on_delete is duplicated and overwritten on line 22
[1032/1192] require_relative './scripts/export_risk_descriptions.rb'Document(s) Not Attested
Question unanswered
[1188/1192] require_relative './test/test_helper.rb'rails aborted!
NoMethodError: undefined method `id' for nil:NilClass
/Users/rrosen/projects/verite-app/spec/factories/employer_nominations.rb:9:in `block (2 levels) in <top (required)>'
/Users/rrosen/projects/verite-app/spec/factories/employer_nominations.rb:2:in `block in <top (required)>'
/Users/rrosen/projects/verite-app/spec/factories/employer_nominations.rb:1:in `<top (required)>'
/Users/rrosen/projects/verite-app/config/environment.rb:5:in `<top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'
Tasks: TOP => db:test:prepare => db:load_config => environment
(See full trace by running task with --trace)
Generating: sorbet/rbi/hidden-definitions/
Requiring all of your code
Naming all Modules
Naming ObjectThe PGconn, PGresult, and PGError constants are deprecated, and will be
removed as of version 1.0.
You should use PG::Connection, PG::Result, and PG::Error instead, respectively.
Called from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sorbet-0.5.5920/lib/real_stdlib.rb:77:in `const_get'
Naming ActionCable::ServerGot NameError when trying to get nested name ActionCable::Server::ActiveRecordConnectionManagement_
Naming ActionControllerGot LoadError when trying to get nested name ActionController::Middleware
Naming ActionDispatchGot Gem::LoadError when trying to get nested name ActionDispatch::SystemTestCase
Naming ActionDispatch::SessionYou don't have dalli installed in your application. Please add it to your Gemfile and run bundle install
Got LoadError when trying to get nested name ActionDispatch::Session::MemCacheStore
Naming ActiveJob::QueueAdaptersGot LoadError when trying to get nested name ActiveJob::QueueAdapters::ResqueAdapter
Got LoadError when trying to get nested name ActiveJob::QueueAdapters::SneakersAdapter
Got LoadError when trying to get nested name ActiveJob::QueueAdapters::SuckerPunchAdapter
Got LoadError when trying to get nested name ActiveJob::QueueAdapters::BackburnerAdapter
Got LoadError when trying to get nested name ActiveJob::QueueAdapters::DelayedJobAdapter
Got LoadError when trying to get nested name ActiveJob::QueueAdapters::QueAdapter
Got LoadError when trying to get nested name ActiveJob::QueueAdapters::QueueClassicAdapter
Naming ActiveRecordGot NameError when trying to get nested name ActiveRecord::DatabaseSelector_
Naming ActiveStorage::TransformersGot LoadError when trying to get nested name ActiveStorage::Transformers::ImageProcessingTransformer
Got LoadError when trying to get nested name ActiveStorage::Transformers::MiniMagickTransformer
Naming ActiveSupport::CacheYou don't have dalli installed in your application. Please add it to your Gemfile and run bundle install
Got LoadError when trying to get nested name ActiveSupport::Cache::MemCacheStore
Naming DeviseCould not load 'omniauth'. Please ensure you have the omniauth gem >= 1.0.0 installed and listed in your Gemfile.
Got LoadError when trying to get nested name Devise::OmniAuth
Naming Devise::ModelsCould not load 'omniauth'. Please ensure you have the omniauth gem >= 1.0.0 installed and listed in your Gemfile.
Got LoadError when trying to get nested name Devise::Models::Omniauthable
Naming EventMachine::DeferrableEM::Deferrable::Pool is deprecated, please use EM::Pool
Naming EventMachine::ProtocolsGot LoadError when trying to get nested name EventMachine::Protocols::Postgres3
Naming ExceptionNotifierGot LoadError when trying to get nested name ExceptionNotifier::GoogleChatNotifier
Got LoadError when trying to get nested name ExceptionNotifier::MattermostNotifier
Naming I18n::TestsGot ArgumentError when trying to get nested name I18n::Tests::Pluralization_
Got ArgumentError when trying to get nested name I18n::Tests::Procs_
Got ArgumentError when trying to get nested name I18n::Tests::Lookup_
Got ArgumentError when trying to get nested name I18n::Tests::Basics_
Got ArgumentError when trying to get nested name I18n::Tests::Defaults_
Got ArgumentError when trying to get nested name I18n::Tests::Interpolation_
Got ArgumentError when trying to get nested name I18n::Tests::Link_
Naming I18n::Tests::LocalizationGot ArgumentError when trying to get nested name I18n::Tests::Localization::Time_
Got ArgumentError when trying to get nested name I18n::Tests::Localization::Date_
Got ArgumentError when trying to get nested name I18n::Tests::Localization::DateTime_
Got ArgumentError when trying to get nested name I18n::Tests::Localization::Procs_
Naming Loofah::HTML5/usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sorbet-0.5.5920/lib/real_stdlib.rb:77: warning: constant Loofah::HTML5::WhiteList is deprecated
Naming Rack::HandlerGot LoadError when trying to get nested name Rack::Handler::FastCGI
Got LoadError when trying to get nested name Rack::Handler::LSWS
Got LoadError when trying to get nested name Rack::Handler::SCGI
Got LoadError when trying to get nested name Rack::Handler::Thin
Naming Rack::Request/usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sorbet-0.5.5920/lib/real_stdlib.rb:77: warning: constant Rack::Request::SCHEME_WHITELIST is deprecated
Naming Rack::SessionGot LoadError when trying to get nested name Rack::Session::Memcache
Naming Rails::ApplicationGot NameError when trying to get nested name Rails::Application::Railties_
Naming Solargraph/usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/yard-0.9.24/lib/yard/parser/ruby/legacy/irb/slex.rb:18: warning: already initialized constant IRB::SLex::DOUT
/usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/2.5.0/irb/slex.rb:24: warning: previous definition of DOUT was here
/usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/yard-0.9.24/lib/yard/parser/ruby/legacy/irb/slex.rb:19: warning: already initialized constant IRB::SLex::D_WARN
/usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/2.5.0/irb/slex.rb:25: warning: previous definition of D_WARN was here
/usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/yard-0.9.24/lib/yard/parser/ruby/legacy/irb/slex.rb:20: warning: already initialized constant IRB::SLex::D_DEBUG
/usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/2.5.0/irb/slex.rb:26: warning: previous definition of D_DEBUG was here
/usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/yard-0.9.24/lib/yard/parser/ruby/legacy/irb/slex.rb:21: warning: already initialized constant IRB::SLex::D_DETAIL
/usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/2.5.0/irb/slex.rb:27: warning: previous definition of D_DETAIL was here
Naming Solargraph::LanguageServer::Message::TextDocumentGot LoadError when trying to get nested name Solargraph::LanguageServer::Message::TextDocument::DiagnosticsQueue
Naming Solargraph::SourceGot LoadError when trying to get nested name Solargraph::Source::Mapper
Naming Solargraph::SourceMap::NodeProcessorGot LoadError when trying to get nested name Solargraph::SourceMap::NodeProcessor::ModuleNode
Naming Sprockets::AutoloadGot LoadError when trying to get nested name Sprockets::Autoload::Eco
Got LoadError when trying to get nested name Sprockets::Autoload::EJS
Got LoadError when trying to get nested name Sprockets::Autoload::YUI
Got LoadError when trying to get nested name Sprockets::Autoload::Closure
Naming ThreadSafeGot LoadError when trying to get nested name ThreadSafe::JRubyCacheBackend
Naming TiltGot LoadError when trying to get nested name Tilt::BlueClothTemplate
Got LoadError when trying to get nested name Tilt::KramdownTemplate
Got LoadError when trying to get nested name Tilt::RDiscountTemplate
Got LoadError when trying to get nested name Tilt::RedcarpetTemplate
Got LoadError when trying to get nested name Tilt::CommonMarkerTemplate
Got LoadError when trying to get nested name Tilt::PandocTemplate
Got LoadError when trying to get nested name Tilt::AsciidoctorTemplate
Got LoadError when trying to get nested name Tilt::CreoleTemplate
Got LoadError when trying to get nested name Tilt::LessTemplate
Got LoadError when trying to get nested name Tilt::LiquidTemplate
Got LoadError when trying to get nested name Tilt::LiveScriptTemplate
Got LoadError when trying to get nested name Tilt::PrawnTemplate
Got LoadError when trying to get nested name Tilt::RadiusTemplate
Got LoadError when trying to get nested name Tilt::RedClothTemplate
Got LoadError when trying to get nested name Tilt::MarkabyTemplate
Got LoadError when trying to get nested name Tilt::TypeScriptTemplate
Got LoadError when trying to get nested name Tilt::WikiClothTemplate
Got LoadError when trying to get nested name Tilt::RstPandocTemplate
Got LoadError when trying to get nested name Tilt::YajlTemplate
Naming WebConsoleGot NameError when trying to get nested name WebConsole::SourceLocation_
Naming YARD::Server::CommandsKernel#exit was called while requiring ruby source files
Traceback (most recent call last):
41: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sorbet-0.5.5920/bin/srb-rbi:237:in `<main>'
40: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sorbet-0.5.5920/bin/srb-rbi:196:in `main'
39: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sorbet-0.5.5920/bin/srb-rbi:121:in `init'
38: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sorbet-0.5.5920/bin/srb-rbi:232:in `block in make_step'
37: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sorbet-0.5.5920/lib/hidden-definition-finder.rb:38:in `main'
36: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sorbet-0.5.5920/lib/hidden-definition-finder.rb:44:in `main'
35: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sorbet-0.5.5920/lib/hidden-definition-finder.rb:75:in `all_modules_and_aliases'
34: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sorbet-0.5.5920/lib/hidden-definition-finder.rb:68:in `constant_cache'
33: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sorbet-0.5.5920/lib/gem-generator-tracepoint/tracer.rb:40:in `new'
32: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sorbet-0.5.5920/lib/gem-generator-tracepoint/tracer.rb:40:in `new'
31: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sorbet-0.5.5920/lib/constant_cache.rb:70:in `initialize'
30: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sorbet-0.5.5920/lib/constant_cache.rb:211:in `dfs_module'
29: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sorbet-0.5.5920/lib/constant_cache.rb:211:in `each'
28: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sorbet-0.5.5920/lib/constant_cache.rb:212:in `block in dfs_module'
27: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sorbet-0.5.5920/lib/constant_cache.rb:211:in `dfs_module'
26: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sorbet-0.5.5920/lib/constant_cache.rb:211:in `each'
25: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sorbet-0.5.5920/lib/constant_cache.rb:212:in `block in dfs_module'
24: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sorbet-0.5.5920/lib/constant_cache.rb:211:in `dfs_module'
23: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sorbet-0.5.5920/lib/constant_cache.rb:211:in `each'
22: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sorbet-0.5.5920/lib/constant_cache.rb:212:in `block in dfs_module'
21: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sorbet-0.5.5920/lib/constant_cache.rb:145:in `dfs_module'
20: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sorbet-0.5.5920/lib/constant_cache.rb:145:in `each'
19: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sorbet-0.5.5920/lib/constant_cache.rb:157:in `block in dfs_module'
18: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sorbet-0.5.5920/lib/real_stdlib.rb:77:in `real_const_get'
17: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sorbet-0.5.5920/lib/real_stdlib.rb:77:in `call'
16: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sorbet-0.5.5920/lib/real_stdlib.rb:77:in `const_get'
15: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/zeitwerk-2.4.0/lib/zeitwerk/kernel.rb:34:in `require'
14: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/zeitwerk-2.4.0/lib/zeitwerk/kernel.rb:34:in `require'
13: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/yard-0.9.24/lib/yard/server/commands/list_command.rb:2:in `<top (required)>'
12: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/yard-0.9.24/lib/yard/server/commands/list_command.rb:3:in `<module:YARD>'
11: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/yard-0.9.24/lib/yard/server/commands/list_command.rb:4:in `<module:Server>'
10: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/yard-0.9.24/lib/yard/server/commands/list_command.rb:6:in `<module:Commands>'
9: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/zeitwerk-2.4.0/lib/zeitwerk/kernel.rb:34:in `require'
8: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/zeitwerk-2.4.0/lib/zeitwerk/kernel.rb:34:in `require'
7: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/yard-0.9.24/lib/yard/server/commands/library_command.rb:4:in `<top (required)>'
6: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/yard-0.9.24/lib/yard/server/commands/library_command.rb:5:in `<module:YARD>'
5: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/yard-0.9.24/lib/yard/server/commands/library_command.rb:6:in `<module:Server>'
4: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/yard-0.9.24/lib/yard/server/commands/library_command.rb:32:in `<module:Commands>'
3: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/yard-0.9.24/lib/yard/server/commands/library_command.rb:34:in `<class:LibraryCommand>'
2: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/yard-0.9.24/lib/yard/server/commands/library_command.rb:34:in `fork'
1: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/yard-0.9.24/lib/yard/server/commands/library_command.rb:34:in `block in <class:LibraryCommand>'
/usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sorbet-0.5.5920/lib/require_everything.rb:94:in `block in patch_kernel': ExitCalledError (ExitCall
Naming RDoc::MarkupMiniTest::Unit::TestCase is now Minitest::Test. From /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/2.5.0/rdoc/test_case.rb:32:in `<top (required)>'
MiniTest::Unit::TestCase is now Minitest::Test. From /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/2.5.0/rdoc/markup/formatter_test_case.rb:38:in `<top (required)>'
MiniTest::Unit::TestCase is now Minitest::Test. From /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/2.5.0/rdoc/markup/text_formatter_test_case.rb:29:in `<top (required)>'
Generating /var/folders/lm/6s3s24rd6x77g1z4nhktwnmw0000gn/T/d20200925-91284-12r026t/reflection.rbi with 13671 modules and 262 aliases
Printing your code's symbol table into /var/folders/lm/6s3s24rd6x77g1z4nhktwnmw0000gn/T/d20200925-91284-12r026t/from-source.json
Printing /var/folders/lm/6s3s24rd6x77g1z4nhktwnmw0000gn/T/d20200925-91284-12r026t/reflection.rbi's symbol table into /var/folders/lm/6s3s24rd6x77g1z4nhktwnmw0000gn/T/d20200925-91284-12r026t/reflection.json
Traceback (most recent call last):
6: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sorbet-0.5.5920/bin/srb-rbi:237:in `<main>'
5: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sorbet-0.5.5920/bin/srb-rbi:196:in `main'
4: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sorbet-0.5.5920/bin/srb-rbi:121:in `init'
3: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sorbet-0.5.5920/bin/srb-rbi:232:in `block in make_step'
2: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sorbet-0.5.5920/lib/hidden-definition-finder.rb:38:in `main'
1: from /usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sorbet-0.5.5920/lib/hidden-definition-finder.rb:47:in `main'
/usr/local/Cellar/rbenv/1.1.2/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sorbet-0.5.5920/lib/hidden-definition-finder.rb:151:in `write_constants': /var/folders/lm/6s3s24rd6x77g1z4nhktwnmw0000gn/T/d20200925-91284-12r026t/reflection.rbi had unexpected errors. Check this file for a clue: /var/folders/lm/6s3s24rd6x77g1z4nhktwnmw0000gn/T/d20200925-91284-12r026t/reflection.json.err (RuntimeError)
Rails 3.2.20, Ruby 1.9.3p194, Apache 2.2.22, Passenger 3.0.21.
File are uploaded to /tmp (that what I think when looking at the logs:
Parameters: {
...
#tempfile=#<File:/tmp/RackMultipart20150317-1329-19lcteh>>
...
}
)
Big file uploads (for instance for a 1.8Go file) raise the exception Errno::ENOSPC: No space left on device - write with the log trace:
/usr/local/lib/ruby/1.9.1/fileutils.rb:1372 :in `copy_stream`
/usr/local/lib/ruby/1.9.1/fileutils.rb:1372 :in `block (2 levels) in copy_file`
/usr/local/lib/ruby/1.9.1/fileutils.rb:1371 :in `open`
/usr/local/lib/ruby/1.9.1/fileutils.rb:1371 :in `block in copy_file`
/usr/local/lib/ruby/1.9.1/fileutils.rb:1370 :in `open`
/usr/local/lib/ruby/1.9.1/fileutils.rb:1370 :in `copy_file`
/usr/local/lib/ruby/1.9.1/fileutils.rb:477 :in `copy_file`
/usr/local/lib/ruby/1.9.1/fileutils.rb:396 :in `block in cp`
/usr/local/lib/ruby/1.9.1/fileutils.rb:1515 :in `block in fu_each_src_dest`
/usr/local/lib/ruby/1.9.1/fileutils.rb:1531 :in `fu_each_src_dest0`
/usr/local/lib/ruby/1.9.1/fileutils.rb:1513 :in `fu_each_src_dest`
/usr/local/lib/ruby/1.9.1/fileutils.rb:395 :in `cp`
[GEM_ROOT]/gems/paperclip-4.2.0/lib/paperclip/io_adapters/abstract_adapter.rb:41 :in `copy_to_tempfile`
[GEM_ROOT]/gems/paperclip-4.2.0/lib/paperclip/io_adapters/uploaded_file_adapter.rb:8 :in `initialize`
I don't understand why because the partition where is the /tmp directory has plenty of available space:
Filesystem Size Used Avail Use% Mounted on
rootfs 9.9G 4.9G 4.6G 52% /
There is no file size limit in the Apache configuration.
I add a quick look at the paperclip source. It seems the file content is copied, so it is present 2 time on the disk. (The error trace also shows it)
So to be able to hadle 1.8G file you need at least 3.6G of free space. If at the same time a 500M file is uploaded (or if there is another copy some where) you don't have anought disk space.
To be able to size the needed storage, you will need to track how your framework is handling uploaded files.
This is the output of my rails console after I include rubygems and redis.
2.0.0-p353 :024 > r = Redis.new
=> #<Redis client v3.0.7 for redis://127.0.0.1:6379/0>
2.0.0-p353 :025 > r.set('foo','bar')
=> "OK"
2.0.0-p353 :026 > r.get('foo')
=> "bar"
2.0.0-p353 :033 > r.lpush('foo','bar')
Redis::CommandError: ERR Operation against a key holding the wrong kind of value
from /home/poorva/.rvm/gems/ruby-2.0.0-p353/gems/redis-3.0.7/lib/redis/client.rb:97:in `call'
from /home/poorva/.rvm/gems/ruby-2.0.0-p353/gems/redis-3.0.7/lib/redis.rb:949:in `block in lpush'
from /home/poorva/.rvm/gems/ruby-2.0.0-p353/gems/redis-3.0.7/lib/redis.rb:37:in `block in synchronize'
from /home/poorva/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
from /home/poorva/.rvm/gems/ruby-2.0.0-p353/gems/redis-3.0.7/lib/redis.rb:37:in `synchronize'
from /home/poorva/.rvm/gems/ruby-2.0.0-p353/gems/redis-3.0.7/lib/redis.rb:948:in `lpush'
from (irb):33
from /home/poorva/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.0/lib/rails/commands/console.rb:90:in `start'
from /home/poorva/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.0/lib/rails/commands/console.rb:9:in `start'
from /home/poorva/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.0/lib/rails/commands.rb:64:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
2.0.0-p353 :034 > r.lpush(foo,'bar')
NameError: undefined local variable or method `foo' for main:Object
from (irb):34
from /home/poorva/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.0/lib/rails/commands/console.rb:90:in `start'
from /home/poorva/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.0/lib/rails/commands/console.rb:9:in `start'
from /home/poorva/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.0/lib/rails/commands.rb:64:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
Update: the first argument has to the first argument of the lpush command, that is to say the key of the list. and the second, the value to be pushed.
initial message (before the question was modified)
The message is explicit ArgumentError: wrong number of arguments (0 for 2). Just give LPUSH the expected arguments as described in Redis documentation : the key and the value to be pushed.
lpush('mylist', 'bar')
I've searched through stackoverflow and don't see a similar problem. I'm trying to add one column into the existing Slicks table. Should be easy enough but I'm pulling my hair out!
I might have not named the rails command for migration well enough: rails generate migration AddNametoSlicks name:string
Also:
1.) this command generated this migration 20130605194117_add_nameto_slicks.rb
which did not look right without _. I changed the name of the migration to add_name_to_slicks.rb
2.) The migration command did not generate the add_column. What am I missing on the command?
Here's the migration file:
class AddNametoSlicks < ActiveRecord::Migration
def change
add_column :slicks, :name, :string
end
end
Error from terminal:
rake aborted!
An error has occurred, this and all later migrations canceled:
uninitialized constant AddNameToSlicks/usr/local/rvm/gems/ruby-1.9.3-p194#gigbase/gems/activesupport-3.2.12/lib/active_su
pport/inflector/methods.rb:230:in `block in constantize'
/usr/local/rvm/gems/ruby-1.9.3-p194#gigbase/gems/activesupport-3.2.12/lib/active_support/inflector/methods.rb:229:in `eac
h'
/usr/local/rvm/gems/ruby-1.9.3-p194#gigbase/gems/activesupport-3.2.12/lib/active_support/inflector/methods.rb:229:in `con
stantize'
/usr/local/rvm/gems/ruby-1.9.3-p194#gigbase/gems/activesupport-3.2.12/lib/active_support/core_ext/string/inflections.rb:5
4:in `constantize'
/usr/local/rvm/gems/ruby-1.9.3-p194#gigbase/gems/activerecord-3.2.12/lib/active_record/migration.rb:538:in `load_migratio
n'
/usr/local/rvm/gems/ruby-1.9.3-p194#gigbase/gems/activerecord-3.2.12/lib/active_record/migration.rb:533:in `migration'
/usr/local/rvm/gems/ruby-1.9.3-p194#gigbase/gems/activerecord-3.2.12/lib/active_record/migration.rb:528:in `migrate'
/usr/local/rvm/gems/ruby-1.9.3-p194#gigbase/gems/activerecord-3.2.12/lib/active_record/migration.rb:720:in `block (2 leve
ls) in migrate'
/usr/local/rvm/gems/ruby-1.9.3-p194#gigbase/gems/activerecord-3.2.12/lib/active_record/migration.rb:775:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p194#gigbase/gems/activerecord-3.2.12/lib/active_record/migration.rb:775:in `block in ddl_
transaction'
/usr/local/rvm/gems/ruby-1.9.3-p194#gigbase/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/datab
ase_statements.rb:192:in `transaction'
/usr/local/rvm/gems/ruby-1.9.3-p194#gigbase/gems/activerecord-3.2.12/lib/active_record/transactions.rb:208:in `transactio
n'
/usr/local/rvm/gems/ruby-1.9.3-p194#gigbase/gems/activerecord-3.2.12/lib/active_record/migration.rb:775:in `ddl_transacti
on'
/usr/local/rvm/gems/ruby-1.9.3-p194#gigbase/gems/activerecord-3.2.12/lib/active_record/migration.rb:719:in `block in migr
ate'
/usr/local/rvm/gems/ruby-1.9.3-p194#gigbase/gems/activerecord-3.2.12/lib/active_record/migration.rb:700:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p194#gigbase/gems/activerecord-3.2.12/lib/active_record/migration.rb:700:in `migrate'
/usr/local/rvm/gems/ruby-1.9.3-p194#gigbase/gems/activerecord-3.2.12/lib/active_record/migration.rb:570:in `up'
/usr/local/rvm/gems/ruby-1.9.3-p194#gigbase/gems/activerecord-3.2.12/lib/active_record/migration.rb:551:in `migrate'
/usr/local/rvm/gems/ruby-1.9.3-p194#gigbase/gems/activerecord-3.2.12/lib/active_record/railties/databases.rake:179:in `bl
ock (2 levels) in <top (required)>'
/usr/local/rvm/gems/ruby-1.9.3-p194#gigbase/gems/rake-10.0.4/lib/rake/task.rb:246:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p194#gigbase/gems/rake-10.0.4/lib/rake/task.rb:246:in `block in execute'
/usr/local/rvm/gems/ruby-1.9.3-p194#gigbase/gems/rake-10.0.4/lib/rake/task.rb:241:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p194#gigbase/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute'
/usr/local/rvm/gems/ruby-1.9.3-p194#gigbase/gems/rake-10.0.4/lib/rake/task.rb:184:in `block in invoke_with_call_chain'
/usr/local/rvm/gems/ruby-1.9.3-p194#gigbase/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
/usr/local/rvm/gems/ruby-1.9.3-p194#gigbase/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke'
/usr/local/rvm/gems/ruby-1.9.3-p194#gigbase/gems/rake-10.0.4/lib/rake/application.rb:143:in `invoke_task'
/usr/local/rvm/gems/ruby-1.9.3-p194#gigbase/gems/rake-10.0.4/lib/rake/application.rb:101:in `block (2 levels) in top_leve
l'
/usr/local/rvm/gems/ruby-1.9.3-p194#gigbase/gems/rake-10.0.4/lib/rake/application.rb:101:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p194#gigbase/gems/rake-10.0.4/lib/rake/application.rb:101:in `block in top_level'
/usr/local/rvm/gems/ruby-1.9.3-p194#gigbase/gems/rake-10.0.4/lib/rake/application.rb:110:in `run_with_threads'
/usr/local/rvm/gems/ruby-1.9.3-p194#gigbase/gems/rake-10.0.4/lib/rake/application.rb:95:in `top_level'
/usr/local/rvm/gems/ruby-1.9.3-p194#gigbase/gems/rake-10.0.4/lib/rake/application.rb:73:in `block in run'
/usr/local/rvm/gems/ruby-1.9.3-p194#gigbase/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/usr/local/rvm/gems/ruby-1.9.3-p194#gigbase/gems/rake-10.0.4/lib/rake/application.rb:70:in `run'
Tasks: TOP => db:migrate
AddNameToSlicks is being requested but you have AddNametoSlicks.
Change to - To
I am trying to use the roo gem to parse an Openoffice spreadsheet. However I am getting the following error while beginning my localhost
/home/raison/.rvm/gems/ruby-1.9.2-p180/gems/roo-1.9.3/lib/roo/openoffice.rb:3:in `require': no such file to load -- zip/zipfilesystem (LoadError)
from /home/raison/.rvm/gems/ruby-1.9.2-p180/gems/roo-1.9.3/lib/roo/openoffice.rb:3:in `'
from /home/raison/.rvm/gems/ruby-1.9.2-p180/gems/roo-1.9.3/lib/roo.rb:68:in `require'
from /home/raison/.rvm/gems/ruby-1.9.2-p180/gems/roo-1.9.3/lib/roo.rb:68:in `'
from /home/raison/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.15/lib/bundler/runtime.rb:68:in `require'
from /home/raison/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.15/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /home/raison/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.15/lib/bundler/runtime.rb:66:in `each'
from /home/raison/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.15/lib/bundler/runtime.rb:66:in `block in require'
from /home/raison/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.15/lib/bundler/runtime.rb:55:in `each'
from /home/raison/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.15/lib/bundler/runtime.rb:55:in `require'
from /home/raison/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.15/lib/bundler.rb:120:in `require'
from /home/raison/anna/config/application.rb:7:in `'
from /home/raison/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.8/lib/rails/commands.rb:28:in `require'
from /home/raison/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.8/lib/rails/commands.rb:28:in `block in '
from /home/raison/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.8/lib/rails/commands.rb:27:in `tap'
from /home/raison/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.8/lib/rails/commands.rb:27:in `'
from script/rails:6:in `require'
from script/rails:6:in `'
I already have rubyzip installed. Can anyone help me out here? Also please suggest some alternate gems for parsing .ods files .
In Gemfile
gem 'rubyzip', :require => 'zip/zipfilesystem'
Rspreadsheet allows you to read, modify and write ods files. Here is the example of its basic usage
require 'rspreadsheet'
# initialization
book = Rspreadsheet.open('./test.ods')
sheet = book.worksheets(1)
# get value of a cell B5 (there are more ways to do this)
sheet.B5 # => 'cell value'
sheet[5,2] # => 'cell value'
sheet.rows(5).cells(2).value # => 'cell value'
# set value of a cell B5
sheet.F5 = 'text'
sheet[5,2] = 7
sheet.cells(5,2).value = 1.78
# working with cell format
sheet.cells(5,2).format.bold = true
sheet.cells(5,2).format.background_color = '#FF0000'
# calculating sum of cells in row
sheet.rows(5).cellvalues.sum
sheet.rows(5).cells.sum{ |cell| cell.value.to_f }
# iterating over list of people and displaying the data
total = 0
sheet.rows.each do |row|
puts "Sponsor #{row[1]} with email #{row[2]} has donated #{row[3]} USD."
total += row[3].to_f
end
puts "Totally fundraised #{total} USD"
# saving file
book.save
book.save('different_filename.ods')
The project is under active developments and I use it in my projects. Any comments are welcomed. If you are migging a feature, you may fill in the request and it will be implemented.