Cannot install gem file - ruby

I've been on this for a few hrs already googled everything. Tried tons of answers, im using ruby x64 and devkit x64 (originaly isntalled the incorect one x32 but i just deleted it and installed the correct one x64)
Cant install json or (my actual target) ruby-debug-ide -v 0.4.32
gem version = 2.4.7
ruby version =ruby 2.4.2p198 (2017-09-14 revision 59899) [x64-mingw32]
C:\WINDOWS\system32>gem install json
Building native extensions. This could take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
C:/Ruby24-x64/bin/ruby.exe -r ./siteconf20171013-12212-1y42085.rb extconf.rb
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
generating generator-x64-mingw32.def
compiling generator.c
linking shared-object json/ext/generator.so
c:/ruby24-x64/programing/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lgmp
collect2.exe: error: ld returned 1 exit status
make: *** [generator.so] Error 1
make failed, exit code 2
Gem files will remain installed in C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/json-2.1.0 for inspection.
Results logged to C:/Ruby24-x64/lib/ruby/gems/2.4.0/extensions/x64-mingw32/2.4.0/json-2.1.0/gem_make.out

You might want to try a cloud9 editor, and per this tutorial https://www.railstutorial.org/book/beginning
It will save you quite a bit of pain setting up your rails environment.

Related

Failed to build byebug native gem extension

I literally looked everywhere and couldnt find an answer to it. I installed ruby on my windows with the installer they proviude on their website. Yes, i am running it on a 64 bit which is what my devkit is on. idk what to do i literally looke everywehreeeee someone please help!!!
ruby 2.5.3p105 (2018-10-18 revision 65156) [x64-mingw32]
C:\Users\ASUS>gem install byebug
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing byebug:
ERROR: Failed to build gem native extension.
current directory: C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/byebug-11.0.0/ext/byebug
C:/Ruby25-x64/bin/ruby.exe -I C:/Ruby25-x64/lib/ruby/site_ruby/2.5.0 -r ./siteconf20190314-10812-4pefs.rb extconf.rb
creating Makefile
current directory: C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/byebug-11.0.0/ext/byebug
make "DESTDIR=" clean
current directory: C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/byebug-11.0.0/ext/byebug
make "DESTDIR="
generating byebug-x64-mingw32.def
compiling breakpoint.c
In file included from c:/Ruby25-x64/include/ruby-2.5.0/ruby/ruby.h:29:0,
from c:/Ruby25-x64/include/ruby-2.5.0/ruby.h:33,
from byebug.h:4,
from breakpoint.c:1:
c:/Ruby25-x64/include/ruby-2.5.0/ruby/defines.h:151:22: fatal error: setjmpex.h: No such file or directory
compilation terminated.
make: *** [breakpoint.o] Error 1
make failed, exit code 2
Gem files will remain installed in C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/byebug-11.0.0 for inspection.
Results logged to C:/Ruby25-x64/lib/ruby/gems/2.5.0/extensions/x64-mingw32/2.5.0/byebug-11.0.0/gem_make.out

gem install json issue with Mac OS X 10.11

I'm trying to install Ruby/JSON on Mac OS X 10.11.
However, the gem install command gives the error message:
smcho#macho ruby-rails-sample> gem install json
Building native extensions. This could take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
/Users/smcho/.rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20151025-39148-au2m2x.rb extconf.rb
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling generator.c
linking shared-object json/ext/generator.bundle
ld: warning: directory not found for option '-L/Users/haven/.sm/pkg/active/lib'
make "DESTDIR=" install
./install -m 0755 generator.bundle ./.gem.20151025-39148-i7g03f/json/ext
make: ./install: No such file or directory
make: *** [install-so] Error 1
make install failed, exit code 2
Gem files will remain installed in /Users/smcho/.rvm/gems/ruby-2.2.1/gems/json-1.8.3 for inspection.
Results logged to /Users/smcho/.rvm/gems/ruby-2.2.1/extensions/x86_64-darwin-14/2.2.0-static/json-1.8.3/gem_make.out
The message says make: ./install: No such file or directory, but I'm not sure how to fix this issue.
Is this a known issue, or is there a way to bypass this one?
This is my system version. I executed gem update --system to get the latest version.
> ruby -v
ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-darwin14]
> gem -v
2.4.8
I should have used the latest ruby (2.2.3) not the old one (2.2.1)
ruby-rails-sample> rvm --default use 2.2.3
Using /Users/smcho/.rvm/gems/ruby-2.2.3
smcho#macho ruby-rails-sample> gem install json
Building native extensions. This could take a while...
Successfully installed json-1.8.3
Parsing documentation for json-1.8.3
Installing ri documentation for json-1.8.3
Done installing documentation for json after 1 seconds
1 gem installed

Cannot install pushmeup plugin

I try to install pushmeup plugin for phonegap push notifications (ios).
When I run command sudo gem install pushmeup I get this error:
Building native extensions. This could take a while... ERROR: Error
installing pushmeup: ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
extconf.rb creating Makefile
make "DESTDIR=" clean
make "DESTDIR=" compiling generator.c linking shared-object
json/ext/generator.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: * [generator.bundle] Error 1
make failed, exit code 2
Gem files will remain installed in
/Library/Ruby/Gems/2.0.0/gems/json-1.8.1 for inspection. Results
logged to
/Library/Ruby/Gems/2.0.0/extensions/universal-darwin-13/2.0.0/json-1.8.1/gem_make.out
GitHub:
https://github.com/phonegap-build/PushPlugin
Params:
ruby -v ruby 2.0.0p247 (2013-06-27 revision 41674)
[universal.x86_64-darwin13]
gem -v
2.2.2
Mac OS X v 10.9.2
XCode Version 5.1 (5B130a)
cordova -v
3.4.0-0.1.3
Apparently Apple broke something on Mavericks, they removed the warning flag unused-command-line-argument-hard-error-in-future acording to this issue: #528
Please try this command:
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future sudo gem install pushmeup
what it does? this sets the environment variable: ARCHFLAGS= this adds a ignore warnings -Wno-error= and this is the warning that you don't see in mavericks unused-command-line-argument-hard-error-in-future (which should be ignored)
In Apple documentation:
Compiler
As of Apple LLVM compiler version 5.1 (clang-502) and later, the
optimization level -O4 no longer implies link time optimization (LTO).
In order to build with LTO explicitly use the -flto option in addition
to the optimization level flag. (15633276) The Apple LLVM compiler in
Xcode 5.1 treats unrecognized command-line options as errors. This
issue has been seen when building both Python native extensions and
Ruby Gems, where some invalid compiler options are currently
specified. Projects using invalid compiler options will need to be
changed to remove those options. To help ease that transition, the
compiler will temporarily accept an option to downgrade the error to a
warning:
-Wno-error=unused-command-line-argument-hard-error-in-future
Note: This option will not be supported in the future. To workaround
this issue, set the ARCHFLAGS environment variable to downgrade the
error to a warning. For example, you can install a Python native
extension with:
$ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future
easy_install ExtensionName
Similarly, you can install a Ruby Gem with:
$ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future
gem install GemName 16214764 updated
EDIT HISTORY
just tested on my machine, using same ruby:
$ gem install pushmeup
Fetching: pushmeup-0.1.2.gem (100%)
Successfully installed pushmeup-0.1.2
Parsing documentation for pushmeup-0.1.2
Installing ri documentation for pushmeup-0.1.2
Done installing documentation for pushmeup after 1 seconds
1 gem installed
From what i saw you are not using rvm or rbenv so the problem is not in gcc dependencies
Accordingly to the output provided, the error was when installing json-1.8.1.
Can you post the log located at: /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-13/2.0.0/json-1.8.1/gem_make.out ?

Trying to install jekyll, getting the following error: Failed to build gem native extension

I'm trying to install Jekyll but I keep getting stuck on this error. Here's the output to my attempt at installing it
clinch#clinch-VirtualBox:~$ gem install jekyllBuilding native extensions. This could take a while...
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.
/home/clinch/.rvm/rubies/ruby-1.9.3-p392/bin/ruby extconf.rb
creating Makefile
make
compiling porter.c
cc1: unrecognized option `-Wextra'
cc1: unrecognized option `-Wno-missing-field-initializers'
cc1: unrecognized option `-Wdeclaration-after-statement'
make: *** [porter.o] Error 1
Gem files will remain installed in /home/clinch/.rvm/gems/ruby-1.9.3-p392/gems/fast-stemmer-1.0.2 for inspection.
Results logged to /home/clinch/.rvm/gems/ruby-1.9.3-p392/gems/fast-stemmer-1.0.2/ext/gem_make.out
clinch#clinch-VirtualBox:~$ gcc -v
Using built-in specs.
Configured with: ./configure --target=mips-dec-ultrix42 --program-prefix=mips- --with-gnu-as --with-gnu-ld --enable-obsolete
Thread model: single
gcc version 3.2.2
clinch#clinch-VirtualBox:~$ ruby -v
ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-linux]
clinch#clinch-VirtualBox:~$ uname -a
Linux clinch-VirtualBox 3.2.0-37-generic #58-Ubuntu SMP Thu Jan 24 15:28:10 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
I've installed the ruby1.9.1-dev package already. I've tried compiling with gcc 4.6 as opposed to 3.2.2 showed in the output I pasted. I also don't know if the native extension error is making the gcc die. I've also rebuilt ruby from scratch.
Maybe I should try with another Ruby version? Though I know 1.9.3 is supported by jekyll.
Any help will be appreciated.
Try installing Jekyll from Ruby or Ruby and Rails command prompt instead of any other command prompt
I am not an expert at all, so my suggested solution is just a 'guess' based on my experience below.
I am using Windows 7. Although you're using Ubuntu and not Windows 7, this solution might work for pretty much anyone with the same problem.
First, I installed Ruby from RailsInstaller. Then, I wanted to install Jekyll. I tried installing Jekyll from Cygwin. However, I received the following error (although it is not identical to the questioner's error, I think it is sufficiently similar):
$ gem install jekyll
Building native extensions. This could take a while...
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.
/usr/bin/ruby.exe extconf.rb
creating Makefile
make
gcc -I. -I/usr/include/ruby-1.9.1/x86_64-cygwin -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I. -ggdb -O2 -pipe -fno-strict-aliasing -Wall -o posix-spawn.o -c posix-spawn.c
posix-spawn.c:9:19: fatal error: spawn.h: No such file or directory
#include <spawn.h>
^
compilation terminated.
Makefile:206: recipe for target `posix-spawn.o' failed
make: *** [posix-spawn.o] Error 1
Gem files will remain installed in /usr/lib/ruby/gems/1.9.1/gems/posix-spawn-0.3.6 for inspection.
Results logged to /usr/lib/ruby/gems/1.9.1/gems/posix-spawn-0.3.6/ext/gem_make.out
However, when I tried to install Jekyll from Command Prompt with Ruby and Rails (i.e. Ruby command prompt), Jekyll installed successfully.
Just in case this matters, I removed the system variable {Variable:Comspec,Value:C:\Windows\system32\cmd.exe} before (successfully) trying to install Jekyll from the Ruby and Rails command prompt.

json doesn't install

I am having a problem getting my ruby system up and running. Specifically, I get the following error when trying
gem install json
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
c:/Ruby193/bin/ruby.exe extconf.rb
creating Makefile
make
generating parser-i386-mingw32.def
compiling parser.c
gcc.exe: CreateProcess: No such file or directory
make: *** [parser.o] Error 1
Gem files will remain installed in c:/Ruby193/lib/ruby/gems/1.9.1/gems/json-1.6.
Results logged to c:/Ruby193/lib/ruby/gems/1.9.1/gems/json-1.6.3/ext/json/ext/pa
I know that my gcc works. I don't get the same error when installing
`gem install json_pure
However, when I try a
bundle install
I get the error. I am extremely new to ruby and rails, so any help would be appreciated.
install devkit with --force option

Resources