从 Rails 4.1 升级到 4.2 ffi/rb-inotify 问题
Upgrading from Rails 4.1 to 4.2 Issue with ffi/rb-inotify
正在将我的 Rails 4.1 应用程序迁移到 Rails 4.2。最后通过将 rb-inotify 固定到版本 0.9.1 来构建它(0.10.1 不构建,需要 Ruby >= 2.2;实际上从 0.9.1 到 0.9.10 的任何版本都给出相同的结果,但是0.9.1 是与 4.1) 一起加载的版本。当我 运行 "rails c" 我得到:
/Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/ffi-1.9.6/lib/ffi/library.rb:261:in `attach_function': Function 'inotify_init' not found in [libc.dylib] (FFI::NotFoundError)
from /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/rb-inotify-0.9.1/lib/rb-inotify/native.rb:24:in `<module:Native>'
from /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/rb-inotify-0.9.1/lib/rb-inotify/native.rb:9:in `<module:INotify>'
from /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/rb-inotify-0.9.1/lib/rb-inotify/native.rb:3:in `<top (required)>'
from /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/rb-inotify-0.9.1/lib/rb-inotify.rb:1:in `require'
from /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/rb-inotify-0.9.1/lib/rb-inotify.rb:1:in `<top (required)>'
from /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `require'
from /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `each'
from /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `block in require'
from /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `each'
from /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `require'
from /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/bundler-1.10.6/lib/bundler.rb:134:in `require'
from /Users/jackrg/Documents/Novelty-Stats/config/application.rb:7:in `<top (required)>'
from /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:141:in `require'
from /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:141:in `require_application_and_environment!'
from /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:67:in `console'
from /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/railties-4.2.0/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
这是因为我正在使用最新版本的 SASS。当我将 Gemfile 更改为将 sass 和 sass-rails 固定到旧版本时,这个问题就消失了。很难找到依赖项,但我使用 中的 DependencyTree 找到了它。
正在将我的 Rails 4.1 应用程序迁移到 Rails 4.2。最后通过将 rb-inotify 固定到版本 0.9.1 来构建它(0.10.1 不构建,需要 Ruby >= 2.2;实际上从 0.9.1 到 0.9.10 的任何版本都给出相同的结果,但是0.9.1 是与 4.1) 一起加载的版本。当我 运行 "rails c" 我得到:
/Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/ffi-1.9.6/lib/ffi/library.rb:261:in `attach_function': Function 'inotify_init' not found in [libc.dylib] (FFI::NotFoundError)
from /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/rb-inotify-0.9.1/lib/rb-inotify/native.rb:24:in `<module:Native>'
from /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/rb-inotify-0.9.1/lib/rb-inotify/native.rb:9:in `<module:INotify>'
from /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/rb-inotify-0.9.1/lib/rb-inotify/native.rb:3:in `<top (required)>'
from /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/rb-inotify-0.9.1/lib/rb-inotify.rb:1:in `require'
from /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/rb-inotify-0.9.1/lib/rb-inotify.rb:1:in `<top (required)>'
from /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `require'
from /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `each'
from /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `block in require'
from /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `each'
from /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `require'
from /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/bundler-1.10.6/lib/bundler.rb:134:in `require'
from /Users/jackrg/Documents/Novelty-Stats/config/application.rb:7:in `<top (required)>'
from /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:141:in `require'
from /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:141:in `require_application_and_environment!'
from /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:67:in `console'
from /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /Users/jackrg/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/railties-4.2.0/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
这是因为我正在使用最新版本的 SASS。当我将 Gemfile 更改为将 sass 和 sass-rails 固定到旧版本时,这个问题就消失了。很难找到依赖项,但我使用