Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing redcarpet gem on mavericks

I'm currently trying to install Redcarpet gem for a rails project.

The problem is that a few days ago I upgraded to Mavericks OS and I'm not able to install it, but I'm not really sure if it has anything to do with the change of OS.

Here's the errors I'm getting:

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

Apparently there's a problem with some of the c libraries, however I have no idea how to fix it, I've been googling but haven't found anything useful.

Any help is greatly appreciated, thanks!

like image 310
Waclock Avatar asked Dec 02 '22 21:12

Waclock


2 Answers

Have you tried upgrading to the latest XCode?

You might need to be running XCode version 5.0.1 to compile native extensions under Mavericks. Link.

Edit:

As @Doon points out in his comment, you may need to run

xcode-select --install

to get the latest command-line tools.

like image 156
GladstoneKeep Avatar answered Dec 05 '22 11:12

GladstoneKeep


Ok I finally found out that when I upgraded to 10.9 Mavericks my gcc was broken, so I had to install the command line tools.

How to do it:

1) Open Terminal

2) Type in "xcode-select --install" (without the quotes)

3) Press enter

4) Click on "Install"

That's it!

like image 25
Waclock Avatar answered Dec 05 '22 12:12

Waclock