ENV
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
Rails 4.2.0
Guard version 2.13.0
Problems:
I think it's not because of spec itself, since it works normally when typed bundle exec rspec xxx_spec.rb
I run a rm -rf /tmp in accident before running this command, I think it's the reason of error in tmp/rspec_guard_result. But have no idea with how to solve it.
After running all specs, it shows following results:
Result
Finished in 1 minute 15.84 seconds (files took 0.46012 seconds to load)
177 examples, 1 failure, 3 pending
Failed examples:
rspec ./spec/models/xxxxxx_spec.rb:88 # xxxx valid should xxxxxx
07:36:42 - ERROR - Guard::RSpec failed to achieve its <run_all>, exception was:
> [#a47cf0a740cd] Errno::EPERM: Operation not permitted # unlink_internal - tmp/rspec_guard_result
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-rspec-4.5.0/lib/guard/rspec/runner.rb:79:in `delete'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-rspec-4.5.0/lib/guard/rspec/runner.rb:79:in `_command_output'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-rspec-4.5.0/lib/guard/rspec/runner.rb:100:in `_process_run_result'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-rspec-4.5.0/lib/guard/rspec/runner.rb:45:in `block in _run'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-rspec-4.5.0/lib/guard/rspec/runner.rb:44:in `tap'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-rspec-4.5.0/lib/guard/rspec/runner.rb:44:in `_run'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-rspec-4.5.0/lib/guard/rspec/runner.rb:24:in `run_all'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-rspec-4.5.0/lib/guard/rspec.rb:33:in `block in run_all'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-rspec-4.5.0/lib/guard/rspec.rb:48:in `_throw_if_failed'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-rspec-4.5.0/lib/guard/rspec.rb:33:in `run_all'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/runner.rb:82:in `block in _supervise'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/runner.rb:79:in `catch'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/runner.rb:79:in `_supervise'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/runner.rb:22:in `block (3 levels) in run'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/runner.rb:119:in `block (2 levels) in _run_group_plugins'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/runner.rb:117:in `each'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/runner.rb:117:in `block in _run_group_plugins'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/runner.rb:116:in `catch'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/runner.rb:116:in `_run_group_plugins'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/runner.rb:21:in `block (2 levels) in run'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/runner.rb:20:in `each'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/runner.rb:20:in `block in run'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/lumberjack-1.0.10/lib/lumberjack.rb:32:in `unit_of_work'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/runner.rb:18:in `run'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/commander.rb:82:in `run_all'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/internals/queue.rb:42:in `block in _run_actions'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/internals/queue.rb:37:in `each'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/internals/queue.rb:37:in `_run_actions'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/internals/queue.rb:21:in `process'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/commander.rb:43:in `start'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/cli/environments/valid.rb:16:in `start_guard'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/cli.rb:122:in `start'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/aruba_adapter.rb:32:in `execute'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/lib/guard/aruba_adapter.rb:19:in `execute!'
> [#a47cf0a740cd] /home/vagrant/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/guard-2.13.0/bin/_guard-core:11:in `<main>'
07:36:42 - INFO - Guard::RSpec has just been fired
[1] guard(main)>
It's probably best to open an issue in Guard-RSpec for theses kinds of things. (You'll get a response and fix faster, and you'll know when fixes are released, etc.).
First, upgrade to guard-rspec 4.6.5. That's just to make sure you aren't having other problems.
Now, you have 2 options:
Avoid removing the whole tmp directory, and just remove the files you created there. This is the "nicest" solution, since multiple tools can create files there.
If you really want to remove tmp by yourself, then just manually set the results_file option to something other than tmp/rspec_guard_result, e.g.
guard :rspec, results_file: 'guardfile_results.txt' do
Related
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 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.
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.