rake db:migrate错误(未找到功能“ inotify_init”) [英] rake db:migrate error (Function 'inotify_init' not found)
问题描述
我只是完成了在旧Mac电脑上设置我的Rails环境并遇到此错误。我已经安装了FFI和rb-inotify。我还再次运行了捆绑安装。我看过了
编辑5:我已经一直在查看。它建议这样做:
gem'libnotify'if / linux / =〜RUBY_PLATFORM
gem'growl'if / darwin / =〜RUBY_PLATFORM
本质上,我团队中的某个人添加了特定于Linux的安装内容。要解决此问题,请执行以下操作:
对于rb-inotify东西,请执行以下操作:
group:development do
gem'rb-inotify',:require =>假
宝石 rb-fsevent,:require =>假
宝石 rb-fchange,:require => false
end
如果您拥有libnotify,请执行以下操作:
gem'libnotify'如果/ linux / =〜RUBY_PLATFORM
gem'growl'如果/ darwin / =〜RUBY_PLATFORM
为我工作,编码愉快!
I just got done setting up my rails environment on my old mac book and ran into this error. I've installed FFI and rb-inotify. I've also ran bundle install again. I've looked at
https://github.com/ffi/ffi/issues/66
and
https://groups.google.com/forum/?fromgroups=#!topic/ruby-ffi/gj3_k34o80k
which both indicate that this is a linux specific API. There is a suggestion on the second of those links that says I should just remove that gem and things that depend on it, but I am hesitant to remove FFI which seems to depend on it.
What course of action do you suggest? Any advice on this matter is greatly appreciated.
EDIT: I'm running rails 3.2.7 (updating to 3.2.11 tonight).
EDIT 2: I found this: Rubygems: How do I add platform-specific dependency?. Is this helpful?
EDIT 3: Do you think it might have something to do with rbenv?
EDIT 4: I changed my development gem from rb-inotify to rb-fsevent, ran bundle install then did db:migrate.
And it continues to run the migration.
Hmmm... I'm asking my team members that use macs have tried executing rake db:migrate since our Linux developer added rb-inotify to our gem set.
This link may be helpful to someone who comes this way: https://supportbee.com/devblog/2012/07/18/using-platform-dependent-gems-rb-inotify-and-rb-fsevent/
EDIT 5: I've been looking at the guard gem, specifically this part:
I added this, and it will perform the rake db:migrate, but I still get a list of errors very similar to:
Could not open library 'libgtk-x11-2.0': dlopen(libgtk-x11-2.0, 13): image not found.
I think I'm progressing to a full solution!
EDIT 7: Look at this stackoverflow question for the remaining errors due to the libnotify gem: Image Not Found Errors after Upgrade to Rails 3.1, how to fix?. It suggests doing this:
gem 'libnotify' if /linux/ =~ RUBY_PLATFORM
gem 'growl' if /darwin/ =~ RUBY_PLATFORM
Essentially, someone on my team added Linux specific installation of some stuff. To fix it, do the following:
For rb-inotify stuff, do this:
group :development do
gem 'rb-inotify', :require => false
gem 'rb-fsevent', :require => false
gem 'rb-fchange', :require => false
end
If you have libnotify, do this:
gem 'libnotify' if /linux/ =~ RUBY_PLATFORM
gem 'growl' if /darwin/ =~ RUBY_PLATFORM
Worked for me, happy coding!
这篇关于rake db:migrate错误(未找到功能“ inotify_init”)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!