ruby-on-rails - 在特立独行者上安装 redcarpet gem

标签 ruby-on-rails ruby gem redcarpet osx-mavericks

我目前正在尝试为 Rails 项目安装 Redcarpet gem。

问题是我前几天升级到Mavericks OS后安装不了,但我不确定是不是换了OS有什么关系。

这是我遇到的错误:

ERROR:  Error installing redcarpet:
ERROR: Failed to build gem native extension.

/Users/lalala/.rvm/rubies/ruby-1.9.3-p392/bin/ruby extconf.rb
creating Makefile
make
compiling autolink.c
In file included from autolink.c:17:
buffer.h:23:20: error: stdint.h: No such file or directory
In file included from autolink.c:17:
buffer.h:41: error: expected specifier-qualifier-list before ‘uint8_t’
In file included from autolink.c:18:
autolink.h:31: warning: type defaults to ‘int’ in declaration of ‘uint8_t’
autolink.h:31: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
autolink.h:35: error: expected declaration specifiers or ‘...’ before ‘uint8_t’
autolink.h:39: error: expected declaration specifiers or ‘...’ before ‘uint8_t’
autolink.h:43: error: expected declaration specifiers or ‘...’ before ‘uint8_t’
autolink.c:20:20: error: string.h: No such file or directory
autolink.c:21:20: error: stdlib.h: No such file or directory
autolink.c:22:19: error: stdio.h: No such file or directory
autolink.c:23:19: error: ctype.h: No such file or directory
autolink.c:30: warning: type defaults to ‘int’ in declaration of ‘uint8_t’
autolink.c:30: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
autolink.c:52: error: expected ‘)’ before ‘*’ token
autolink.c:136: error: expected ‘)’ before ‘*’ token
autolink.c:165: error: expected declaration specifiers or ‘...’ before ‘uint8_t’
autolink.c: In function ‘sd_autolink__www’:
autolink.c:172: warning: implicit declaration of function ‘ispunct’
autolink.c:172: error: ‘data’ undeclared (first use in this function)
autolink.c:172: error: (Each undeclared identifier is reported only once
autolink.c:172: error: for each function it appears in.)
autolink.c:172: warning: implicit declaration of function ‘isspace’
autolink.c:175: warning: implicit declaration of function ‘memcmp’
autolink.c:175: warning: implicit declaration of function ‘strlen’
autolink.c:175: warning: incompatible implicit declaration of built-in function ‘strlen’
autolink.c:178: warning: implicit declaration of function ‘check_domain’
autolink.c:186: warning: implicit declaration of function ‘autolink_delim’
autolink.c: At top level:
autolink.c:201: error: expected declaration specifiers or ‘...’ before ‘uint8_t’
autolink.c: In function ‘sd_autolink__email’:
autolink.c:210: error: ‘uint8_t’ undeclared (first use in this function)
autolink.c:210: error: expected ‘;’ before ‘c’
autolink.c:212: warning: implicit declaration of function ‘isalnum’
autolink.c:212: error: ‘c’ undeclared (first use in this function)
autolink.c:215: warning: implicit declaration of function ‘strchr’
autolink.c:215: warning: incompatible implicit declaration of built-in function ‘strchr’
autolink.c:225: error: expected ‘;’ before ‘c’
autolink.c:241: error: ‘data’ undeclared (first use in this function)
autolink.c: At top level:
autolink.c:256: error: expected declaration specifiers or ‘...’ before ‘uint8_t’
autolink.c: In function ‘sd_autolink__url’:
autolink.c:263: error: ‘data’ undeclared (first use in this function)
autolink.c:266: warning: implicit declaration of function ‘isalpha’
autolink.c:269: warning: implicit declaration of function ‘sd_autolink_issafe’
autolink.c:272: warning: incompatible implicit declaration of built-in function ‘strlen’
make: *** [autolink.o] Error 1

显然某些 c 库存在问题,但我不知道如何解决它,我一直在谷歌搜索但没有找到任何有用的东西。

非常感谢任何帮助,谢谢!

最佳答案

您是否尝试过升级到最新的 XCode?

您可能需要运行 XCode 5.0.1 版才能在 Mavericks 下编译 native 扩展。 Link .

编辑:

正如@Doon 在他的评论中指出的那样,您可能需要运行

xcode-select --install

获取最新的命令行工具。

关于ruby-on-rails - 在特立独行者上安装 redcarpet gem,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19579640/

相关文章:

ruby-on-rails - 如何在 Stripe (Rails) 中创建费用和客户

ruby - Bundler:找到哪个 gem 依赖于此?

ruby - 寻找通过阅读代码确定编程语言的ruby gem?

ruby-on-rails - 使用 rabl 时更改响应状态代码

ruby-on-rails - 应用程序布局文件中的 Controller 相关标题 - Ruby on Rails

mysql - 事件记录 (Rails) MySQL 安全连接

ruby-on-rails - 如何使用 Rails 中的 Paperclip 将文件系统中的图像添加到模型中?

javascript - 如何在 RoR 4 中向浏览器发送 DELETE 请求

html - 哈姆:是给谁的?

ruby-on-rails-3 - Gem 测试无法使用 url_for 找到路线