我完全坚持这个。在依赖于cairo的rails app上运行ruby。从Mac OS X Mavericks升级到Yosemite并进行捆绑安装后,无法安装cairo gem。我试过玩4.2(苹果的捆绑修补版本)与4.8和4.9之间的gcc版本没有运气。欢迎任何想法......
sudo gem install cairo 密码:
Fetching: pkg-config-1.1.5.gem (100%)
Successfully installed pkg-config-1.1.5
Fetching: cairo-1.12.9.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing cairo:
ERROR: Failed to build gem native extension.
/Users/Ben/.rvm/rubies/ruby-1.9.3-p550/bin/ruby -r ./siteconf20141110-82223-1dv66fm.rb extconf.rb
checking for GCC... yes
checking for Win32 OS... no
checking for cairo version (>= 1.2.0)... yes
checking for Mac OS X... yes
checking for HAVE_RUBY_ST_H in ruby.h... yes
checking for HAVE_RUBY_IO_H in ruby.h... yes
checking for rb_errinfo() in ruby.h... yes
checking for enum ruby_value_type in ruby.h... yes
creating Makefile
make clean
make
compiling rb_cairo.c
couldn't understand kern.osversion `14.0.0'
rb_cairo.c: In function ‘rb_cairo_satisfied_version’:
rb_cairo.c:31: warning: unused parameter ‘self’
compiling rb_cairo_constants.c
couldn't understand kern.osversion `14.0.0'
rb_cairo_constants.c: In function ‘rb_cairo_operator_from_ruby_object’:
rb_cairo_constants.c:152: warning: comparison of unsigned expression < 0 is always false
rb_cairo_constants.c: In function ‘rb_cairo_antialias_from_ruby_object’:
rb_cairo_constants.c:153: warning: comparison of unsigned expression < 0 is always false
rb_cairo_constants.c: In function ‘rb_cairo_fill_rule_from_ruby_object’:
rb_cairo_constants.c:154: warning: comparison of unsigned expression < 0 is always false
rb_cairo_constants.c: In function ‘rb_cairo_line_cap_from_ruby_object’:
rb_cairo_constants.c:155: warning: comparison of unsigned expression < 0 is always false
rb_cairo_constants.c: In function ‘rb_cairo_line_join_from_ruby_object’:
rb_cairo_constants.c:156: warning: comparison of unsigned expression < 0 is always false
rb_cairo_constants.c: In function ‘rb_cairo_font_slant_from_ruby_object’:
rb_cairo_constants.c:157: warning: comparison of unsigned expression < 0 is always false
rb_cairo_constants.c: In function ‘rb_cairo_font_weight_from_ruby_object’:
rb_cairo_constants.c:158: warning: comparison of unsigned expression < 0 is always false
rb_cairo_constants.c: In function ‘rb_cairo_subpixel_order_from_ruby_object’:
rb_cairo_constants.c:159: warning: comparison of unsigned expression < 0 is always false
rb_cairo_constants.c: In function ‘rb_cairo_hint_style_from_ruby_object’:
rb_cairo_constants.c:160: warning: comparison of unsigned expression < 0 is always false
rb_cairo_constants.c: In function ‘rb_cairo_hint_metrics_from_ruby_object’:
rb_cairo_constants.c:161: warning: comparison of unsigned expression < 0 is always false
rb_cairo_constants.c: In function ‘rb_cairo_path_data_type_from_ruby_object’:
rb_cairo_constants.c:162: warning: comparison of unsigned expression < 0 is always false
rb_cairo_constants.c: In function ‘rb_cairo_extend_from_ruby_object’:
rb_cairo_constants.c:165: warning: comparison of unsigned expression < 0 is always false
rb_cairo_constants.c: In function ‘rb_cairo_filter_from_ruby_object’:
rb_cairo_constants.c:166: warning: comparison of unsigned expression < 0 is always false
rb_cairo_constants.c: In function ‘rb_cairo_svg_version_from_ruby_object’:
rb_cairo_constants.c:168: warning: comparison of unsigned expression < 0 is always false
rb_cairo_constants.c: In function ‘rb_cairo_ps_level_from_ruby_object’:
rb_cairo_constants.c:173: warning: comparison of unsigned expression < 0 is always false
rb_cairo_constants.c: In function ‘rb_cairo_pdf_version_from_ruby_object’:
rb_cairo_constants.c:180: warning: comparison of unsigned expression < 0 is always false
rb_cairo_constants.c: In function ‘rb_cairo_text_cluster_flags_from_ruby_object’:
rb_cairo_constants.c:186: warning: comparison of unsigned expression < 0 is always false
rb_cairo_constants.c: In function ‘rb_cairo_script_mode_from_ruby_object’:
rb_cairo_constants.c:190: warning: comparison of unsigned expression < 0 is always false
rb_cairo_constants.c: In function ‘rb_cairo_region_overlap_from_ruby_object’:
rb_cairo_constants.c:194: warning: comparison of unsigned expression < 0 is always false
rb_cairo_constants.c: In function ‘cr_svg_get_versions’:
rb_cairo_constants.c:208: warning: unused parameter ‘self’
rb_cairo_constants.c: In function ‘cr_svg_version_to_string’:
rb_cairo_constants.c:227: warning: unused parameter ‘self’
rb_cairo_constants.c: In function ‘cr_format_stride_for_width’:
rb_cairo_constants.c:246: warning: unused parameter ‘self’
rb_cairo_constants.c: In function ‘cr_ps_get_levels’:
rb_cairo_constants.c:256: warning: unused parameter ‘self’
rb_cairo_constants.c: In function ‘cr_ps_level_to_string’:
rb_cairo_constants.c:274: warning: unused parameter ‘self’
rb_cairo_constants.c: In function ‘cr_pdf_get_versions’:
rb_cairo_constants.c:293: warning: unused parameter ‘self’
rb_cairo_constants.c: In function ‘cr_pdf_version_to_string’:
rb_cairo_constants.c:311: warning: unused parameter ‘self’
compiling rb_cairo_context.c
couldn't understand kern.osversion `14.0.0'
rb_cairo_context.c: In function ‘cr_destroy_all_guarded_contexts_at_end_iter’:
rb_cairo_context.c:1496: warning: unused parameter ‘value’
rb_cairo_context.c:1496: warning: unused parameter ‘data’
rb_cairo_context.c: In function ‘cr_destroy_all_guarded_contexts_at_end’:
rb_cairo_context.c:1503: warning: unused parameter ‘data’
compiling rb_cairo_device.c
couldn't understand kern.osversion `14.0.0'
rb_cairo_device.c: In function ‘cr_device_script_supported_p’:
rb_cairo_device.c:100: warning: unused parameter ‘klass’
rb_cairo_device.c: In function ‘cr_device_xml_supported_p’:
rb_cairo_device.c:110: warning: unused parameter ‘klass’
rb_cairo_device.c: In function ‘cr_device_initialize’:
rb_cairo_device.c:192: warning: unused parameter ‘argc’
rb_cairo_device.c:192: warning: unused parameter ‘argv’
rb_cairo_device.c: In function ‘cr_finish_all_guarded_devices_at_end_iter’:
rb_cairo_device.c:262: warning: unused parameter ‘value’
rb_cairo_device.c:262: warning: unused parameter ‘data’
rb_cairo_device.c: In function ‘cr_finish_all_guarded_devices_at_end’:
rb_cairo_device.c:269: warning: unused parameter ‘data’
compiling rb_cairo_exception.c
couldn't understand kern.osversion `14.0.0'
rb_cairo_exception.c: In function ‘rb_cairo_check_status’:
rb_cairo_exception.c:70: warning: enumeration value ‘CAIRO_STATUS_JBIG2_GLOBAL_MISSING’ not handled in switch
compiling rb_cairo_font_extents.c
couldn't understand kern.osversion `14.0.0'
compiling rb_cairo_font_face.c
couldn't understand kern.osversion `14.0.0'
compiling rb_cairo_font_options.c
couldn't understand kern.osversion `14.0.0'
compiling rb_cairo_glyph.c
couldn't understand kern.osversion `14.0.0'
compiling rb_cairo_io.c
couldn't understand kern.osversion `14.0.0'
compiling rb_cairo_matrix.c
couldn't understand kern.osversion `14.0.0'
rb_cairo_matrix.c: In function ‘cr_matrix_init_identity’:
rb_cairo_matrix.c:86: warning: unused parameter ‘self’
rb_cairo_matrix.c: In function ‘cr_matrix_init_translate’:
rb_cairo_matrix.c:94: warning: unused parameter ‘self’
rb_cairo_matrix.c: In function ‘cr_matrix_init_scale’:
rb_cairo_matrix.c:102: warning: unused parameter ‘self’
rb_cairo_matrix.c: In function ‘cr_matrix_init_rotate’:
rb_cairo_matrix.c:110: warning: unused parameter ‘self’
compiling rb_cairo_path.c
couldn't understand kern.osversion `14.0.0'
rb_cairo_path.c: In function ‘cr_path_move_to_initialize’:
rb_cairo_path.c:139: warning: unused parameter ‘self’
rb_cairo_path.c: In function ‘cr_path_line_to_initialize’:
rb_cairo_path.c:158: warning: unused parameter ‘self’
rb_cairo_path.c: In function ‘cr_path_curve_to_initialize’:
rb_cairo_path.c:177: warning: unused parameter ‘self’
rb_cairo_path.c: In function ‘cr_path_close_path_initialize’:
rb_cairo_path.c:213: warning: unused parameter ‘self’
compiling rb_cairo_pattern.c
couldn't understand kern.osversion `14.0.0'
rb_cairo_pattern.c: In function ‘cr_pattern_solid_supported_p’:
rb_cairo_pattern.c:87: warning: unused parameter ‘klass’
rb_cairo_pattern.c: In function ‘cr_pattern_surface_supported_p’:
rb_cairo_pattern.c:93: warning: unused parameter ‘klass’
rb_cairo_pattern.c: In function ‘cr_pattern_gradient_supported_p’:
rb_cairo_pattern.c:99: warning: unused parameter ‘klass’
rb_cairo_pattern.c: In function ‘cr_pattern_linear_supported_p’:
rb_cairo_pattern.c:105: warning: unused parameter ‘klass’
rb_cairo_pattern.c: In function ‘cr_pattern_radial_supported_p’:
rb_cairo_pattern.c:111: warning: unused parameter ‘klass’
rb_cairo_pattern.c: In function ‘cr_pattern_mesh_supported_p’:
rb_cairo_pattern.c:117: warning: unused parameter ‘klass’
rb_cairo_pattern.c: In function ‘cr_pattern_raster_source_supported_p’:
rb_cairo_pattern.c:127: warning: unused parameter ‘klass’
rb_cairo_pattern.c: In function ‘cr_pattern_initialize’:
rb_cairo_pattern.c:180: warning: unused parameter ‘argc’
rb_cairo_pattern.c:180: warning: unused parameter ‘argv’
rb_cairo_pattern.c: In function ‘cr_mesh_pattern_set_control_point’:
rb_cairo_pattern.c:598: warning: comparison of unsigned expression >= 0 is always true
rb_cairo_pattern.c: In function ‘cr_mesh_pattern_set_corner_color_generic’:
rb_cairo_pattern.c:628: warning: comparison of unsigned expression >= 0 is always true
rb_cairo_pattern.c: In function ‘cr_mesh_pattern_get_corner_color’:
rb_cairo_pattern.c:692: warning: comparison of unsigned expression >= 0 is always true
rb_cairo_pattern.c: In function ‘cr_mesh_pattern_get_control_point’:
rb_cairo_pattern.c:726: warning: comparison of unsigned expression >= 0 is always true
rb_cairo_pattern.c: In function ‘cr_raster_source_acquire_callback’:
rb_cairo_pattern.c:748: warning: unused parameter ‘pattern’
rb_cairo_pattern.c: In function ‘cr_raster_source_release_callback’:
rb_cairo_pattern.c:781: warning: unused parameter ‘pattern’
rb_cairo_pattern.c: In function ‘cr_raster_source_snapshot_callback’:
rb_cairo_pattern.c:830: warning: unused parameter ‘pattern’
rb_cairo_pattern.c: In function ‘cr_raster_source_copy_callback’:
rb_cairo_pattern.c:854: warning: unused parameter ‘pattern’
rb_cairo_pattern.c:856: warning: unused parameter ‘other’
rb_cairo_pattern.c: In function ‘cr_raster_source_finish_callback’:
rb_cairo_pattern.c:879: warning: unused parameter ‘pattern’
compiling rb_cairo_private.c
couldn't understand kern.osversion `14.0.0'
compiling rb_cairo_rectangle.c
couldn't understand kern.osversion `14.0.0'
compiling rb_cairo_region.c
couldn't understand kern.osversion `14.0.0'
compiling rb_cairo_scaled_font.c
couldn't understand kern.osversion `14.0.0'
compiling rb_cairo_surface.c
couldn't understand kern.osversion `14.0.0'
In file included from /System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:55,
from /System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h:23,
from /usr/local/Cellar/cairo/1.14.0/include/cairo/cairo-quartz.h:43,
from rb_cairo_surface.c:54:
/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h:262: error: expected ‘,’ or ‘}’ before ‘__attribute__’
/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h:414: error: expected ‘,’ or ‘}’ before ‘__attribute__’
rb_cairo_surface.c: In function ‘cr_surface_image_supported_p’:
rb_cairo_surface.c:230: warning: unused parameter ‘klass’
rb_cairo_surface.c: In function ‘cr_surface_pdf_supported_p’:
rb_cairo_surface.c:236: warning: unused parameter ‘klass’
rb_cairo_surface.c: In function ‘cr_surface_ps_supported_p’:
rb_cairo_surface.c:246: warning: unused parameter ‘klass’
rb_cairo_surface.c: In function ‘cr_surface_quartz_supported_p’:
rb_cairo_surface.c:256: warning: unused parameter ‘klass’
rb_cairo_surface.c: In function ‘cr_surface_win32_supported_p’:
rb_cairo_surface.c:266: warning: unused parameter ‘klass’
rb_cairo_surface.c: In function ‘cr_surface_svg_supported_p’:
rb_cairo_surface.c:276: warning: unused parameter ‘klass’
rb_cairo_surface.c: In function ‘cr_surface_win32_printing_supported_p’:
rb_cairo_surface.c:286: warning: unused parameter ‘klass’
rb_cairo_surface.c: In function ‘cr_surface_quartz_image_supported_p’:
rb_cairo_surface.c:296: warning: unused parameter ‘klass’
rb_cairo_surface.c: In function ‘cr_surface_script_supported_p’:
rb_cairo_surface.c:306: warning: unused parameter ‘klass’
rb_cairo_surface.c: In function ‘cr_surface_recording_supported_p’:
rb_cairo_surface.c:316: warning: unused parameter ‘klass’
rb_cairo_surface.c: In function ‘cr_surface_gl_supported_p’:
rb_cairo_surface.c:326: warning: unused parameter ‘klass’
rb_cairo_surface.c: In function ‘cr_surface_tee_supported_p’:
rb_cairo_surface.c:342: warning: unused parameter ‘klass’
rb_cairo_surface.c: In function ‘cr_surface_xml_supported_p’:
rb_cairo_surface.c:352: warning: unused parameter ‘klass’
rb_cairo_surface.c: In function ‘cr_surface_initialize’:
rb_cairo_surface.c:432: warning: unused parameter ‘argc’
rb_cairo_surface.c:432: warning: unused parameter ‘argv’
rb_cairo_surface.c: In function ‘cr_image_surface_create’:
rb_cairo_surface.c:923: warning: unused parameter ‘self’
rb_cairo_surface.c: In function ‘cr_image_surface_create_for_data’:
rb_cairo_surface.c:933: warning: unused parameter ‘self’
rb_cairo_surface.c: In function ‘cr_quartz_surface_initialize’:
rb_cairo_surface.c:1264: warning: assignment makes pointer from integer without a cast
rb_cairo_surface.c: In function ‘cr_quartz_image_surface_initialize’:
rb_cairo_surface.c:1476: warning: implicit declaration of function ‘cairo_quartz_image_surface_create’
rb_cairo_surface.c:1476: warning: assignment makes pointer from integer without a cast
rb_cairo_surface.c: In function ‘cr_quartz_image_surface_get_image’:
rb_cairo_surface.c:1489: warning: implicit declaration of function ‘cairo_quartz_image_surface_get_image’
rb_cairo_surface.c:1489: warning: assignment makes pointer from integer without a cast
rb_cairo_surface.c: In function ‘cr_finish_all_guarded_surfaces_at_end_iter’:
rb_cairo_surface.c:1904: warning: unused parameter ‘value’
rb_cairo_surface.c:1904: warning: unused parameter ‘data’
rb_cairo_surface.c: In function ‘cr_finish_all_guarded_surfaces_at_end’:
rb_cairo_surface.c:1911: warning: unused parameter ‘data’
make: *** [rb_cairo_surface.o] Error 1
make failed,退出代码2
Gem文件将保留在/Users/Ben/.rvm/rubies/ruby-1.9.3-p550/lib/ruby/gems/1.9.1/gems/cairo-1.12.9中进行检查。 结果记录到/Users/Ben/.rvm/rubies/ruby-1.9.3-p550/lib/ruby/gems/1.9.1/extensions/x86_64-darwin-14/1.9.1/cairo-1.12.9/gem_make .OUT
答案 0 :(得分:0)
我能够通过安装macports来解决这个问题
https://www.macports.org/install.php
然后直接安装cairo http://cairographics.org/download/
sudo port install cairo
然后gem install cairo工作。