Hiredis on Windows XP SP3 - ruby-on-rails

I have this error while installing gem hiredis on Windows XP SP3:
C:\>gem install hiredis
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing hiredis:
ERROR: Failed to build gem native extension.
C:/RailsInstaller/Ruby1.8.7/bin/ruby.exe extconf.rb
System cannot find that path // <- thats just translate
creating Makefile
make
gcc -I. -I/C/RailsInstaller/Ruby1.8.7/lib/ruby/1.8/i386-mingw32 -I/C/RailsInstaller/Ruby1.8.7/lib/ruby/1.8/i386-mingw32 -I. -g -O2 -DFD_SETSIZE=256 -IC:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/hiredis-0.3.2/vendor/hiredis -c connection.c
connection.c:1:24: fatal error: sys/socket.h: No such file or directory
compilation terminated.
make: ** [connection.o] Error 1
So I don't have file socket.h but I thought that those files are not included in win gcc dist. As you can see, RailsInstaller is used.

Hiredis is not compatible with Windows.
See Error when bundle install on windows
Hiredis uses *nix sockets directly instead of a more cross-platform method like many other gems.

Related

Error installing gem

I typed 'gem install middleman' in my terminal and got the following error message:
Building native extensions. This could take a while...
ERROR: Error installing middleman:
ERROR: Failed to build gem native extension.
/usr/local/rvm/rubies/ruby-1.9.3-p429/bin/ruby extconf.rb
creating Makefile
make
compiling hitimes.c
make: gcc-4.2: No such file or directory
make: *** [hitimes.o] Error 1
Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.3-p429/gems/hitimes-1.2.2 for inspection.
Results logged to /usr/local/rvm/gems/ruby-1.9.3-p429/gems/hitimes-1.2.2/ext/hitimes/c/gem_make.out
Looks like you're missing gcc-4.2
Do you have any GCC installed (if you're on a Mac, you need to install Xcode)?
which gcc
If you already have a version of gcc, you can simply symlink to it
ln -s /usr/bin/gcc /usr/bin/gcc-4.2

make: execvp: g++: Permission denied

I'm trying to install therubyracer on Amazon Linux AMI (~centOS).
[www#ip-10-0-0-125 root]$ gem install therubyracer
Fetching: libv8-3.16.14.3-x86_64-linux.gem (100%)
Successfully installed libv8-3.16.14.3-x86_64-linux
Building native extensions. This could take a while...
ERROR: Error installing therubyracer:
ERROR: Failed to build gem native extension.
/home/www/.rvm/rubies/ruby-2.1.1/bin/ruby extconf.rb
checking for main() in -lpthread... yes
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling handles.cc
make: execvp: g++: Permission denied
make: *** [handles.o] Error 127
Permission denied # dir_chdir - /root
Gem files will remain installed in /home/www/.rvm/gems/ruby-2.1.1/gems/therubyracer-0.12.1 for inspection.
Results logged to /home/www/.rvm/gems/ruby-2.1.1/extensions/x86_64-linux/2.1.0/therubyracer-0.12.1/gem_make.out
[www#ip-10-0-0-125 root]$
I am not sure what to try.. I'm installing it manually on the server with gem install therubyracer. I have tried doing libv8 first, many different versions and combinations of versions.
I'm running this under the www user in the ~ directory.
Thanks
You haven't installed g++ (the GNU C++ compiler) on your system... that makes it hard to compile things :-).
I don't have a copy of centos handy, but something like sudo yum install g++ will probably get you a compiler.

Windows 8 64 bit ruby-debug-ide install of linecache19 failing due to gcc -m64 flag error: sorry, unimplemented: 64-bit mode not compiled in

I am going through the install for windows per Is ruby-debug-ide available to be installed on windows with ruby1.9.3? downloaded the gems and begin to install them. But get this 64 bit error. Is there a 32 bit version of linecache19. Do I need a different gcc compiler?
C:\JRuby\lib\ruby\gems\shared>gem install linecache19-0.5.13.gem
Building native extensions. This could take a while...
ERROR: Error installing linecache19-0.5.13.gem:
ERROR: Failed to build gem native extension.
C:/JRuby/bin/jruby.exe extconf.rb
C:/JRuby/lib/ruby/shared/mkmf.rb:14: Use RbConfig instead of obsolete and deprecated Config.
checking for vm_core.h... no
checking for vm_core.h... yes
checking for version.h... yes
creating Makefile
make
gcc -I. -IC:/JRuby/lib/native/include -IC:/JRuby/lib/native/include/ruby -I. -DHAVE_VM_CORE_H -DHAVE_VERSION_H -IC:/JRuby/lib/native/include
/ruby-1.9.3-p392 -fno-omit-frame-pointer -fno-strict-aliasing -fexceptions -m64 -march=native -mtune=native -c trace_nums.c
trace_nums.c:1:0: sorry, unimplemented: 64-bit mode not compiled in
Seems you've tried to install a gem (linecache19) on top of JRuby.
JRuby is powered by JVM, and installation of gems that pack C extensions is discourages (due performance issues)
If you plan to continue using JRuby and you're interested in things like debugging and such, I recommend you read JRuby documentation about how to debug with JRuby
If you're still interested in install linecache19 (and debugger gem), I recommend you install a version of Ruby that is compatible with C extension compilation, like RubyInstaller:
http://rubyinstaller.org/downloads
As mentioned in the download page, if you're new to Ruby/Rails world, I suggest you use Ruby 1.9.3 instead of Ruby 2.0 since not all the gems have been updated to be compatible with 2.0 on Windows.
Hope that helps.

How to install json gem - Failed to build gem native extension

I'm trying to deploy a rails app to my ubuntu linux server. I'm using capistrano and bundler and when it gets to installing gems it fails with this error:
Installing json (1.7.7) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/opt/ruby-enterprise-1.8.7-2012.02/bin/ruby extconf.rb
creating Makefile
make
/usr/bin/gcc -I. -I/opt/local/include -I/opt/ruby-enterprise-1.8.7- 2012.02/lib/ruby/1.8/i686-linux -I/opt/ruby-enterprise-1.8.7-2012.02/lib/ruby/1.8/i686-linux -I. -D_FILE_OFFSET_BITS=64 -fPIC -g -O3 -Wall -c parser.c
In file included from /usr/include/i386-linux-gnu/bits/posix1_lim.h:157:0,
from /usr/include/limits.h:145,
from /usr/lib/gcc/i686-linux-gnu/4.6/include-fixed/limits.h:169,
from /usr/lib/gcc/i686-linux-gnu/4.6/include-fixed/syslimits.h:7,
from /usr/lib/gcc/i686-linux-gnu/4.6/include-fixed/limits.h:34,
from /opt/ruby-enterprise-1.8.7-2012.02/lib/ruby/1.8/i686-linux/ruby.h:95,
from ../fbuffer/fbuffer.h:6,
from parser.rl:1:
/usr/include/i386-linux-gnu/bits/local_lim.h:39:26: fatal error: linux/limits.h: No such file or directory
compilation terminated.
make: *** [parser.o] Error 1
I am running ruby enterprise edition 1.8.7 and can't upgrade ruby without a lot of work upgrading other sites so that's not an option right now. I tried apt-get install ruby-dev but it didn't help (I'm not sure that was the right thing anyway).
I think you need to install one of this packages :
$ apt-file search limits.h | grep 'linux/limits.h'
linux-headers-2.6.32-5-common: /usr/src/linux-headers-2.6.32-5-common/include/linux/limits.h
linux-headers-2.6.32-5-common-openvz: /usr/src/linux-headers-2.6.32-5-common-openvz/include/linux/limits.h
linux-headers-2.6.32-5-common-vserver: /usr/src/linux-headers-2.6.32-5-common-vserver/include/linux/limits.h
linux-headers-2.6.32-5-common-xen: /usr/src/linux-headers-2.6.32-5-common-xen/include/linux/limits.h
linux-libc-dev: /usr/include/linux/limits.h

how to install caldecott on win 7?

I have created an and I want to upload that on phpfog but I am getting trouble while uploading my database here on the first step, I have win 7 x64 , I downloaded and installed command prompt with ruby, while creating a tunnel :
C:\Ruby200\devkit>gem install caldecott --platform=ruby
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing caldecott:
ERROR: Failed to build gem native extension.
C:/Ruby200/bin/ruby.exe extconf.rb
creating Makefile
make
generating generator-i386-mingw32.def
compiling generator.c
generator.c: In function 'cState_aref':
generator.c:632:5: warning: variable 'state' set but not used [-Wunused-but-set-
variable]
generator.c: In function 'isArrayOrObject':
generator.c:867:5: warning: suggest parentheses around '&&' within '||' [-Wparen
theses]
linking shared-object json/ext/generator.so
make install
/usr/bin/install -c -m 0755 generator.so C:/Ruby200/lib/ruby/gems/2.0.0/gems/jso
n-1.6.8/ext/json/ext/json/ext
/usr/bin/install: cannot create regular file `C:/Ruby200/lib/ruby/gems/2.0.0/gem
s/json-1.6.8/ext/json/ext/json/ext': No such file or directory
make: *** [install-so] Error 1
Gem files will remain installed in C:/Ruby200/lib/ruby/gems/2.0.0/gems/json-1.6.
8 for inspection.
Results logged to C:/Ruby200/lib/ruby/gems/2.0.0/gems/json-1.6.8/ext/json/ext/ge
nerator/gem_make.out
C:\Ruby200\devkit>gem install caldecott --platform=ruby
`
I have Win7 x64, Ruby 2.0.0, DevKit (DevKit-mingw64-32-4.7.2-20130224-1151)
I faced the same issue. My solution:
Download gem source from github - https://github.com/cloudfoundry/caldecott/archive/master.zip
Unzip to C:\caldecott (for example)
Open file caldecott.gemspec and change version of json dependency to "~> 1.7"
Open command prompt, move to gem source directory and perfrom:
gem build caldecott.gemspec
gem install caldecott-0.0.5.gem
That's all
This error occurs with Ruby 2.0.0 version. Downgrade to Ruby 1.9.3

Resources