Problems with character encoding in Resque - ruby

I have a series of JSON messages that I need to process and I've run into some trouble with character encodings. I retrieve this message from a RabbitMQ queue like so:
#data = []
#queue.pop do |metadata, payload|
parsed_message = JSON.parse(payload)
#data << parsed_message
end
I then process them using Resque and enqueue them like so:
Resque.enqueue(Worker, #data)
When I run the worker it throws this error:
** [16:06:13 2012-09-14] 5375: Error reserving job: #<Encoding::InvalidByteSequenceError: "\xC3" on US-ASCII>
** [16:06:13 2012-09-14] 5375: /usr/local/lib/ruby/1.9.1/json/common.rb:148:in `encode'
/usr/local/lib/ruby/1.9.1/json/common.rb:148:in `initialize'
/usr/local/lib/ruby/1.9.1/json/common.rb:148:in `new'
/usr/local/lib/ruby/1.9.1/json/common.rb:148:in `parse'
/usr/local/lib/ruby/gems/1.9.1/gems/multi_json-1.3.6/lib/multi_json/adapters/json_common.rb:7:in `load'
/usr/local/lib/ruby/gems/1.9.1/gems/multi_json-1.3.6/lib/multi_json.rb:93:in `load'
/usr/local/lib/ruby/gems/1.9.1/gems/resque-1.22.0/lib/resque/helpers.rb:38:in `decode'
/usr/local/lib/ruby/gems/1.9.1/gems/resque-1.22.0/lib/resque.rb:149:in `pop'
/usr/local/lib/ruby/gems/1.9.1/gems/resque-1.22.0/lib/resque/job.rb:100:in `reserve'
/usr/local/lib/ruby/gems/1.9.1/gems/resque-1.22.0/lib/resque.rb:303:in `reserve'
/usr/local/lib/ruby/gems/1.9.1/gems/resque-1.22.0/lib/resque/worker.rb:209:in `block in reserve'
/usr/local/lib/ruby/gems/1.9.1/gems/resque-1.22.0/lib/resque/worker.rb:207:in `each'
/usr/local/lib/ruby/gems/1.9.1/gems/resque-1.22.0/lib/resque/worker.rb:207:in `reserve'
/usr/local/lib/ruby/gems/1.9.1/gems/resque-1.22.0/lib/resque/worker.rb:136:in `block in work'
/usr/local/lib/ruby/gems/1.9.1/gems/resque-1.22.0/lib/resque/worker.rb:133:in `loop'
/usr/local/lib/ruby/gems/1.9.1/gems/resque-1.22.0/lib/resque/worker.rb:133:in `work'
/usr/local/lib/ruby/gems/1.9.1/gems/resque-1.22.0/lib/resque/tasks.rb:36:in `block (2 levels) in <top (required)>'
/usr/local/lib/ruby/1.9.1/rake/task.rb:205:in `call'
/usr/local/lib/ruby/1.9.1/rake/task.rb:205:in `block in execute'
/usr/local/lib/ruby/1.9.1/rake/task.rb:200:in `each'
/usr/local/lib/ruby/1.9.1/rake/task.rb:200:in `execute'
/usr/local/lib/ruby/1.9.1/rake/task.rb:158:in `block in invoke_with_call_chain'
/usr/local/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/usr/local/lib/ruby/1.9.1/rake/task.rb:151:in `invoke_with_call_chain'
/usr/local/lib/ruby/1.9.1/rake/task.rb:144:in `invoke'
/usr/local/lib/ruby/1.9.1/rake/application.rb:116:in `invoke_task'
/usr/local/lib/ruby/1.9.1/rake/application.rb:94:in `block (2 levels) in top_level'
/usr/local/lib/ruby/1.9.1/rake/application.rb:94:in `each'
/usr/local/lib/ruby/1.9.1/rake/application.rb:94:in `block in top_level'
/usr/local/lib/ruby/1.9.1/rake/application.rb:133:in `standard_exception_handling'
/usr/local/lib/ruby/1.9.1/rake/application.rb:88:in `top_level'
/usr/local/lib/ruby/1.9.1/rake/application.rb:66:in `block in run'
/usr/local/lib/ruby/1.9.1/rake/application.rb:133:in `standard_exception_handling'
/usr/local/lib/ruby/1.9.1/rake/application.rb:63:in `run'
/usr/local/bin/rake:32:in `<main>'
rake aborted!
I've wrapped all the code in the perform function from the worker in a begin/rescue block, to try to catch the exception but to no avail which leads me to think that it's from inside Resque somewhere.
I've tried enqueueing the Resque worker with the raw data and then parse it inside the worker into JSON and setting an UTF-8 encoding:
raw_data.each do |msg|
msg = msg.encode("UTF-8", :invalid => :replace, :undef => :replace, :replace => "")
parsed_msg = JSON.parse(msg) rescue nil
next if parsed_msg.nil?
parsed_data << parsed_msg
end
and I still get the same error.
It's not always the same character, sometimes it's \xC2 or \xD8 if I remember correctly
Any ideas?

Is it possible the file encoding is incorrect?
Try inserting:
# encoding: UTF-8
at the top of the relevant ruby source files. This is one of the most obnoxious things in Ruby 1.9.

Related

Ruby deadlock waiting on Process::Waiter with Open3.popen3

I was using Open3.capture3 in my ruby code and started to notice deadlocks. I did some research and came across this great blog about how open3 can cause deadlocks. Taking this into account I came up with my own capture3 method (still using Open3.popen3) to replace one I was currently using (see below). However I have found that deadlocks still seem to be occurring and the responsible party is the blocking call on the wait_thread.value to get the Process::Status. Looking into Open3 source code I can see this wait_thread is just a Process::Waiter that you get from a Process.detach call. I was wondering what could be causing this deadlock? Is there some way I can check to see if this thread is deadlocked, kill it and return a custom Process::Status (I'd like to return a Process::Status as opposed to just an integer to stay inline with Open3.capture3)
def capture3(cmd)
out_buff = ''
err_buff = ''
chunk_size = 4096
# Progressive timeout array
sleeps = [[0.05]*20,[0.1]*5,[0.5]*3,1,2].flatten
_in, out, err, wait_thread = Open3.popen3(cmd)
_in.close
open_pipes = [out, err]
while !open_pipes.empty?
timeout = sleeps.shift || timeout
ready_pipes, *_ = IO.select(open_pipes, nil, nil, timeout)
ready_pipes.each do |pipe|
tmp = ''
begin
tmp << pipe.readpartial(chunk_size)
rescue EOFError
pipe.close
open_pipes.delete(pipe)
end
out_buff << tmp if pipe == out
err_buff << tmp if pipe == err
end
end
[out_buff, err_buff, wait_thread.value]
end
Note ruby version I'm using is 2.2.5 and running on Mac.
Edit:
The exact error is No live threads left. Deadlock? (fatal) pointing to line number of the wait_thread.value call. I'm calling the capture3 method in another function where I fork the process like so
def fork_process(cmd, options={})
pid = fork {
Process.setproctitle(options[:process_name]) unless options[:process_name].nil?
ENV.merge!(options[:environment])
stdout, stderr, status = capture3(cmd)
yield(stdout, stderr, status) if block_given?
}
Process.detach(pid)
end
Full stacktrace:
/home/myapp/utils.rb:769:in `value': No live threads left. Deadlock? (fatal)
from /home/myapp/utils.rb:769:in `capture3'
from /home/myapp/utils.rb:106:in `block in fork_process'
from /home/myapp/utils.rb:104:in `fork'
from /home/myapp/utils.rb:104:in `fork_process'
from /home/myapp/server.rb:396:in `block in <class:MyServer>'
from /Users/app/.rvm/gems/ruby-2.2.5/gems/sinatra-1.4.8/lib/sinatra/base.rb:1611:in `call'
from /Users/app/.rvm/gems/ruby-2.2.5/gems/sinatra-1.4.8/lib/sinatra/base.rb:1611:in `block in compile!'
from /Users/app/.rvm/gems/ruby-2.2.5/gems/sinatra-1.4.8/lib/sinatra/base.rb:975:in `[]'
from /Users/app/.rvm/gems/ruby-2.2.5/gems/sinatra-1.4.8/lib/sinatra/base.rb:975:in `block (3 levels) in route!'
from /Users/app/.rvm/gems/ruby-2.2.5/gems/sinatra-1.4.8/lib/sinatra/base.rb:994:in `route_eval'
from /Users/app/.rvm/gems/ruby-2.2.5/gems/sinatra-1.4.8/lib/sinatra/base.rb:975:in `block (2 levels) in route!'
from /Users/app/.rvm/gems/ruby-2.2.5/gems/sinatra-1.4.8/lib/sinatra/base.rb:1015:in `block in process_route'
from /Users/app/.rvm/gems/ruby-2.2.5/gems/sinatra-1.4.8/lib/sinatra/base.rb:1013:in `catch'
from /Users/app/.rvm/gems/ruby-2.2.5/gems/sinatra-1.4.8/lib/sinatra/base.rb:1013:in `process_route'
from /Users/app/.rvm/gems/ruby-2.2.5/gems/sinatra-1.4.8/lib/sinatra/base.rb:973:in `block in route!'
from /Users/app/.rvm/gems/ruby-2.2.5/gems/sinatra-1.4.8/lib/sinatra/base.rb:972:in `each'
from /Users/app/.rvm/gems/ruby-2.2.5/gems/sinatra-1.4.8/lib/sinatra/base.rb:972:in `route!'
from /Users/app/.rvm/gems/ruby-2.2.5/gems/sinatra-1.4.8/lib/sinatra/base.rb:1085:in `block in dispatch!'
from /Users/app/.rvm/gems/ruby-2.2.5/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `block in invoke'
from /Users/app/.rvm/gems/ruby-2.2.5/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `catch'
from /Users/app/.rvm/gems/ruby-2.2.5/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `invoke'
from /Users/app/.rvm/gems/ruby-2.2.5/gems/sinatra-1.4.8/lib/sinatra/base.rb:1082:in `dispatch!'
from /Users/app/.rvm/gems/ruby-2.2.5/gems/sinatra-1.4.8/lib/sinatra/base.rb:907:in `block in call!'
from /Users/app/.rvm/gems/ruby-2.2.5/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `block in invoke'
from /Users/app/.rvm/gems/ruby-2.2.5/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `catch'
from /Users/app/.rvm/gems/ruby-2.2.5/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `invoke'
from /Users/app/.rvm/gems/ruby-2.2.5/gems/sinatra-1.4.8/lib/sinatra/base.rb:907:in `call!'
from /Users/app/.rvm/gems/ruby-2.2.5/gems/sinatra-1.4.8/lib/sinatra/base.rb:895:in `call'
from /Users/app/.rvm/gems/ruby-2.2.5/gems/rack-protection-1.5.3/lib/rack/protection/xss_header.rb:18:in `call'
from /Users/app/.rvm/gems/ruby-2.2.5/gems/rack-protection-1.5.3/lib/rack/protection/path_traversal.rb:16:in `call'
from /Users/app/.rvm/gems/ruby-2.2.5/gems/rack-protection-1.5.3/lib/rack/protection/json_csrf.rb:18:in `call'
from /Users/app/.rvm/gems/ruby-2.2.5/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
from /Users/app/.rvm/gems/ruby-2.2.5/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
from /Users/app/.rvm/gems/ruby-2.2.5/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in `call'
from /Users/app/.rvm/gems/ruby-2.2.5/gems/rack-1.6.5/lib/rack/nulllogger.rb:9:in `call'
from /Users/app/.rvm/gems/ruby-2.2.5/gems/rack-1.6.5/lib/rack/head.rb:13:in `call'
from /Users/app/.rvm/gems/ruby-2.2.5/gems/sinatra-1.4.8/lib/sinatra/show_exceptions.rb:25:in `call'
from /Users/app/.rvm/gems/ruby-2.2.5/gems/sinatra-1.4.8/lib/sinatra/base.rb:182:in `call'
from /Users/app/.rvm/gems/ruby-2.2.5/gems/sinatra-1.4.8/lib/sinatra/base.rb:2013:in `call'
from /Users/app/.rvm/gems/ruby-2.2.5/gems/sinatra-1.4.8/lib/sinatra/base.rb:1487:in `block in call'
from /Users/app/.rvm/gems/ruby-2.2.5/gems/sinatra-1.4.8/lib/sinatra/base.rb:1787:in `synchronize'
from /Users/app/.rvm/gems/ruby-2.2.5/gems/sinatra-1.4.8/lib/sinatra/base.rb:1487:in `call'
from /Users/app/.rvm/gems/ruby-2.2.5/gems/puma-3.8.2/lib/puma/configuration.rb:224:in `call'
from /Users/app/.rvm/gems/ruby-2.2.5/gems/puma-3.8.2/lib/puma/server.rb:600:in `handle_request'
from /Users/app/.rvm/gems/ruby-2.2.5/gems/puma-3.8.2/lib/puma/server.rb:435:in `process_client'
from /Users/app/.rvm/gems/ruby-2.2.5/gems/puma-3.8.2/lib/puma/server.rb:299:in `block in run'
from /Users/app/.rvm/gems/ruby-2.2.5/gems/puma-3.8.2/lib/puma/thread_pool.rb:120:in `call'
from /Users/app/.rvm/gems/ruby-2.2.5/gems/puma-3.8.2/lib/puma/thread_pool.rb:120:in `block in spawn_thread'

Ruby on Rails - Import Data from uncommon formatted CSV

I've got CSV files in the following format;
Category-1-GUID,Product1
,Product2
,Product3
Category-2-GUID,Product4
,Product5
and the task should write following data to the model:
Category-1-GUID,Product1
Category-1-GUID,Product2
Category-1-GUID,Product3
Category-2-GUID,Product4
Category-2-GUID,Product5
I've found Ruby on Rails - Import Data from a CSV file very useful to import the data but this little variance makes me became a blockhead....
Thanks in Advance! Best regards
-- EDIT 1: import_productdata.rake file: --
desc "Import Product with Category-GUID"
task :import_productdata do
require 'csv'
rows = CSV.read('tmp/export1.csv')
category_id = nil
items = rows.map do |row|
category_id = row[0] unless row[0].nil?
[category_id, row[1]]
end
csv = CSV.parse(items, :headers => false)
csv.each do |row|
Product.create!(row.to_hash)
end
end
Error:
** Invoke import_productdata (first_time)
** Execute import_productdata
/Users/bn/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/csv.rb:1326:in `ensure in parse': CSV#close at /Users/bn/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/forwardable.rb:156 forwarding to private method Array#close
rake aborted!
NoMethodError: undefined method `close' for #<Array:0x007fd69f43c3d0>
/Users/bn/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/forwardable.rb:226:in `close'
/Users/bn/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/csv.rb:1326:in `ensure in parse'
/Users/bn/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/csv.rb:1326:in `parse'
/Users/bn/Documents/RubyApps/TestApp/lib/tasks/import_productdata.rake:13:in `block in <top (required)>'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/task.rb:271:in `block in execute'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/task.rb:271:in `each'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/task.rb:271:in `execute'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/task.rb:213:in `block in invoke_with_call_chain'
/Users/bn/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/task.rb:193:in `invoke_with_call_chain'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/task.rb:182:in `invoke'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/application.rb:160:in `invoke_task'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/application.rb:116:in `each'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/application.rb:116:in `block in top_level'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/application.rb:125:in `run_with_threads'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/application.rb:110:in `top_level'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/application.rb:83:in `block in run'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/application.rb:186:in `standard_exception_handling'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/application.rb:80:in `run'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
/Users/bn/.rvm/gems/ruby-2.4.0/bin/rake:23:in `load'
/Users/bn/.rvm/gems/ruby-2.4.0/bin/rake:23:in `<main>'
Caused by:
NoMethodError: private method `gets' called for #<Array:0x007fd69f43c3d0>
/Users/bn/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/csv.rb:1830:in `block in shift'
/Users/bn/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/csv.rb:1828:in `loop'
/Users/bn/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/csv.rb:1828:in `shift'
/Users/bn/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/csv.rb:1770:in `each'
/Users/bn/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/csv.rb:1784:in `to_a'
/Users/bn/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/csv.rb:1784:in `read'
/Users/bn/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/csv.rb:1324:in `parse'
/Users/bn/Documents/RubyApps/TestApp/lib/tasks/import_productdata.rake:13:in `block in <top (required)>'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/task.rb:271:in `block in execute'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/task.rb:271:in `each'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/task.rb:271:in `execute'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/task.rb:213:in `block in invoke_with_call_chain'
/Users/bn/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/task.rb:193:in `invoke_with_call_chain'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/task.rb:182:in `invoke'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/application.rb:160:in `invoke_task'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/application.rb:116:in `each'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/application.rb:116:in `block in top_level'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/application.rb:125:in `run_with_threads'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/application.rb:110:in `top_level'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/application.rb:83:in `block in run'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/application.rb:186:in `standard_exception_handling'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/lib/rake/application.rb:80:in `run'
/Users/bn/.rvm/gems/ruby-2.4.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
/Users/bn/.rvm/gems/ruby-2.4.0/bin/rake:23:in `load'
/Users/bn/.rvm/gems/ruby-2.4.0/bin/rake:23:in `<main>'
Tasks: TOP => import_productdata
if you call just CSV.read then,
rows = CSV.read('test.csv')
Output is
[["Category-1-GUID", "Product1"], [nil, "Product2"], [nil, "Product3"], ["Category-2-GUID", "Product4"], [nil, "Product5"]]
So just putting category id to make category_id, product_id pair array.
require 'csv'
rows = CSV.read('test.csv')
category_id = nil
items = rows.map do |row|
category_id = row[0] unless row[0].nil?
[category_id, row[1]]
end
p items # [["Category-1-GUID", "Product1"], ["Category-1-GUID", "Product2"], ["Category-1-GUID", "Product3"], ["Category-2-GUID", "Product4"], ["Category-2-GUID", "Product5"]]

rake db:migrate cause StandardError - uninitialized constant CreateObjects::Object

I have migration 20150930051523_create_objects.rb:
class CreateObjects < ActiveRecord::Migration
def change
create_table :objects do |t|
t.text :name
t.timestamps null: false
end
Object.create :name => "A"
Object.create :name => "B"
Object.create :name => "C"
end
end
$ rake:db migrate --trace cause output:
** Invoke db:migrate (first_time)
** Invoke db:environment (first_time)
** Execute db:environment
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:migrate
== 20150930051523 CreateObjects: migrating ====================================
-- create_table(:objects)
-> 0.0010s
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
uninitialized constant CreateObjects::Object/db/migrate/20150930051523_create_objects.rb:8:in `change'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:605:in `exec_migration'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:589:in `block (2 levels) in migrate'
/usr/lib/ruby/2.1.0/benchmark.rb:279:in `measure'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:588:in `block in migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:in `with_connection'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:587:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:765:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:995:in `block in execute_migration_in_transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:1041:in `block in ddl_transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/abstract/transaction.rb:184:in `within_new_transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/transactions.rb:220:in `transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:1041:in `ddl_transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:994:in `execute_migration_in_transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:956:in `block in migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:952:in `each'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:952:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:820:in `up'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:798:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/tasks/database_tasks.rb:137:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/railties/databases.rake:44:in `block (2 levels) in '
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/usr/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:150:in `invoke_task'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `each'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `block in top_level'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:115:in `run_with_threads'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:100:in `top_level'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:78:in `block in run'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:75:in `run'
/var/lib/gems/2.1.0/gems/rake-10.4.2/bin/rake:33:in `'
/usr/local/bin/rake:23:in `load'
/usr/local/bin/rake:23:in `'
NameError: uninitialized constant CreateObjects::Object/db/migrate/20150930051523_create_barbers.rb:8:in `change'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:605:in `exec_migration'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:589:in `block (2 levels) in migrate'
/usr/lib/ruby/2.1.0/benchmark.rb:279:in `measure'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:588:in `block in migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:in `with_connection'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:587:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:765:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:995:in `block in execute_migration_in_transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:1041:in `block in ddl_transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/abstract/transaction.rb:184:in `within_new_transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/transactions.rb:220:in `transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:1041:in `ddl_transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:994:in `execute_migration_in_transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:956:in `block in migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:952:in `each'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:952:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:820:in `up'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/migration.rb:798:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/tasks/database_tasks.rb:137:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.4/lib/active_record/railties/databases.rake:44:in `block (2 levels) in '
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/usr/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:150:in `invoke_task'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `each'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `block in top_level'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:115:in `run_with_threads'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:100:in `top_level'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:78:in `block in run'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:75:in `run'
/var/lib/gems/2.1.0/gems/rake-10.4.2/bin/rake:33:in `'
/usr/local/bin/rake:23:in `load'
/usr/local/bin/rake:23:in `'
Tasks: TOP => db:migrate
Error emerging at Object.create... stage, what is wrong?
Update: In a comment it was pointed out that the actual code was not containing "Object", this answer is thus based on the wrong example.
Object is a bad name to use for an (unscoped) Model class, as it is already defined by Ruby.
The Object you are calling create on is probably not the Object class you defined in your model sources.
I assume you run rails. Remove the Object.create lines from your migration. Run it, it should work fine. Then, call rails console, where you end up in a live session. Here you can play around with your code, e.g. call Object.create, Object.where{id: 1} etc. I assume that you will get the same errors.
So, as a solution, rename your Object into something else, like Class and look if it works.
Okay, that was a joke, of course Class is also a really bad name for a model class :) . Try to find something more meaningful.
The problem was solved by set up pg gem, which pull bundle of another gems and packs (particularly postgresql-server-dev-all). After installing it, the command rake db:migrate works fine and completely.

NoMethodError (undefined method `slice!' for nil:NilClass) from Redis call

I'm randomly getting the following error message. Does anyone have any ideas what could be causing this?
NoMethodError (undefined method `slice!' for nil:NilClass):
vendor/bundle/ruby/2.1.0/gems/redis-3.2.1/lib/redis/connection/ruby.rb:274:in `read'
vendor/bundle/ruby/2.1.0/gems/redis-3.2.1/lib/redis/client.rb:248:in `block in read'
vendor/bundle/ruby/2.1.0/gems/redis-3.2.1/lib/redis/client.rb:236:in `io'
vendor/bundle/ruby/2.1.0/gems/redis-3.2.1/lib/redis/client.rb:247:in `read'
vendor/bundle/ruby/2.1.0/gems/redis-3.2.1/lib/redis/client.rb:112:in `block in call'
vendor/bundle/ruby/2.1.0/gems/redis-3.2.1/lib/redis/client.rb:217:in `block (2 levels) in process'
vendor/bundle/ruby/2.1.0/gems/redis-3.2.1/lib/redis/client.rb:353:in `ensure_connected'
vendor/bundle/ruby/2.1.0/gems/redis-3.2.1/lib/redis/client.rb:207:in `block in process'
vendor/bundle/ruby/2.1.0/gems/redis-3.2.1/lib/redis/client.rb:292:in `logging'
vendor/bundle/ruby/2.1.0/gems/redis-3.2.1/lib/redis/client.rb:206:in `process'
vendor/bundle/ruby/2.1.0/gems/redis-3.2.1/lib/redis/client.rb:112:in `call'
vendor/bundle/ruby/2.1.0/gems/redis-3.2.1/lib/redis.rb:789:in `block in get'
vendor/bundle/ruby/2.1.0/gems/redis-3.2.1/lib/redis.rb:37:in `block in synchronize'
/usr/local/ruby-2.1.5/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
vendor/bundle/ruby/2.1.0/gems/redis-3.2.1/lib/redis.rb:37:in `synchronize'
vendor/bundle/ruby/2.1.0/gems/redis-3.2.1/lib/redis.rb:788:in `get'
vendor/bundle/ruby/2.1.0/gems/redis-store-1.1.4/lib/redis/store/interface.rb:5:in `get'
vendor/bundle/ruby/2.1.0/gems/redis-store-1.1.4/lib/redis/store/marshalling.rb:17:in `get'
vendor/bundle/ruby/2.1.0/gems/redis-activesupport-4.0.0/lib/active_support/cache/redis_store.rb:169:in `read_entry'
vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.9/lib/active_support/cache.rb:312:in `block in read'
vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.9/lib/active_support/cache.rb:548:in `instrument'
vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.9/lib/active_support/cache.rb:311:in `read'
/var/www/apps/13712/shared/vendor_bundle/ruby/2.1.0/bundler/gems/spree-13f1df56d58f/core/app/models/spree/preferences/store.rb:34:in `get'
/var/www/apps/13712/shared/vendor_bundle/ruby/2.1.0/bundler/gems/spree-13f1df56d58f/core/app/models/spree/preferences/scoped_store.rb:13:in `fetch'
/var/www/apps/13712/shared/vendor_bundle/ruby/2.1.0/bundler/gems/spree-13f1df56d58f/core/app/models/spree/preferences/preferable_class_methods.rb:13:in `block in preference'
/var/www/apps/13712/shared/vendor_bundle/ruby/2.1.0/bundler/gems/spree-13f1df56d58f/core/app/models/spree/preferences/preferable.rb:43:in `get_preference'
vendor/bundle/ruby/2.1.0/bundler/gems/spree-13f1df56d58f/core/lib/spree/core/controller_helpers/ssl.rb:8:in `block (2 levels) in <module:SSL>'
The last place Spree is hit before calling redis-rb:
unless (val = #cache.read(key)).nil?
return val
end
where #cache = Rails.cache
UPDATE
I am using this gem with this SSL plugin, so the error may be related to the plugin.
The error happens when line = #sock.gets is nil. Here's the locals right after that is determined to be true.
[1] pry(#<Redis::Connection::Ruby>)> line
=> nil
[2] pry(#<Redis::Connection::Ruby>)> #sock
=> #<OpenSSL::SSL::SSLSocket:0x007fdab2688730
#callback_state=nil,
#context=
#<OpenSSL::SSL::SSLContext:0x007fdab2688758
#ca_file=nil,
#ca_path=nil,
#cert=nil,
#cert_store=nil,
#client_ca=nil,
#client_cert_cb=nil,
#extra_chain_cert=nil,
#key=nil,
#npn_protocols=nil,
#npn_select_cb=nil,
#options=nil,
#renegotiation_cb=nil,
#servername_cb=nil,
#session_get_cb=nil,
#session_id_context=nil,
#session_new_cb=nil,
#session_remove_cb=nil,
#timeout=nil,
#tmp_dh_callback=nil,
#verify_callback=nil,
#verify_depth=nil,
#verify_mode=nil>,
#eof=true,
#hostname=nil,
#io=#<Redis::Connection::TCPSocket:fd 11>,
#rbuffer="",
#sync=true,
#sync_close=false,
#wbuffer="">
[3] pry(#<Redis::Connection::Ruby>)> #sock.closed?
=> false
This looks like this could be an issue with the ruby redis client.
You could try downgrading a version and/or filing an issue for the redis team in the Github repository.

Neoid error when starting Rails server

Having looked into it, and as a relative newbie to graph databases, I've decided that Neoid may be the best way to benefit from Neo4j at this stage. I've come across a problem straight after installing it, on starting up the server. I've installed the gem, added the 01_neo4j.rb file as stated on the github page, added the relevant columns to the models and get the following error:
=> Booting WEBrick
=> Rails 4.0.2 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Exiting
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/open-uri.rb:35:in `initialize': No such file or directory - /dev/null (Errno::ENOENT)
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/open-uri.rb:35:in `open'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/open-uri.rb:35:in `open'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/logger.rb:599:in `create_logfile'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/logger.rb:594:in `open_logfile'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/logger.rb:549:in `initialize'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/logger.rb:314:in `new'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/logger.rb:314:in `initialize'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/neoid-0.1.2/lib/neoid.rb:73:in `new'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/neoid-0.1.2/lib/neoid.rb:73:in `logger'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/neoid-0.1.2/lib/neoid.rb:52:in `initialize_all'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/neoid-0.1.2/lib/neoid/railtie.rb:7:in `block (2 levels) in <class:Railtie>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.0.2/lib/active_support/lazy_load_hooks.rb:36:in `call'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.0.2/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.0.2/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.0.2/lib/active_support/lazy_load_hooks.rb:44:in `each'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.0.2/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.2/lib/rails/application/finisher.rb:62:in `block in <module:Finisher>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.2/lib/rails/initializable.rb:30:in `instance_exec'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.2/lib/rails/initializable.rb:30:in `run'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.2/lib/rails/initializable.rb:55:in `block in run_initializers'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:150:in `block in tsort_each'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:219:in `each_strongly_connected_component_from'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:182:in `block in each_strongly_connected_component'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:180:in `each'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:180:in `each_strongly_connected_component'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:148:in `tsort_each'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.2/lib/rails/initializable.rb:54:in `run_initializers'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.2/lib/rails/application.rb:215:in `initialize!'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.2/lib/rails/railtie/configurable.rb:30:in `method_missing'
from C:/Sites/Knock4/config/environment.rb:5:in `<top (required)>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `block in require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:214:in `load_dependency'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `require'
from C:/Sites/Knock4/config.ru:3:in `block in <main>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
from C:/Sites/Knock4/config.ru:in `new'
from C:/Sites/Knock4/config.ru:in `<main>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.2/lib/rails/commands/server.rb:48:in `app'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.2/lib/rails/commands/server.rb:75:in `start'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.2/lib/rails/commands.rb:76:in `block in <top (required)>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.2/lib/rails/commands.rb:71:in `tap'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.2/lib/rails/commands.rb:71:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
If anyone has any idea what the problem might be here, I would appreciate it. I'm using Rails 4.0.2 (as you can probably see), so not sure if this is an issue.
The error reference shows the following code:
def open(name, *rest, &block) # :doc:
if name.respond_to?(:open)
name.open(*rest, &block)
elsif name.respond_to?(:to_str) &&
%r{\A[A-Za-z][A-Za-z0-9+\-\.]*://} =~ name &&
(uri = URI.parse(name)).respond_to?(:open)
uri.open(*rest, &block)
else
open_uri_original_open(name, *rest, &block)
end
end
With
open_uri_original_open(name, *rest, &block)
being line 35. I have no idea what this means though!
This is caused, on windows, by neoid 0.1.2 which assumes you are on unix and so the standard logger redirects to dev/null. So you must define
ENV['NEOID_LOG'] ||= 'true'
ENV['NEOID_LOG_FILE'] ||= 'log/neoid.log'
and the log will be in the log folders.

Resources