Hi Kenneth,
I got rid of that error by uninstalling and installing again all the
gems related with the project.
But it seems, I missed something because after starting the server,I
get the following error.
ArgumentError at /
NULL pointer given
Ruby (eval): in each_hash, line 3
Web GET localhost/
Jump to:
* GET
* POST
* Cookies
* ENV
Traceback (innermost first)
* (eval): in each_hash
* (eval): in all_hashes
* C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.3/
lib/active_record/connection_adapters/mysql_adapter.rb: in select
589. # Turn this off. http://dev.rubyonrails.org/ticket/6778
590. execute("SET SQL_AUTO_IS_NULL=0")
591. end
592.
593. def select(sql, name = nil)
594. @connection.query_with_result = true
595. result = execute(sql, name)
596. rows = result.all_hashes...
597. result.free
598. rows
599. end
600.
601. def supports_views?
602. version[0] >= 5
603. end
* C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.3/
lib/active_record/connection_adapters/abstract/database_statements.rb:
in select_all_without_query_cache
1. module ActiveRecord
2. module ConnectionAdapters # :nodoc:
3. module DatabaseStatements
4. # Returns an array of record hashes with the column names
as keys and
5. # column values as values.
6. def select_all(sql, name = nil)
7. select(sql, name)...
8. end
9.
10. # Returns a record hash with the column names as keys and
column values
11. # as values.
12. def select_one(sql, name = nil)
13. result = select_all(sql, name)
14. result.first if result
* C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.3/
lib/active_record/connection_adapters/abstract/query_cache.rb: in
select_all
55. @query_cache.clear if @query_cache
56. end
57.
58. def select_all_with_query_cache(*args)
59. if @query_cache_enabled
60. cache_sql(args.first) { select_all_without_query_cache
(*args) }
61. else
62. select_all_without_query_cache(*args)...
63. end
64. end
65.
66. def columns_with_query_cache(*args)
67. if @query_cache_enabled
68. @query_cache["SHOW FIELDS FROM #{args.first}"] ||=
columns_without_query_cache(*args)
69. else
* C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.3/
lib/active_record/base.rb: in find_by_sql
654. # Post.find_by_sql "SELECT p.title, c.author FROM posts p,
comments c WHERE p.id = c.post_id"
655. # > [#<Post:0x36bff9c @attributes={"title"=>"Ruby Meetup",
"first_name"=>"Quentin"}>, ...]
656. #
657. # # You can use the same string replacement techniques as
you can with ActiveRecord#find
658. # Post.find_by_sql ["SELECT title FROM posts WHERE author
= ? AND created > ?", author_id, start_date]
659. # > [#<Post:0x36bff9c @attributes={"first_name"=>"The
Cheap Man Buys Twice"}>, ...]
660. def find_by_sql(sql)
661. connection.select_all(sanitize_sql(sql), "#{name}
Load").collect! { |record| instantiate(record) }...
662. end
663.
664. # Returns true if a record exists in the table that
matches the +id+ or
665. # conditions given, or false otherwise. The argument can
take five forms:
666. #
667. # * Integer - Finds the record with this primary key.
668. # * String - Finds the record with a primary key
corresponding to this
* C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.3/
lib/active_record/base.rb: in find_every
1541.
1542. def find_every(options)
1543. include_associations = merge_includes(scope
(:find, :include), options[:include])
1544.
1545. if include_associations.any? &&
references_eager_loaded_tables?(options)
1546. records = find_with_associations(options)
1547. else
1548. records = find_by_sql(construct_finder_sql(options))...
1549. if include_associations.any?
1550. preload_associations(records, include_associations)
1551. end
1552. end
1553.
1554. records.each { |record| record.readonly! } if options
[:readonly]
1555.
* C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.3/
lib/active_record/base.rb: in find_initial
1498.
1499. "(#{segments.join(') AND (')})" unless segments.empty?
1500. end
1501.
1502. private
1503. def find_initial(options)
1504. options.update(:limit => 1)
1505. find_every(options).first...
1506. end
1507.
1508. def find_last(options)
1509. order = options[:order]
1510.
1511. if order
1512. order = reverse_sql_order(order)
* C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.3/
lib/active_record/base.rb: in find
606. # end
607. def find(*args)
608. options = args.extract_options!
609. validate_find_options(options)
610. set_readonly_option!(options)
611.
612. case args.first
613. when :first then find_initial(options)...
614. when :last then find_last(options)
615. when :all then find_every(options)
616. else find_from_ids(args, options)
617. end
618. end
619.
620. # A convenience wrapper for <tt>find(:first, *args)</tt>.
You can pass in all the
* C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.3/
lib/active_record/base.rb: in find_by_ip
1893. # attributes = args[0].with_indifferent_access
1894. # find_attributes = attributes.slice(*[:user_id])
1895. # else
1896. # find_attributes = attributes =
construct_attributes_from_arguments([:user_id], args)
1897. # end
1898. #
1899. # options = { :conditions => find_attributes }
1900. # set_readonly_option!(options)...
1901. #
1902. # record = find(:first, options)
1903. #
1904. # if record.nil?
1905. # record = self.new { |r| r.send(:attributes=, attributes,
guard_protected_attributes) }
1906. # yield(record) if block_given?
1907. # record.save
* C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.3/
lib/active_record/base.rb: in send
1878. end
1879. else
1880. find(:#{finder}, options.merge(finder_options))
1881. end
1882. #{'result || raise(RecordNotFound, "Couldn\'t find #{name}
with #{attributes.to_a.collect {|pair| "#{pair.first} = #
{pair.second}"}.join(\', \')}")' if bang}
1883. end
1884. }, __FILE__, __LINE__
1885. send(method_id, *arguments)...
1886. elsif match.instantiator?
1887. instantiator = match.instantiator
1888. # def self.find_or_create_by_user_id(*args)
1889. # guard_protected_attributes = false
1890. #
1891. # if args[0].is_a?(Hash)
1892. # guard_protected_attributes = true
* C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.3/
lib/active_record/base.rb: in method_missing
1878. end
1879. else
1880. find(:#{finder}, options.merge(finder_options))
1881. end
1882. #{'result || raise(RecordNotFound, "Couldn\'t find #{name}
with #{attributes.to_a.collect {|pair| "#{pair.first} = #
{pair.second}"}.join(\', \')}")' if bang}
1883. end
1884. }, __FILE__, __LINE__
1885. send(method_id, *arguments)...
1886. elsif match.instantiator?
1887. instantiator = match.instantiator
1888. # def self.find_or_create_by_user_id(*args)
1889. # guard_protected_attributes = false
1890. #
1891. # if args[0].is_a?(Hash)
1892. # guard_protected_attributes = true
* C:/Program Files/ruote-rest/lib/models/auth.rb: in authenticate
48. #
49. class Host < ActiveRecord::Base
50.
51. # Returns true if the remote address is trusted.
52. #
53. def self.authenticate (remote_addr)
54.
55. host = find_by_ip(remote_addr)...
56.
57. return false unless host
58.
59. h = Time.now.hour
60.
61. return false if host.tfrom && h < host.tfrom.to_i
62. return false if host.tto && h > host.tto.to_i
* C:/Program Files/ruote-rest/lib/auth.rb: in clear
63. end
64.
65. protected
66.
67. def clear (env)
68.
69. env[:ruote_authenticated] =
70. RuoteRest::Host.authenticate(env['REMOTE_ADDR'])...
71. #
72. # sets
73. #
74. # * true : known and trusted
75. # * nil : known but has to go through further check
76. # * false : not known, block
77. end
* C:/Program Files/ruote-rest/lib/auth.rb: in call
39.
40. def call (env)
41.
42. return @app.call(env) if env[:ruote_authenticated]
43.
44. env.delete(:ruote_authenticated)
45.
46. clear(env)...
47.
48. return @app.call(env) if env[:ruote_authenticated] !=
false
49.
50. env[:auth_response] || [ 401, {}, 'get off !' ]
51. end
52. end
53.
* C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/
showexceptions.rb: in call
17.
18. def initialize(app)
19. @app = app
20. @template = ERB.new(TEMPLATE)
21. end
22.
23. def call(env)
24. @app.call(env)...
25. rescue StandardError, LoadError, SyntaxError => e
26. backtrace = pretty(env, e)
27. [500,
28. {"Content-Type" => "text/html",
29. "Content-Length" => backtrace.join.size.to_s},
30. backtrace]
31. end
* C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/
commonlogger.rb: in _call
13. dup._call(env)
14. end
15.
16. def _call(env)
17. @env = env
18. @logger ||= self
19. @time = Time.now
20. @status, @header, @body = @app.call(env)...
21. [...@status, @header, self]
22. end
23.
24. def close
25. @body.close if @body.respond_to? :close
26. end
27.
* C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/
commonlogger.rb: in call
6. class CommonLogger
7. def initialize(app, logger=nil)
8. @app = app
9. @logger = logger
10. end
11.
12. def call(env)
13. dup._call(env)...
14. end
15.
16. def _call(env)
17. @env = env
18. @logger ||= self
19. @time = Time.now
20. @status, @header, @body = @app.call(env)
* C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/
builder.rb: in call
53. def to_app
54. @ins[-1] = Rack::URLMap.new(@ins.last) if Hash ===
@ins.last
55. inner_app = @ins.last
56. @ins[0...-1].reverse.inject(inner_app) { |a, e| e.call
(a) }
57. end
58.
59. def call(env)
60. to_app.call(env)...
61. end
62. end
63. end
* C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/
content_length.rb: in call
6. include Rack::Utils
7.
8. def initialize(app)
9. @app = app
10. end
11.
12. def call(env)
13. status, headers, body = @app.call(env)...
14. headers = HeaderHash.new(headers)
15.
16. if !STATUS_WITH_NO_ENTITY_BODY.include?(status) &&
17. !headers['Content-Length'] &&
18. !headers['Transfer-Encoding'] &&
19. (body.respond_to?(:to_ary) || body.respond_to?(:to_str))
20.
* C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/
chunked.rb: in call
8. include Rack::Utils
9.
10. def initialize(app)
11. @app = app
12. end
13.
14. def call(env)
15. status, headers, body = @app.call(env)...
16. headers = HeaderHash.new(headers)
17.
18. if env['HTTP_VERSION'] == 'HTTP/1.0' ||
19. STATUS_WITH_NO_ENTITY_BODY.include?(status) ||
20. headers['Content-Length'] ||
21. headers['Transfer-Encoding']
22. [status, headers.to_hash, body]
* C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/
handler/mongrel.rb: in process
54. "rack.run_once" => false,
55.
56. "rack.url_scheme" => "http",
57. })
58. env["QUERY_STRING"] ||= ""
59. env.delete "PATH_INFO" if env["PATH_INFO"] == ""
60.
61. status, headers, body = @app.call(env)...
62.
63. begin
64. response.status = status.to_i
65. response.send_status(nil)
66.
67. headers.each { |k, vs|
68. vs.split("\n").each { |v|
* C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-
mswin32-60/lib/mongrel.rb: in process_client
152. break if request.body == nil # nil signals from
HttpRequest::initialize that the request was aborted
153.
154. # request is good so far, continue processing the response
155. response = HttpResponse.new(client)
156.
157. # Process each handler in registered order until we run
out or one finalizes the response.
158. handlers.each do |handler|
159. handler.process(request, response)...
160. break if response.done or client.closed?
161. end
162.
163. # And finally, if nobody closed the response off, we
finalize it.
164. unless response.done or client.closed?
165. response.finished
166. end
* C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-
mswin32-60/lib/mongrel.rb: in each
151. # in the case of large file uploads the user could close
the socket, so skip those requests
152. break if request.body == nil # nil signals from
HttpRequest::initialize that the request was aborted
153.
154. # request is good so far, continue processing the response
155. response = HttpResponse.new(client)
156.
157. # Process each handler in registered order until we run
out or one finalizes the response.
158. handlers.each do |handler|...
159. handler.process(request, response)
160. break if response.done or client.closed?
161. end
162.
163. # And finally, if nobody closed the response off, we
finalize it.
164. unless response.done or client.closed?
165. response.finished
* C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-
mswin32-60/lib/mongrel.rb: in process_client
151. # in the case of large file uploads the user could close
the socket, so skip those requests
152. break if request.body == nil # nil signals from
HttpRequest::initialize that the request was aborted
153.
154. # request is good so far, continue processing the response
155. response = HttpResponse.new(client)
156.
157. # Process each handler in registered order until we run
out or one finalizes the response.
158. handlers.each do |handler|...
159. handler.process(request, response)
160. break if response.done or client.closed?
161. end
162.
163. # And finally, if nobody closed the response off, we
finalize it.
164. unless response.done or client.closed?
165. response.finished
* C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-
mswin32-60/lib/mongrel.rb: in run
278. worker_list = @workers.list
279.
280. if worker_list.length >= @num_processors
281. STDERR.puts "Server overloaded with #{worker_list.length}
processors (#...@num_processors max). Dropping connection."
282. client.close rescue nil
283. reap_dead_workers("max processors")
284. else
285. thread = Thread.new(client) {|c| process_client(c) }...
286. thread[:started_on] = Time.now
287. @workers.add(thread)
288.
289. sleep @throttle if @throttle > 0
290. end
291. rescue StopServer
292. break
* C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-
mswin32-60/lib/mongrel.rb: in initialize
278. worker_list = @workers.list
279.
280. if worker_list.length >= @num_processors
281. STDERR.puts "Server overloaded with #{worker_list.length}
processors (#...@num_processors max). Dropping connection."
282. client.close rescue nil
283. reap_dead_workers("max processors")
284. else
285. thread = Thread.new(client) {|c| process_client(c) }...
286. thread[:started_on] = Time.now
287. @workers.add(thread)
288.
289. sleep @throttle if @throttle > 0
290. end
291. rescue StopServer
292. break
* C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-
mswin32-60/lib/mongrel.rb: in new
278. worker_list = @workers.list
279.
280. if worker_list.length >= @num_processors
281. STDERR.puts "Server overloaded with #{worker_list.length}
processors (#...@num_processors max). Dropping connection."
282. client.close rescue nil
283. reap_dead_workers("max processors")
284. else
285. thread = Thread.new(client) {|c| process_client(c) }...
286. thread[:started_on] = Time.now
287. @workers.add(thread)
288.
289. sleep @throttle if @throttle > 0
290. end
291. rescue StopServer
292. break
* C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-
mswin32-60/lib/mongrel.rb: in run
278. worker_list = @workers.list
279.
280. if worker_list.length >= @num_processors
281. STDERR.puts "Server overloaded with #{worker_list.length}
processors (#...@num_processors max). Dropping connection."
282. client.close rescue nil
283. reap_dead_workers("max processors")
284. else
285. thread = Thread.new(client) {|c| process_client(c) }...
286. thread[:started_on] = Time.now
287. @workers.add(thread)
288.
289. sleep @throttle if @throttle > 0
290. end
291. rescue StopServer
292. break
* C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-
mswin32-60/lib/mongrel.rb: in initialize
261.
262. configure_socket_options
263.
264. if defined?($tcp_defer_accept_opts) and
$tcp_defer_accept_opts
265. @socket.setsockopt(*$tcp_defer_accept_opts) rescue nil
266. end
267.
268. @acceptor = Thread.new do...
269. begin
270. while true
271. begin
272. client = @socket.accept
273.
274. if defined?($tcp_cork_opts) and $tcp_cork_opts
275. client.setsockopt(*$tcp_cork_opts) rescue nil
* C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-
mswin32-60/lib/mongrel.rb: in new
261.
262. configure_socket_options
263.
264. if defined?($tcp_defer_accept_opts) and
$tcp_defer_accept_opts
265. @socket.setsockopt(*$tcp_defer_accept_opts) rescue nil
266. end
267.
268. @acceptor = Thread.new do...
269. begin
270. while true
271. begin
272. client = @socket.accept
273.
274. if defined?($tcp_cork_opts) and $tcp_cork_opts
275. client.setsockopt(*$tcp_cork_opts) rescue nil
* C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-
mswin32-60/lib/mongrel.rb: in run
261.
262. configure_socket_options
263.
264. if defined?($tcp_defer_accept_opts) and
$tcp_defer_accept_opts
265. @socket.setsockopt(*$tcp_defer_accept_opts) rescue nil
266. end
267.
268. @acceptor = Thread.new do...
269. begin
270. while true
271. begin
272. client = @socket.accept
273.
274. if defined?($tcp_cork_opts) and $tcp_cork_opts
275. client.setsockopt(*$tcp_cork_opts) rescue nil
* C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/
handler/mongrel.rb: in run
27. else
28. raise ArgumentError, "first argument should be a Hash or
URLMap"
29. end
30. else
31. server.register('/', Rack::Handler::Mongrel.new(app))
32. end
33. yield server if block_given?
34. server.run.join...
35. end
36.
37. def initialize(app)
38. @app = Rack::Chunked.new(Rack::ContentLength.new(app))
39. end
40.
41. def process(request, response)
* lib/start.rb: in nil
97. run RuoteRest.build_rack_app(
98. Rack::File.new(File.join(RUOTE_BASE_DIR, 'public')),
99. :environment => $env)
100. end
101.
102. puts ".. [#{Time.now}] ruote-rest listening on port #
{port}"
103.
104. Rack::Handler::Mongrel.run(b, :Port => port) do |server|
The same error is reported after the populate task is executed.
mysql.rake
puts "loaded #{RuoteRest::Host.find(:all).size} hosts"
puts "loaded #{RuoteRest::User.find(:all).size} users"
I would appreciate any help.
Thanks!!
Azu
On Aug 9, 8:57 pm, Kenneth Kalmer <[email protected]> wrote:
> On Sun, Aug 9, 2009 at 8:32 PM, Azu <[email protected]> wrote:
>
> > Hi Kenneth,
>
> > Thanks for your fast reply. Here it is
>
> > C:\Program Files\ruote-rest>rake mysql:setup --trace
> > (in C:/Program Files/ruote-rest)
> > ** Invoke mysql:setup (first_time)
> > ** Execute mysql:setup
> > .. db is 'ruoterest_development'
> > == OpenWFE::Extras::ArWorkitemTables: migrating
> > ==============================
> > -- create_table(:ar_workitems)
> > rake aborted!
> > Packets out of order: 0<>
>
> Hectic, haven't seen this before. A quick Google led me to believe the issue
> can be one of two things. Firstly, the mysql gem isn't 1.9 compatible yet
> (will test this myself to check), and the other is that the mysql gem
> doesn't talk to MySQL 5.1 yet.
>
> My Windows VM is busted, so I can't even replicate the issue for you, sorry.
> Do let us know if you make it past the exception and how you did it so we
> can help others who come across it.
>
> Best
>
> --
> Kenneth Kalmer
> [email protected]http://opensourcery.co.za
> @kennethkalmer
--~--~---------~--~----~------------~-------~--~----~
you received this message because you are subscribed to the "ruote users" group.
to post : send email to [email protected]
to unsubscribe : send email to [email protected]
more options : http://groups.google.com/group/openwferu-users?hl=en
-~----------~----~----~----~------~----~------~--~---