Shell Person Help me keep the shell people alive.

26Apr/140

Install watir-webdriver Ruby Gem on OSX Mavericks

To install watir-webdriver on Mavericks I had to install XCode Command Line Tools first, using the following command:

xcode-select --install

However, even after installing Command Line Tools I was getting the following errors when installing the Ruby gem:

laptop:~ shellperson$ sudo gem install watir-webdriver
Password:
Building native extensions.  This could take a while...
ERROR:  Error installing watir-webdriver:
	ERROR: Failed to build gem native extension.

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
checking for ffi.h... no
checking for ffi.h in /usr/local/include,/usr/include/ffi... yes
checking for ffi_call() in -lffi... yes
checking for ffi_prep_closure()... yes
checking for ffi_raw_call()... no
checking for rb_thread_blocking_region()... yes
checking for rb_thread_call_with_gvl()... yes
checking for rb_thread_call_without_gvl()... yes
checking for ffi_prep_cif_var()... no
creating extconf.h
creating Makefile

make "DESTDIR="
compiling AbstractMemory.c
compiling ArrayType.c
compiling Buffer.c
compiling Call.c
Call.c:303:5: warning: implicit declaration of function 'rb_thread_call_without_gvl' is invalid in C99 [-Wimplicit-function-declaration]
    rbffi_thread_blocking_region(call_blocking_function, data, (void *) -1, NULL);
    ^
./Thread.h:78:39: note: expanded from macro 'rbffi_thread_blocking_region'
# define rbffi_thread_blocking_region rb_thread_call_without_gvl
                                      ^
1 warning generated.
compiling ClosurePool.c
compiling DataConverter.c
DataConverter.c:43:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
1 warning generated.
compiling DynamicLibrary.c
compiling ffi.c
compiling Function.c
Function.c:479:33: warning: incompatible pointer types passing 'VALUE (void *)' to parameter of type 'void *(*)(void *)' [-Wincompatible-pointer-types]
        rb_thread_call_with_gvl(callback_with_gvl, &cb);
                                ^~~~~~~~~~~~~~~~~
Function.c:102:46: note: passing argument to parameter 'func' here
extern void *rb_thread_call_with_gvl(void *(*func)(void *), void *data1);
                                             ^
Function.c:563:9: warning: implicit declaration of function 'rb_thread_call_without_gvl' is invalid in C99 [-Wimplicit-function-declaration]
        rb_thread_call_without_gvl(async_cb_wait, &w, async_cb_stop, &w);
        ^
Function.c:738:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
3 warnings generated.
compiling FunctionInfo.c
compiling LastError.c
compiling LongDouble.c
compiling MappedType.c
compiling MemoryPointer.c
compiling MethodHandle.c
compiling Platform.c
compiling Pointer.c
compiling Struct.c
compiling StructByReference.c
compiling StructByValue.c
compiling StructLayout.c
compiling Thread.c
compiling Type.c
compiling Types.c
compiling Variadic.c
linking shared-object ffi_c.bundle
clang: error: unknown argument: '-multiply_definedsuppress' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
make: *** [ffi_c.bundle] Error 1


Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/ffi-1.9.3 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/gems/ffi-1.9.3/ext/ffi_c/gem_make.out

Thanks to a stackoverflow user helping someone with a similar problem (see credits below), I was able to install the gem using the following command:

sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install watir-webdriver
laptop:~ shellperson$ sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install watir-webdriver
Building native extensions.  This could take a while...
Successfully installed ffi-1.9.3
Fetching: childprocess-0.5.3.gem (100%)
Successfully installed childprocess-0.5.3
Fetching: websocket-1.0.7.gem (100%)
Successfully installed websocket-1.0.7
Fetching: selenium-webdriver-2.41.0.gem (100%)
Successfully installed selenium-webdriver-2.41.0
Fetching: watir-webdriver-0.6.9.gem (100%)
Successfully installed watir-webdriver-0.6.9
Parsing documentation for ffi-1.9.3
Installing ri documentation for ffi-1.9.3
Parsing documentation for childprocess-0.5.3
Installing ri documentation for childprocess-0.5.3
Parsing documentation for websocket-1.0.7
Installing ri documentation for websocket-1.0.7
Parsing documentation for selenium-webdriver-2.41.0
unable to convert "\xE0" from ASCII-8BIT to UTF-8 for lib/selenium/webdriver/firefox/native/linux/amd64/x_ignore_nofocus.so, skipping
unable to convert "\xB0" from ASCII-8BIT to UTF-8 for lib/selenium/webdriver/firefox/native/linux/x86/x_ignore_nofocus.so, skipping
unable to convert "\xD0" from ASCII-8BIT to UTF-8 for lib/selenium/webdriver/safari/resources/SafariDriver.safariextz, skipping
Installing ri documentation for selenium-webdriver-2.41.0
Parsing documentation for watir-webdriver-0.6.9
Installing ri documentation for watir-webdriver-0.6.9
5 gems installed

Credits:
http://stackoverflow.com/a/22355874

Filed under: Mavericks, osx Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment

No trackbacks yet.