Closed kamstrup closed 6 years ago
hello @kamstrup and thanks for trying angelo!
i can't seem to repro this problem:
$ ruby example/classic.rb
I, [2017-09-20T13:09:54.199474 #40768] INFO -- : Celluloid 0.17.3 is running in BACKPORTED mode. [ http://git.io/vJf3J ]
I, [2017-09-20T13:09:54.381177 #40768] INFO -- : Angelo 0.5.0
I, [2017-09-20T13:09:54.381219 #40768] INFO -- : listening on 127.0.0.1:4567
I, [2017-09-20T13:09:55.748310 #40768] INFO -- : 127.0.0.1 - - "GET / HTTP/1.1" 200 2
after reading the error you pasted, and looking at my 2.3.5 version of forwardable.rb, i'm curious if you have local changes to that file? maybe something that tries to send :method_defined?
to an instance?
for reference, this is what my forwardable.rb:182 looks like:
https://github.com/ruby/ruby/blob/trunk/lib/forwardable.rb#L180-L185
My forwardable.rb#180-185 looks like this:
180 def def_instance_delegator(accessor, method, ali = method)
181 accessor = accessor.to_s
182 if method_defined?(accessor) || private_method_defined?(accessor)
183 accessor = "#{accessor}()"
184 end
185
186 line_no = __LINE__; str = %{
187 def #{ali}(*args, &block)
188 begin
189 #{accessor}.__send__(:#{method}, *args, &block)
190 rescue ::Exception
191 $@.delete_if{|s| ::Forwardable::FILE_REGEXP =~ s} unless ::Forwardable::debug
192 ::Kernel::raise
193 end
194 end
195 }
196 # If it's not a class or module, it's an instance
197 begin
198 module_eval(str, __FILE__, line_no)
199 rescue
200 instance_eval(str, __FILE__, line_no)
201 end
202
203 end
This is the stock ruby (2.3.3) install on Ubuntu 17.04, definitely not modified unless there are distropatches, which sounds unlikely. But it looks like the entire implementation of def_instance_delegator
between 2.3.3 and 2.3.5 then...
Indeed, vanilla Ruby 2.3.3 seems to be what I have (this is the code in the v2_3_3 tag) https://github.com/ruby/ruby/blob/c91cb76f8d84b2963f6ede2ef445ad46a6104216/lib/forwardable.rb#L180-L203
Aha! Some git blaming later https://bugs.ruby-lang.org/issues/12478
@kamstrup thanks for investigating! if you can upgrade ruby versions, it sounds like that will fix it. please let me know if you have any more trouble.
When I try to start a classic mode app I get the following:
I am using angelo 0.5.0 and starting it with
bundle exec ruby application.rb
.If I convert to the class based solution everything works fine.