使用brew安装的gd.h但在rails服务器上找不到

时间:2015-12-17 18:48:53

标签: ruby-on-rails ruby gd homebrew

初学者。我正在尝试为我当前的rails项目安装gd。我安装了brew,brew install gd成功运行。但是,当我运行rails s时,出现错误'gd.h' file not found

    /Users/oatmeeel/.ruby_inline/ruby-2.0.0/Inline_FastImage_bbac2b6030874ea47494fd3952895412.c:2:10: fatal error: 
      'gd.h' file not found
#include "gd.h"
         ^
1 error generated.
/Library/Ruby/Gems/2.0.0/gems/RubyInline-3.12.4/lib/inline.rb:618:in `build': error executing "xcrun clang -dynamic -bundle  -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress   -g -Os -pipe -DHAVE_GCC_SYNC_BUILTINS -L. -L/usr/local/lib -I /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0 -I /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/universal-darwin15 -I /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include -L/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib -o \"/Users/oatmeeel/.ruby_inline/ruby-2.0.0/Inline_FastImage_bbac2b6030874ea47494fd3952895412.bundle\" \"/Users/oatmeeel/.ruby_inline/ruby-2.0.0/Inline_FastImage_bbac2b6030874ea47494fd3952895412.c\" -lgd ": pid 12461 exit 1 (CompilationError)
Renamed /Users/oatmeeel/.ruby_inline/ruby-2.0.0/Inline_FastImage_bbac2b6030874ea47494fd3952895412.c to /Users/oatmeeel/.ruby_inline/ruby-2.0.0/Inline_FastImage_bbac2b6030874ea47494fd3952895412.c.bad
    from /Library/Ruby/Gems/2.0.0/gems/RubyInline-3.12.4/lib/inline.rb:856:in `inline'
    from /Library/Ruby/Gems/2.0.0/gems/fastimage_resize-2.0.3/lib/fastimage_resize.rb:116:in `<class:FastImage>'
    from /Library/Ruby/Gems/2.0.0/gems/fastimage_resize-2.0.3/lib/fastimage_resize.rb:34:in `<top (required)>'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `require'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `each'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `block in require'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `each'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `require'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler.rb:134:in `require'
    from /Users/oatmeeel/Documents/Hangr/swip/config/application.rb:11:in `<top (required)>'
    from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:78:in `require'
    from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:78:in `block in server'
    from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:75:in `tap'
    from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:75:in `server'
    from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
    from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.4/lib/rails/commands.rb:17:in `<top (required)>'
    from /Users/oatmeeel/Documents/Hangr/swip/bin/rails:9:in `require'
    from /Users/oatmeeel/Documents/Hangr/swip/bin/rails:9:in `<top (required)>'
    from /Library/Ruby/Gems/2.0.0/gems/spring-1.5.0/lib/spring/client/rails.rb:28:in `load'
    from /Library/Ruby/Gems/2.0.0/gems/spring-1.5.0/lib/spring/client/rails.rb:28:in `call'
    from /Library/Ruby/Gems/2.0.0/gems/spring-1.5.0/lib/spring/client/command.rb:7:in `call'
    from /Library/Ruby/Gems/2.0.0/gems/spring-1.5.0/lib/spring/client.rb:28:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/spring-1.5.0/bin/spring:49:in `<top (required)>'
    from /Library/Ruby/Gems/2.0.0/gems/spring-1.5.0/lib/spring/binstub.rb:11:in `load'
    from /Library/Ruby/Gems/2.0.0/gems/spring-1.5.0/lib/spring/binstub.rb:11:in `<top (required)>'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/oatmeeel/Documents/Hangr/swip/bin/spring:13:in `<top (required)>'
    from bin/rails:3:in `load'
    from bin/rails:3:in `<main>'

任何线索?请帮帮我!

谢谢

1 个答案:

答案 0 :(得分:0)

知道了!

我删除了fastimage宝石,现在它正常工作。显然,它在部署方面效果不佳。