Skip to content

Instantly share code, notes, and snippets.

@mperham
Last active November 5, 2020 13:20
Show Gist options
  • Save mperham/352e45cf6db7975d315d00e3d44c4ca7 to your computer and use it in GitHub Desktop.
Save mperham/352e45cf6db7975d315d00e3d44c4ca7 to your computer and use it in GitHub Desktop.
❯ make runruby
./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext -- --disable-gems ./test.rb
<internal:ractor>:38: warning: Ractor is experimental, and the behavior may change in future versions of Ruby! Also there are many implementation issues.
#<Thread:0x00007fadd701fa90 run> terminated with exception (report_on_exception is true):
<internal:ractor>:124:in `take': thrown by remote Ractor. (Ractor::RemoteError)
from ./test.rb:11:in `<main>'
./test.rb:5:in `logger': can not access instance variables of classes/modules from non-main Ractors (RuntimeError)
from ./test.rb:10:in `block in <main>'
make: *** [runruby] Error 1
require 'logger'
class Rails
def self.logger
@logger ||= Logger.new(STDOUT)
end
end
Ractor.new do
Rails.logger.info "Hello"
end.take
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment