マシューが彼の答えで指摘しているように、これを引き起こしているのはプラグインである可能性があります。彼はattachment_fuが1つの原因であることに気づきました。(画像処理にCore Imageを使用できます。)config/initializers
この行で(Railsアプリケーションの場合)ファイルを作成すると、他の画像プロセッサの1つが必要になりますが、警告が表示されなくなります。
Technoweenie::AttachmentFu.default_processors.delete('CoreImage')
これは私にとって問題ではありません。私はMac以外のサーバーにデプロイしますが、それらはCoreImageを使用できないため、とにかく開発中に同じことを実行したいと思います。
を見ると/System/Library/Frameworks/RubyCocoa.framework/Versions/A/Resources/ruby/osx/
objc/ruby_addition.rb
、これはファイルの下部にあります。
class Thread
class << self
alias :pre_rubycocoa_new :new
# Override Thread.new to prevent threads being created if there isn't
# runtime support for it
def new(*args,&block)
unless defined? @_rubycocoa_threads_allowed then
# If user has explicilty disabled thread support, also disable the
# check (for debugging/testing only)
@_rubycocoa_threads_allowed = ENV['RUBYCOCOA_THREAD_HOOK_DISABLE'] ||
OSX::RBRuntime.isRubyThreadingSupported?
end
if !@_rubycocoa_threads_allowed then
warn "#{caller[0]}: Ruby threads cannot be used in RubyCocoa without patches to the Ruby interpreter"
end
pre_rubycocoa_new(*args,&block)
end
end
end
したがって、最初に警告が表示されますが、それでも元のファイルを呼び出しThread.new
ます。この警告が本当の問題だとは思わない。コンソールで常に表示されるのは面倒です。
モンキーパッチを引き込んでいるものを追跡したい場合は、引き込むThread
ものをgrepしますosx/cocoa
。
$ irb
>> Thread.new { puts 'hi' }
hi=> #<Thread:0x1011328e0 run>
>> require 'osx/cocoa'
=> true
>> Thread.new { puts 'hi' }
(irb):3:in `irb_binding': Ruby threads cannot be used in RubyCocoa without patches to the Ruby interpreter
hi=> #<Thread:0x103bf76e8 run>