Error when installing json gem for ruby 2.0 - ruby-on-rails

I'm running ruby 2.0.0p0 on Mac OSX 10.9 and trying to installing the gem json but keep getting an error message that it has failed to build the gem native extension.
I attempted to update the rubygems with: gem update --system but still get the same error message.
Do I need to possibly install a different version of json (other than 1.8.1) for the version of ruby I am running?
Here is the full output in case that helps to see the issue:
Building native extensions. This could take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/bin/ruby extconf.rb
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling generator.c
In file included from /Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby.h:33,
from ../fbuffer/fbuffer.h:5,
from generator.c:1:
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/ruby.h:51:21: error: string.h: No such file or directory
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/ruby.h:61:21: error: stdint.h: No such file or directory
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/ruby.h:64:23: error: inttypes.h: No such file or directory
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/ruby.h:68:19: error: stdio.h: No such file or directory
In file included from /Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/ruby.h:70,
from /Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby.h:33,
from ../fbuffer/fbuffer.h:5,
from generator.c:1:
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/defines.h:29:21: error: stdlib.h: No such file or directory
In file included from /Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/ruby.h:194,
from /Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby.h:33,
from ../fbuffer/fbuffer.h:5,
from generator.c:1:
/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/limits.h:10:25: error: limits.h: No such file or directory
In file included from /Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/ruby.h:1566,
from /Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby.h:33,
from ../fbuffer/fbuffer.h:5,
from generator.c:1:
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/missing.h:23:45: error: math.h: No such file or directory
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/missing.h:29:24: error: sys/time.h: No such file or directory
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/missing.h:38:25: error: sys/types.h: No such file or directory
In file included from /Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/ruby.h:1566,
from /Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby.h:33,
from ../fbuffer/fbuffer.h:5,
from generator.c:1:
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/missing.h:57: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__syscall’
In file included from /Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:34,
from /Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/ruby.h:1567,
from /Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby.h:33,
from ../fbuffer/fbuffer.h:5,
from generator.c:1:
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/st.h:140: error: expected declaration specifiers or ‘...’ before ‘uint32_t’
In file included from /Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/ruby.h:1567,
from /Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby.h:33,
from ../fbuffer/fbuffer.h:5,
from generator.c:1:
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:318: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_fdset_t’
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:407: error: expected declaration specifiers or ‘...’ before ‘fd_set’
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:407: error: expected declaration specifiers or ‘...’ before ‘fd_set’
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:407: error: expected declaration specifiers or ‘...’ before ‘fd_set’
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:407: warning: ‘struct timeval’ declared inside parameter list
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:407: warning: its scope is only this definition or declaration, which is probably not what you want
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:408: error: expected declaration specifiers or ‘...’ before ‘rb_fdset_t’
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:408: error: expected declaration specifiers or ‘...’ before ‘rb_fdset_t’
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:408: error: expected declaration specifiers or ‘...’ before ‘rb_fdset_t’
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:408: warning: ‘struct timeval’ declared inside parameter list
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:409: warning: ‘struct timeval’ declared inside parameter list
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:505: error: expected declaration specifiers or ‘...’ before ‘mode_t’
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:584: error: expected declaration specifiers or ‘...’ before ‘pid_t’
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:598: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_fork’
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:599: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_fork_err’
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:601: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_waitpid’
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:602: error: expected ‘)’ before ‘pid’
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:603: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_spawn’
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:604: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_spawn_err’
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:606: error: expected ‘)’ before ‘pid’
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:719: error: expected declaration specifiers or ‘...’ before ‘uint32_t’
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:842: error: expected ‘)’ before ‘long’
/Users/aaron/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:843: error: expected ‘)’ before ‘long’
In file included from generator.c:1:
../fbuffer/fbuffer.h: In function ‘fbuffer_alloc’:
../fbuffer/fbuffer.h:72: warning: implicit declaration of function ‘memset’
../fbuffer/fbuffer.h:72: warning: incompatible implicit declaration of built-in function ‘memset’
../fbuffer/fbuffer.h: In function ‘fbuffer_append’:
../fbuffer/fbuffer.h:109: warning: implicit declaration of function ‘memcpy’
../fbuffer/fbuffer.h:109: warning: incompatible implicit declaration of built-in function ‘memcpy’
In file included from generator.c:2:
generator.h:6:19: error: ctype.h: No such file or directory
generator.c: In function ‘fstrndup’:
generator.c:304: warning: implicit declaration of function ‘memccpy’
generator.c: At top level:
generator.c:380: warning: unused parameter ‘self’
generator.c: In function ‘mString_to_json_raw_object’:
generator.c:410: warning: implicit declaration of function ‘strlen’
generator.c:410: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:411: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c: In function ‘mString_Extend_json_create’:
generator.c:438: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:439: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c: At top level:
generator.c:434: warning: unused parameter ‘self’
generator.c: In function ‘State_allocate’:
generator.c:505: warning: incompatible implicit declaration of built-in function ‘memset’
generator.c: In function ‘set_state_ivars’:
generator.c:611: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c: In function ‘cState_aref’:
generator.c:657: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c: In function ‘cState_aset’:
generator.c:671: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:675: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c: At top level:
generator.c:767: warning: unused parameter ‘Vstate’
generator.c:781: warning: unused parameter ‘Vstate’
generator.c:781: warning: unused parameter ‘state’
generator.c:781: warning: unused parameter ‘obj’
generator.c:786: warning: unused parameter ‘Vstate’
generator.c:786: warning: unused parameter ‘state’
generator.c:786: warning: unused parameter ‘obj’
generator.c:791: warning: unused parameter ‘Vstate’
generator.c:791: warning: unused parameter ‘state’
generator.c:791: warning: unused parameter ‘obj’
generator.c:796: warning: unused parameter ‘Vstate’
generator.c:796: warning: unused parameter ‘state’
generator.c:801: warning: unused parameter ‘Vstate’
generator.c:801: warning: unused parameter ‘state’
generator.c: In function ‘generate_json_float’:
generator.c:813: warning: implicit declaration of function ‘isinf’
generator.c:816: warning: implicit declaration of function ‘isnan’
generator.c: At top level:
generator.c:807: warning: unused parameter ‘Vstate’
generator.c: In function ‘isArrayOrObject’:
generator.c:905: warning: implicit declaration of function ‘isspace’
generator.c: In function ‘cState_init_copy’:
generator.c:972: warning: incompatible implicit declaration of built-in function ‘memcpy’
generator.c: In function ‘cState_indent’:
generator.c:1013: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c: In function ‘cState_indent_set’:
generator.c:1035: warning: implicit declaration of function ‘strdup’
generator.c:1035: warning: incompatible implicit declaration of built-in function ‘strdup’
generator.c: In function ‘cState_space’:
generator.c:1050: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c: In function ‘cState_space_set’:
generator.c:1073: warning: incompatible implicit declaration of built-in function ‘strdup’
generator.c: In function ‘cState_space_before’:
generator.c:1087: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c: In function ‘cState_space_before_set’:
generator.c:1109: warning: incompatible implicit declaration of built-in function ‘strdup’
generator.c: In function ‘cState_object_nl’:
generator.c:1124: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c: In function ‘cState_object_nl_set’:
generator.c:1146: warning: incompatible implicit declaration of built-in function ‘strdup’
generator.c: In function ‘cState_array_nl’:
generator.c:1160: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c: In function ‘cState_array_nl_set’:
generator.c:1181: warning: incompatible implicit declaration of built-in function ‘strdup’
generator.c: In function ‘Init_generator’:
generator.c:1402: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1403: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1404: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1405: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1406: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1407: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1408: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1409: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1410: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1411: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1412: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1413: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1414: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1415: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1416: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1417: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1418: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1419: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1420: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1421: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1422: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1423: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1424: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1425: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1426: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1427: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1429: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1429: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1430: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1431: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1433: warning: incompatible implicit declaration of built-in function ‘strlen’
make: *** [generator.o] Error 1
make failed, exit code 2

Add this in your gemfile
gem 'therubyracer', :platforms => :ruby
Then run bundle install.

Related

Private_pub installing in Mac OS X 10.11 - Failed to build gem native extension for http_parser.rb

I try to install private_pub in my Rails 4 app. When I run bundle install I got such problem:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/Users/serj/.rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20160614-8815-15skczg.rb extconf.rb
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling ruby_http_parser.c
couldn't understand kern.osversion `15.5.0'
In file included from /Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/ruby.h:29,
from /Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby.h:33,
from ruby_http_parser.c:1:
/Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/defines.h:26:19: error: stdio.h: No such file or directory
/Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/defines.h:28:24: error: sys/types.h: No such file or directory
/Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/defines.h:31:23: error: sys/stat.h: No such file or directory
/Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/defines.h:34:21: error: stdlib.h: No such file or directory
/Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/defines.h:45:21: error: string.h: No such file or directory
/Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/defines.h:48:22: error: strings.h: No such file or directory
/Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/defines.h:51:23: error: inttypes.h: No such file or directory
/Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/defines.h:54:21: error: stdint.h: No such file or directory
/Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/defines.h:57:21: error: unistd.h: No such file or directory
/Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/defines.h:61:25: error: sys/select.h: No such file or directory
In file included from /Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/defines.h:68,
from /Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/ruby.h:29,
from /Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby.h:33,
from ruby_http_parser.c:1:
/Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/missing.h:23:45: error: math.h: No such file or directory
In file included from /Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/ruby.h:187,
from /Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby.h:33,
from ruby_http_parser.c:1:
/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/limits.h:10:25: error: limits.h: No such file or directory
In file included from /Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/intern.h:35,
from /Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/ruby.h:1710,
from /Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby.h:33,
from ruby_http_parser.c:1:
/Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/st.h:142: error: expected declaration specifiers or ‘...’ before ‘uint32_t’
In file included from /Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/ruby.h:1710,
from /Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby.h:33,
from ruby_http_parser.c:1:
/Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/intern.h:353: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_fdset_t’
/Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/intern.h:454: error: expected declaration specifiers or ‘...’ before ‘rb_fdset_t’
/Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/intern.h:454: error: expected declaration specifiers or ‘...’ before ‘rb_fdset_t’
/Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/intern.h:454: error: expected declaration specifiers or ‘...’ before ‘rb_fdset_t’
/Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/intern.h:454: warning: ‘struct timeval’ declared inside parameter list
/Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/intern.h:454: warning: its scope is only this definition or declaration, which is probably not what you want
/Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/intern.h:455: warning: ‘struct timeval’ declared inside parameter list
/Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/intern.h:560: error: expected declaration specifiers or ‘...’ before ‘mode_t’
/Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/intern.h:639: error: expected declaration specifiers or ‘...’ before ‘pid_t’
/Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/intern.h:643: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_waitpid’
/Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/intern.h:644: error: expected ‘)’ before ‘pid’
/Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/intern.h:645: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_spawn’
/Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/intern.h:646: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_spawn_err’
/Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/intern.h:648: error: expected ‘)’ before ‘pid’
/Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/intern.h:763: error: expected declaration specifiers or ‘...’ before ‘uint32_t’
/Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/intern.h:912: error: expected ‘)’ before ‘long’
/Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/intern.h:913: error: expected ‘)’ before ‘long’
In file included from /Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby.h:33,
from ruby_http_parser.c:1:
/Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/ruby.h:1758: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_event_flag_t’
/Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/ruby.h:1759: error: expected ‘)’ before ‘evflag’
/Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/ruby.h:1762: error: expected ‘)’ before ‘func’
/Users/serj/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/ruby.h:1763: error: expected ‘)’ before ‘func’
In file included from ruby_http_parser.c:3:
ryah_http_parser.h:209: error: expected specifier-qualifier-list before ‘uint32_t’
ryah_http_parser.h:265: error: expected specifier-qualifier-list before ‘uint16_t’
ruby_http_parser.c: In function ‘ParserWrapper_init’:
ruby_http_parser.c:44: error: ‘ryah_http_parser’ has no member named ‘status_code’
ruby_http_parser.c:45: error: ‘ryah_http_parser’ has no member named ‘http_major’
ruby_http_parser.c:46: error: ‘ryah_http_parser’ has no member named ‘http_minor’
ruby_http_parser.c: In function ‘ParserWrapper_free’:
ruby_http_parser.c:77: warning: implicit declaration of function ‘free’
ruby_http_parser.c: In function ‘on_message_begin’:
ruby_http_parser.c:102: error: ‘ryah_http_parser’ has no member named ‘data’
ruby_http_parser.c:104: warning: implicit declaration of function ‘strlen’
ruby_http_parser.c:104: warning: incompatible implicit declaration of built-in function ‘strlen’
ruby_http_parser.c:106: warning: incompatible implicit declaration of built-in function ‘strlen’
ruby_http_parser.c:108: warning: ISO C90 forbids mixed declarations and code
ruby_http_parser.c: In function ‘on_url’:
ruby_http_parser.c:125: error: ‘ryah_http_parser’ has no member named ‘data’
ruby_http_parser.c: In function ‘on_header_field’:
ruby_http_parser.c:131: error: ‘ryah_http_parser’ has no member named ‘data’
ruby_http_parser.c: In function ‘on_header_value’:
ruby_http_parser.c:144: error: ‘ryah_http_parser’ has no member named ‘data’
ruby_http_parser.c:146: warning: ISO C90 forbids mixed declarations and code
ruby_http_parser.c:160: warning: incompatible implicit declaration of built-in function ‘strlen’
ruby_http_parser.c:162: warning: incompatible implicit declaration of built-in function ‘strlen’
ruby_http_parser.c:167: warning: incompatible implicit declaration of built-in function ‘strlen’
ruby_http_parser.c:169: warning: incompatible implicit declaration of built-in function ‘strlen’
ruby_http_parser.c:172: warning: incompatible implicit declaration of built-in function ‘strlen’
ruby_http_parser.c: In function ‘on_headers_complete’:
ruby_http_parser.c:190: error: ‘ryah_http_parser’ has no member named ‘data’
ruby_http_parser.c:192: warning: ISO C90 forbids mixed declarations and code
ruby_http_parser.c: In function ‘on_body’:
ruby_http_parser.c:211: error: ‘ryah_http_parser’ has no member named ‘data’
ruby_http_parser.c:213: warning: ISO C90 forbids mixed declarations and code
ruby_http_parser.c: In function ‘on_message_complete’:
ruby_http_parser.c:230: error: ‘ryah_http_parser’ has no member named ‘data’
ruby_http_parser.c:232: warning: ISO C90 forbids mixed declarations and code
ruby_http_parser.c: In function ‘Parser_alloc_by_type’:
ruby_http_parser.c:262: error: ‘ryah_http_parser’ has no member named ‘data’
ruby_http_parser.c: In function ‘Parser_execute’:
ruby_http_parser.c:314: warning: ISO C90 forbids mixed declarations and code
ruby_http_parser.c:320: warning: ISO C90 forbids mixed declarations and code
ruby_http_parser.c:322: error: ‘ryah_http_parser’ has no member named ‘upgrade’
ruby_http_parser.c: In function ‘Parser_upgrade_p’:
ruby_http_parser.c:381: error: ‘ryah_http_parser’ has no member named ‘upgrade’
ruby_http_parser.c: In function ‘Parser_http_version’:
ruby_http_parser.c:388: error: ‘ryah_http_parser’ has no member named ‘http_major’
ruby_http_parser.c:388: error: ‘ryah_http_parser’ has no member named ‘http_minor’
ruby_http_parser.c:391: error: ‘ryah_http_parser’ has no member named ‘http_major’
ruby_http_parser.c:391: error: ‘ryah_http_parser’ has no member named ‘http_minor’
ruby_http_parser.c: In function ‘Parser_http_major’:
ruby_http_parser.c:398: error: ‘ryah_http_parser’ has no member named ‘http_major’
ruby_http_parser.c:398: error: ‘ryah_http_parser’ has no member named ‘http_minor’
ruby_http_parser.c:401: error: ‘ryah_http_parser’ has no member named ‘http_major’
ruby_http_parser.c: In function ‘Parser_http_minor’:
ruby_http_parser.c:408: error: ‘ryah_http_parser’ has no member named ‘http_major’
ruby_http_parser.c:408: error: ‘ryah_http_parser’ has no member named ‘http_minor’
ruby_http_parser.c:411: error: ‘ryah_http_parser’ has no member named ‘http_minor’
ruby_http_parser.c: In function ‘Parser_http_method’:
ruby_http_parser.c:419: error: ‘ryah_http_parser’ has no member named ‘method’
ruby_http_parser.c:419: error: ‘ryah_http_parser’ has no member named ‘method’
ruby_http_parser.c:419: warning: incompatible implicit declaration of built-in function ‘strlen’
ruby_http_parser.c:419: error: ‘ryah_http_parser’ has no member named ‘method’
ruby_http_parser.c:419: error: ‘ryah_http_parser’ has no member named ‘method’
ruby_http_parser.c: In function ‘Parser_status_code’:
ruby_http_parser.c:428: error: ‘ryah_http_parser’ has no member named ‘status_code’
ruby_http_parser.c:429: error: ‘ryah_http_parser’ has no member named ‘status_code’
ruby_http_parser.c: In function ‘Parser_set_header_value_type’:
ruby_http_parser.c:451: warning: ISO C90 forbids mixed declarations and code
ruby_http_parser.c: In function ‘Init_ruby_http_parser’:
ruby_http_parser.c:473: warning: incompatible implicit declaration of built-in function ‘strlen’
ruby_http_parser.c:474: warning: incompatible implicit declaration of built-in function ‘strlen’
ruby_http_parser.c:475: warning: incompatible implicit declaration of built-in function ‘strlen’
ruby_http_parser.c:476: warning: incompatible implicit declaration of built-in function ‘strlen’
ruby_http_parser.c:477: warning: incompatible implicit declaration of built-in function ‘strlen’
ruby_http_parser.c:478: warning: incompatible implicit declaration of built-in function ‘strlen’
ruby_http_parser.c:479: warning: incompatible implicit declaration of built-in function ‘strlen’
ruby_http_parser.c:481: warning: incompatible implicit declaration of built-in function ‘strlen’
ruby_http_parser.c:482: warning: incompatible implicit declaration of built-in function ‘strlen’
ruby_http_parser.c:483: warning: incompatible implicit declaration of built-in function ‘strlen’
make: *** [ruby_http_parser.o] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/serj/.rvm/gems/ruby-2.2.1#email_platform/gems/http_parser.rb-0.6.0 for inspection.
Results logged to /Users/serj/.rvm/gems/ruby-2.2.1#email_platform/extensions/x86_64-darwin-13/2.2.0/http_parser.rb-0.6.0/gem_make.out
An error occurred while installing http_parser.rb (0.6.0), and Bundler cannot continue.
Make sure that `gem install http_parser.rb -v '0.6.0'` succeeds before bundling.
How can I fix that?
It's quite weird but running:
$ xcode-select --install
fixed the issue in my case. I am surprised that homebrew didn't ask me to do that (I had Xcode installed with command line tools before but I upgraded the OS).
Hope it'll help someone!

Trouble Installing bcrypt-ruby (3.0.1)

I am having trouble installing crypt-ruby 3.0.1 on my mac. Does anyone now what the cause of this maybe? Below is the following output error.
Dorians-MacBook-Pro:rentsnap_webapp dorianflowers$ gem install bcrypt-ruby -v '3.0.1'
Building native extensions. This could take a while...
ERROR: Error installing bcrypt-ruby:
ERROR: Failed to build gem native extension.
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/bin/ruby -r ./siteconf20150722-8311-1gpgksu.rb extconf.rb
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling bcrypt_ext.c
In file included from /Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/ruby.h:29,
from /Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby.h:33,
from bcrypt_ext.c:1:
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/defines.h:26:19: error: stdio.h: No such file or directory
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/defines.h:28:24: error: sys/types.h: No such file or directory
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/defines.h:31:23: error: sys/stat.h: No such file or directory
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/defines.h:34:21: error: stdlib.h: No such file or directory
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/defines.h:45:21: error: string.h: No such file or directory
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/defines.h:48:22: error: strings.h: No such file or directory
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/defines.h:51:23: error: inttypes.h: No such file or directory
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/defines.h:54:21: error: stdint.h: No such file or directory
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/defines.h:57:21: error: unistd.h: No such file or directory
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/defines.h:61:25: error: sys/select.h: No such file or directory
In file included from /Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/defines.h:68,
from /Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/ruby.h:29,
from /Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby.h:33,
from bcrypt_ext.c:1:
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/missing.h:23:45: error: math.h: No such file or directory
In file included from /Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/ruby.h:184,
from /Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby.h:33,
from bcrypt_ext.c:1:
/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/include/limits.h:15:25: error: limits.h: No such file or directory
In file included from /Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:35,
from /Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/ruby.h:1694,
from /Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby.h:33,
from bcrypt_ext.c:1:
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/st.h:139: error: expected declaration specifiers or ‘...’ before ‘uint32_t’
In file included from /Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/ruby.h:1694,
from /Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby.h:33,
from bcrypt_ext.c:1:
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:348: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_fdset_t’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:440: error: expected declaration specifiers or ‘...’ before ‘fd_set’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:440: error: expected declaration specifiers or ‘...’ before ‘fd_set’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:440: error: expected declaration specifiers or ‘...’ before ‘fd_set’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:440: warning: ‘struct timeval’ declared inside parameter list
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:440: warning: its scope is only this definition or declaration, which is probably not what you want
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:441: error: expected declaration specifiers or ‘...’ before ‘rb_fdset_t’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:441: error: expected declaration specifiers or ‘...’ before ‘rb_fdset_t’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:441: error: expected declaration specifiers or ‘...’ before ‘rb_fdset_t’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:441: warning: ‘struct timeval’ declared inside parameter list
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:442: warning: ‘struct timeval’ declared inside parameter list
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:545: error: expected declaration specifiers or ‘...’ before ‘mode_t’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:624: error: expected declaration specifiers or ‘...’ before ‘pid_t’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:638: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_fork’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:639: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_fork_err’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:641: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_waitpid’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:642: error: expected ‘)’ before ‘pid’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:643: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_spawn’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:644: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_spawn_err’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:646: error: expected ‘)’ before ‘pid’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:755: error: expected declaration specifiers or ‘...’ before ‘uint32_t’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:882: error: expected ‘)’ before ‘long’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:883: error: expected ‘)’ before ‘long’
bcrypt_ext.c: In function ‘bc_salt’:
bcrypt_ext.c:46: warning: incompatible implicit declaration of built-in function ‘strlen’
make: *** [bcrypt_ext.o] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/dorianflowers/.rvm/gems/ruby-2.1.0/gems/bcrypt-ruby-3.0.1 for inspection.
Results logged to /Users/dorianflowers/.rvm/gems/ruby-2.1.0/extensions/x86_64-darwin-14/2.1.0-static/bcrypt-ruby-3.0.1/gem_make.out
According to this article, it seems to be caused by an update to xcode tools on mac, to fix this you need to add a flag to ignore that error like it used to do before.
For example in my case this worked:
gem install bcrypt-ruby:3.0.1 -- --build-flags --with-cflags="-Wno-error=implicit-function-declaration"
These errors all indicate that there is no compiler on your computer:
error: stdio.h: No such file or directory
error: sys/types.h: No such file or directory
error: sys/stat.h: No such file or directory
error: stdlib.h: No such file or directory
error: string.h: No such file or directory
error: strings.h: No such file or directory
error: inttypes.h: No such file or directory
error: stdint.h: No such file or directory
error: unistd.h: No such file or directory
error: sys/select.h: No such file or directory
On macOS, the easiest way to resolve this is to install the Xcode command line tools:
xcode-select --install
The Xcode command line tools include all the above libraries and the compilers needed to build bcrypt-ruby. (and most other gems)

Multiple C compilation errors when installing rails on osx 10.9.3

RoR newbie here.. tried installing rails on osx 10.9.3 and ruby 1.9.3 and I get a very long error message. Any clue how to fix this?
$ sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install rails
Password:
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
/Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/bin/ruby extconf.rb
creating Makefile
make clean
make
compiling generator.c
In file included from /Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby.h:32,
from ../fbuffer/fbuffer.h:5,
from generator.c:1:
/Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/ruby.h:48:21: error: string.h: No such file or directory
/Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/ruby.h:58:21: error: stdint.h: No such file or directory
/Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/ruby.h:61:23: error: inttypes.h: No such file or directory
/Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/ruby.h:65:19: error: stdio.h: No such file or directory
In file included from /Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/ruby.h:67,
from /Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby.h:32,
from ../fbuffer/fbuffer.h:5,
from generator.c:1:
/Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/defines.h:29:21: error: stdlib.h: No such file or directory
In file included from /Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby.h:32,
from ../fbuffer/fbuffer.h:5,
from generator.c:1:
/Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/ruby.h:74:20: error: alloca.h: No such file or directory
In file included from /Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/ruby.h:178,
from /Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby.h:32,
from ../fbuffer/fbuffer.h:5,
from generator.c:1:
/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/limits.h:10:25: error: limits.h: No such file or directory
In file included from /Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/ruby.h:1383,
from /Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby.h:32,
from ../fbuffer/fbuffer.h:5,
from generator.c:1:
/Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:36:23: error: sys/types.h: No such file or directory
/Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:40:22: error: sys/time.h: No such file or directory
In file included from /Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:43,
from /Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/ruby.h:1383,
from /Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby.h:32,
from ../fbuffer/fbuffer.h:5,
from generator.c:1:
/Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/st.h:130: error: expected declaration specifiers or ‘...’ before ‘uint32_t’
In file included from /Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/ruby.h:1383,
from /Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby.h:32,
from ../fbuffer/fbuffer.h:5,
from generator.c:1:
/Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:294: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_fdset_t’
/Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:389: error: expected declaration specifiers or ‘...’ before ‘fd_set’
/Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:389: error: expected declaration specifiers or ‘...’ before ‘fd_set’
/Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:389: error: expected declaration specifiers or ‘...’ before ‘fd_set’
/Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:389: warning: ‘struct timeval’ declared inside parameter list
/Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:389: warning: its scope is only this definition or declaration, which is probably not what you want
/Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:390: error: expected declaration specifiers or ‘...’ before ‘rb_fdset_t’
/Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:390: error: expected declaration specifiers or ‘...’ before ‘rb_fdset_t’
/Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:390: error: expected declaration specifiers or ‘...’ before ‘rb_fdset_t’
/Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:390: warning: ‘struct timeval’ declared inside parameter list
/Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:391: warning: ‘struct timeval’ declared inside parameter list
/Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:563: error: expected declaration specifiers or ‘...’ before ‘pid_t’
/Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:581: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_fork’
/Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:582: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_fork_err’
/Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:584: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_waitpid’
/Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:585: error: expected ‘)’ before ‘pid’
/Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:586: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_spawn’
/Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:587: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_spawn_err’
/Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:589: error: expected ‘)’ before ‘pid’
/Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:708: error: expected declaration specifiers or ‘...’ before ‘uint32_t’
/Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:833: error: expected ‘)’ before ‘long’
/Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:834: error: expected ‘)’ before ‘long’
In file included from generator.c:1:
../fbuffer/fbuffer.h: In function ‘fbuffer_alloc’:
../fbuffer/fbuffer.h:72: warning: implicit declaration of function ‘memset’
../fbuffer/fbuffer.h:72: warning: incompatible implicit declaration of built-in function ‘memset’
../fbuffer/fbuffer.h: In function ‘fbuffer_append’:
../fbuffer/fbuffer.h:109: warning: implicit declaration of function ‘memcpy’
../fbuffer/fbuffer.h:109: warning: incompatible implicit declaration of built-in function ‘memcpy’
In file included from generator.c:2:
generator.h:5:18: error: math.h: No such file or directory
generator.h:6:19: error: ctype.h: No such file or directory
generator.c: In function ‘fstrndup’:
generator.c:304: warning: implicit declaration of function ‘memccpy’
generator.c: In function ‘mString_to_json_raw_object’:
generator.c:410: warning: implicit declaration of function ‘strlen’
generator.c:410: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:411: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c: In function ‘mString_Extend_json_create’:
generator.c:438: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:439: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c: In function ‘State_allocate’:
generator.c:505: warning: incompatible implicit declaration of built-in function ‘memset’
generator.c: In function ‘set_state_ivars’:
generator.c:611: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c: In function ‘cState_aref’:
generator.c:657: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c: In function ‘cState_aset’:
generator.c:671: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:675: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c: In function ‘generate_json_float’:
generator.c:813: warning: implicit declaration of function ‘isinf’
generator.c:816: warning: implicit declaration of function ‘isnan’
generator.c: In function ‘isArrayOrObject’:
generator.c:905: warning: implicit declaration of function ‘isspace’
generator.c: In function ‘cState_init_copy’:
generator.c:972: warning: incompatible implicit declaration of built-in function ‘memcpy’
generator.c: In function ‘cState_indent’:
generator.c:1013: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c: In function ‘cState_indent_set’:
generator.c:1035: warning: implicit declaration of function ‘strdup’
generator.c:1035: warning: incompatible implicit declaration of built-in function ‘strdup’
generator.c: In function ‘cState_space’:
generator.c:1050: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c: In function ‘cState_space_set’:
generator.c:1073: warning: incompatible implicit declaration of built-in function ‘strdup’
generator.c: In function ‘cState_space_before’:
generator.c:1087: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c: In function ‘cState_space_before_set’:
generator.c:1109: warning: incompatible implicit declaration of built-in function ‘strdup’
generator.c: In function ‘cState_object_nl’:
generator.c:1124: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c: In function ‘cState_object_nl_set’:
generator.c:1146: warning: incompatible implicit declaration of built-in function ‘strdup’
generator.c: In function ‘cState_array_nl’:
generator.c:1160: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c: In function ‘cState_array_nl_set’:
generator.c:1181: warning: incompatible implicit declaration of built-in function ‘strdup’
generator.c: In function ‘Init_generator’:
generator.c:1402: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1403: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1404: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1405: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1406: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1407: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1408: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1409: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1410: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1411: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1412: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1413: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1414: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1415: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1416: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1417: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1418: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1419: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1420: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1421: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1422: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1423: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1424: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1425: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1426: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1427: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1429: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1429: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1430: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1431: warning: incompatible implicit declaration of built-in function ‘strlen’
generator.c:1433: warning: incompatible implicit declaration of built-in function ‘strlen’
make: *** [generator.o] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/gems/1.9.1/gems/json-1.8.1 for inspection.
Results logged to /Users/gerrytan/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/gems/1.9.1/extensions/x86_64-darwin-12/1.9.1/json-1.8.1/gem_make.out

Getting Error While doing bundle install with ruby racer

While doing Bundle install for my app, I'm getting an error related to therubyracer (0.9.4).
This is the error:
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/kpvarma/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
checking for main() in -lpthread... yes
checking for main() in -lobjc... yes
creating Makefile
make
compiling rr.cpp
clang: warning: argument unused during compilation: '-rdynamic'
rr.cpp:48:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
rr.cpp:151:44: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
return String::New(RSTRING_PTR(value), RSTRING_LEN(value));
^~~~~~~~~~~~~~~~~~
/Users/kpvarma/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1/ruby/ruby.h:674:6: note: expanded from macro 'RSTRING_LEN'
RSTRING_EMBED_LEN(str) : \
^
/Users/kpvarma/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1/ruby/ruby.h:670:6: note: expanded from macro 'RSTRING_EMBED_LEN'
(long)((RBASIC(str)->flags >> RSTRING_EMBED_LEN_SHIFT) & \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rr.cpp:151:44: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
return String::New(RSTRING_PTR(value), RSTRING_LEN(value));
^~~~~~~~~~~~~~~~~~
/Users/kpvarma/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1/ruby/ruby.h:675:28: note: expanded from macro 'RSTRING_LEN'
RSTRING(str)->as.heap.len)
^
3 warnings generated.
compiling v8.cpp
clang: warning: argument unused during compilation: '-rdynamic'
compiling v8_array.cpp
clang: warning: argument unused during compilation: '-rdynamic'
compiling v8_callbacks.cpp
clang: warning: argument unused during compilation: '-rdynamic'
compiling v8_context.cpp
clang: warning: argument unused during compilation: '-rdynamic'
compiling v8_date.cpp
clang: warning: argument unused during compilation: '-rdynamic'
compiling v8_debug.cpp
clang: warning: argument unused during compilation: '-rdynamic'
compiling v8_exception.cpp
clang: warning: argument unused during compilation: '-rdynamic'
v8_exception.cpp:15:8: warning: unused function 'segfault' [-Wunused-function]
void segfault(int sig) {
^
1 warning generated.
compiling v8_external.cpp
clang: warning: argument unused during compilation: '-rdynamic'
v8_external.cpp:10:9: warning: unused variable 'references' [-Wunused-variable]
VALUE references;
^
1 warning generated.
compiling v8_function.cpp
clang: warning: argument unused during compilation: '-rdynamic'
v8_function.cpp:24:23: error: variable length array of non-POD element type 'Handle<v8::Value>'
Handle<Value> argv[argc];
^
v8_function.cpp:36:23: error: variable length array of non-POD element type 'Handle<v8::Value>'
Handle<Value> argv[argc];
^
2 errors generated.
make: *** [v8_function.o] Error 1
Gem files will remain installed in /Users/kpvarma/.rvm/gems/ruby-1.9.3-p194/gems/therubyracer-0.9.4 for inspection.
Results logged to /Users/kpvarma/.rvm/gems/ruby-1.9.3-p194/gems/therubyracer-0.9.4/ext/v8/gem_make.out
An error occured while installing therubyracer (0.9.4), and Bundler cannot continue.
Make sure that `gem install therubyracer -v '0.9.4'` succeeds before bundling.
I amm using ruby-1.9.3-p194 on Mac.
Can anyone please help me out?
Thank you
Regards

What is the Windows equivalent file for .bashrc?

I am trying to install eventmachine as follows:
gem install eventmachine -v '0.12.10'
I get the following problem:
D:\rails_workspace\rubytime>gem install eventmachine -v '0.12.10'
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing eventmachine:
ERROR: Failed to build gem native extension.
C:/Rails/Ruby1.9.3/bin/ruby.exe extconf.rb
checking for rb_trap_immediate in ruby.h,rubysig.h... no
checking for rb_thread_blocking_region()... yes
checking for inotify_init() in sys/inotify.h... no
checking for __NR_inotify_init in sys/syscall.h... no
checking for writev() in sys/uio.h... no
checking for rb_thread_check_ints()... yes
checking for rb_time_new()... yes
checking for windows.h... yes
checking for winsock.h... yes
checking for main() in -lkernel32... yes
checking for main() in -lrpcrt4... yes
checking for main() in -lgdi32... yes
checking for main() in -lssl... no
creating Makefile
make
generating rubyeventmachine-i386-mingw32.def
compiling binder.cpp
cc1plus.exe: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus.exe: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
In file included from project.h:137:0,
from binder.cpp:20:
binder.h:35:34: warning: type qualifiers ignored on function return type
In file included from project.h:138:0,
from binder.cpp:20:
em.h:91:47: warning: type qualifiers ignored on function return type
em.h:92:76: warning: type qualifiers ignored on function return type
em.h:93:56: warning: type qualifiers ignored on function return type
em.h:95:57: warning: type qualifiers ignored on function return type
em.h:96:60: warning: type qualifiers ignored on function return type
em.h:97:58: warning: type qualifiers ignored on function return type
em.h:98:55: warning: type qualifiers ignored on function return type
em.h:99:36: warning: type qualifiers ignored on function return type
em.h:101:47: warning: type qualifiers ignored on function return type
em.h:106:42: warning: type qualifiers ignored on function return type
em.h:123:45: warning: type qualifiers ignored on function return type
em.h:132:36: warning: type qualifiers ignored on function return type
In file included from project.h:145:0,
from binder.cpp:20:
eventmachine.h:45:61: warning: type qualifiers ignored on function return type
eventmachine.h:46:112: warning: type qualifiers ignored on function return type
eventmachine.h:47:69: warning: type qualifiers ignored on function return type
eventmachine.h:49:73: warning: type qualifiers ignored on function return type
eventmachine.h:62:75: warning: type qualifiers ignored on function return type
eventmachine.h:63:74: warning: type qualifiers ignored on function return type
eventmachine.h:64:77: warning: type qualifiers ignored on function return type
eventmachine.h:65:41: warning: type qualifiers ignored on function return type
In file included from project.h:145:0,
from binder.cpp:20:
eventmachine.h:99:60: warning: type qualifiers ignored on function return type
eventmachine.h:100:58: warning: type qualifiers ignored on function return type
eventmachine.h:102:60: warning: type qualifiers ignored on function return type
eventmachine.h:105:41: warning: type qualifiers ignored on function return type
compiling cmain.cpp
cc1plus.exe: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus.exe: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
In file included from project.h:137:0,
from cmain.cpp:20:
binder.h:35:34: warning: type qualifiers ignored on function return type
In file included from project.h:138:0,
from cmain.cpp:20:
em.h:91:47: warning: type qualifiers ignored on function return type
em.h:92:76: warning: type qualifiers ignored on function return type
em.h:93:56: warning: type qualifiers ignored on function return type
em.h:95:57: warning: type qualifiers ignored on function return type
em.h:96:60: warning: type qualifiers ignored on function return type
em.h:97:58: warning: type qualifiers ignored on function return type
em.h:98:55: warning: type qualifiers ignored on function return type
em.h:99:36: warning: type qualifiers ignored on function return type
em.h:101:47: warning: type qualifiers ignored on function return type
em.h:106:42: warning: type qualifiers ignored on function return type
em.h:123:45: warning: type qualifiers ignored on function return type
em.h:132:36: warning: type qualifiers ignored on function return type
In file included from project.h:145:0,
from cmain.cpp:20:
eventmachine.h:45:61: warning: type qualifiers ignored on function return type
eventmachine.h:46:112: warning: type qualifiers ignored on function return type
eventmachine.h:47:69: warning: type qualifiers ignored on function return type
eventmachine.h:49:73: warning: type qualifiers ignored on function return type
eventmachine.h:62:75: warning: type qualifiers ignored on function return type
eventmachine.h:63:74: warning: type qualifiers ignored on function return type
eventmachine.h:64:77: warning: type qualifiers ignored on function return type
eventmachine.h:65:41: warning: type qualifiers ignored on function return type
In file included from project.h:145:0,
from cmain.cpp:20:
eventmachine.h:99:60: warning: type qualifiers ignored on function return type
eventmachine.h:100:58: warning: type qualifiers ignored on function return type
eventmachine.h:102:60: warning: type qualifiers ignored on function return type
eventmachine.h:105:41: warning: type qualifiers ignored on function return type
cmain.cpp:98:71: warning: type qualifiers ignored on function return type
cmain.cpp:109:122: warning: type qualifiers ignored on function return type
cmain.cpp:119:79: warning: type qualifiers ignored on function return type
cmain.cpp:129:83: warning: type qualifiers ignored on function return type
cmain.cpp:260:85: warning: type qualifiers ignored on function return type
cmain.cpp:270:84: warning: type qualifiers ignored on function return type
cmain.cpp:280:88: warning: type qualifiers ignored on function return type
cmain.cpp:290:51: warning: type qualifiers ignored on function return type
cmain.cpp:300:70: warning: type qualifiers ignored on function return type
cmain.cpp:320:55: warning: type qualifiers ignored on function return type
cmain.cpp:546:70: warning: type qualifiers ignored on function return type
cmain.cpp:669:68: warning: type qualifiers ignored on function return type
cmain.cpp: In function 'int evma_send_file_data_to_connection(long unsigned int, const char*)':
cmain.cpp:752:6: error: cannot convert 'stat*' to '_stati64*' for argument '2' to 'int _fstati64(int, _stati64*)'
make: *** [cmain.o] Error 1
Gem files will remain installed in C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/eventmachine-0.12.10 for inspection.
Results logged to C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/eventmachine-0.12.10/ext/gem_make.out
and this where I found some information but don't know how to do that in Windows
Please help me how to resolve this issues in windows
You don't need .bashrc, add environment variable instead. To set an environment variable(which is equivalent to the solution described in the post) do that right click on My computer, select properties -> advanced and then environment variables. Create a new value with name the name you need and value equivalent to the one you give it in linux(please note that $USER will not work. Either type your username or use %USERNAME%). I am not sure this will fix your problem I am just telling you how to perform action equivalent to the one described in the answer you link to. Also the way to set environment variable may differ a little depending on your windows version.

Resources