Getting a error when trying to add the stripe gem - ruby-on-rails

I am trying to install the stripe gem and I'm getting this error
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/Users/Fysh/.rvm/rubies/ruby-2.0.0-p643/bin/ruby -r ./siteconf20151005-1267-af6sn6.rb extconf.rb checking for main() in
-lstdc++... * extconf.rb failed * Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers.
Check the mkmf.log file for more details. You may need configuration
options.
Provided configuration options: --with-opt-dir --without-opt-dir
--with-opt-include --without-opt-include=${opt-dir}/include
--with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog
--without-make-prog --srcdir=. --curdir
--ruby=/Users/Fysh/.rvm/rubies/ruby-2.0.0-p643/bin/ruby
--with-static-libstdc++ --without-static-libstdc++ --with-stdc++lib
--without-stdc++lib
/Users/Fysh/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/mkmf.rb:434:in
try_do': The compiler failed to generate an executable file.
(RuntimeError) You have to install development tools first. from
/Users/Fysh/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/mkmf.rb:519:in
try_link0' from
/Users/Fysh/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/mkmf.rb:534:in
try_link' from
/Users/Fysh/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/mkmf.rb:714:in
try_func' from
/Users/Fysh/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/mkmf.rb:944:in
block in have_library' from
/Users/Fysh/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/mkmf.rb:889:in
block in checking_for' from
/Users/Fysh/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/mkmf.rb:340:in
block (2 levels) in postpone' from
/Users/Fysh/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/mkmf.rb:310:in
open' from
/Users/Fysh/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/mkmf.rb:340:in
block in postpone' from
/Users/Fysh/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/mkmf.rb:310:in
open' from
/Users/Fysh/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/mkmf.rb:336:in
postpone' from
/Users/Fysh/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/mkmf.rb:888:in
checking_for' from
/Users/Fysh/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/mkmf.rb:939:in
have_library' from extconf.rb:6:in'
extconf failed, exit code 1
Gem files will remain installed in
/Users/Fysh/.rvm/gems/ruby-2.0.0-p643/gems/unf_ext-0.0.7.1 for
inspection. Results logged to
/Users/Fysh/.rvm/gems/ruby-2.0.0-p643/extensions/x86_64-darwin-14/2.0.0-static/unf_ext-0.0.7.1/gem_make.out
An error occurred while installing unf_ext (0.0.7.1), and Bundler
cannot continue. Make sure that gem install unf_ext -v '0.0.7.1'
succeeds before bundling.

Solved had an xcode update after I updated it worked.

Related

Failed to build gem native extension - error while installing unicorn gem on Ruby 2.2.2

I am getting following error while installing unicorn on Ruby 2.2.2
root#magnificent-apps:~# gem install unicorn --no-ri --no-rdoc
Building native extensions. This could take a while...
ERROR: Error installing unicorn:
ERROR: Failed to build gem native extension.
/usr/local/rvm/rubies/ruby-2.2.2/bin/ruby -r ./siteconf20170116-4446-95pp1l.rb extconf.rb
checking for mmap() in sys/mman.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/local/rvm/rubies/ruby-2.2.2/bin/$(RUBY_BASE_NAME)
--with-atomic_ops-dir
--without-atomic_ops-dir
--with-atomic_ops-include
--without-atomic_ops-include=${atomic_ops-dir}/include
--with-atomic_ops-lib
--without-atomic_ops-lib=${atomic_ops-dir}/lib
/usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/mkmf.rb:541:in `try_link0'
from /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/mkmf.rb:556:in `try_link'
from /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/mkmf.rb:735:in `try_func'
from /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/mkmf.rb:1020:in `block in have_func'
from /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/mkmf.rb:911:in `block in checking_for'
from /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/mkmf.rb:351:in `block (2 levels) in postpone'
from /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/mkmf.rb:321:in `open'
from /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/mkmf.rb:351:in `block in postpone'
from /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/mkmf.rb:321:in `open'
from /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/mkmf.rb:347:in `postpone'
from /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/mkmf.rb:910:in `checking_for'
from /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/mkmf.rb:1019:in `have_func'
from extconf.rb:4:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in /usr/local/rvm/gems/ruby-2.2.2/gems/raindrops-0.17.0 for inspection.
Results logged to /usr/local/rvm/gems/ruby-2.2.2/extensions/x86_64-linux/2.2.0/raindrops-0.17.0/gem_make.out
Can anybody suggest how to fix this?
Try this from your terminal sudo apt-get install build-essential to install all needed dependencies. It did trick for me.

rails gem unf_ext will not install when bundling with stripe

Stack/ Tech specs:
ruby 2.2.2
rails 4.2.3
Using OS X 10.11
I am attempting to install stripe in my rails app. Added gem 'stripe' to my Gemfile, ran bundle install, and received this error message:
/Users/me/.rbenv/versions/2.2.2/bin/ruby -r ./siteconf20151006-77029-11oqg9a.rb extconf.rb
checking for main() in -lstdc++... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/t/.rbenv/versions/2.2.2/bin/$(RUBY_BASE_NAME)
--with-static-libstdc++
--without-static-libstdc++
--with-stdc++lib
--without-stdc++lib
/Users/t/.rbenv/versions/2.2.2/lib/ruby/2.2.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/t/.rbenv/versions/2.2.2/lib/ruby/2.2.0/mkmf.rb:541:in `try_link0'
from /Users/t/.rbenv/versions/2.2.2/lib/ruby/2.2.0/mkmf.rb:556:in `try_link'
from /Users/t/.rbenv/versions/2.2.2/lib/ruby/2.2.0/mkmf.rb:735:in `try_func'
from /Users/t/.rbenv/versions/2.2.2/lib/ruby/2.2.0/mkmf.rb:966:in `block in have_library'
from /Users/t/.rbenv/versions/2.2.2/lib/ruby/2.2.0/mkmf.rb:911:in `block in checking_for'
from /Users/t/.rbenv/versions/2.2.2/lib/ruby/2.2.0/mkmf.rb:351:in `block (2 levels) in postpone'
from /Users/t/.rbenv/versions/2.2.2/lib/ruby/2.2.0/mkmf.rb:321:in `open'
from /Users/t/.rbenv/versions/2.2.2/lib/ruby/2.2.0/mkmf.rb:351:in `block in postpone'
from /Users/t/.rbenv/versions/2.2.2/lib/ruby/2.2.0/mkmf.rb:321:in `open'
from /Users/t/.rbenv/versions/2.2.2/lib/ruby/2.2.0/mkmf.rb:347:in `postpone'
from /Users/t/.rbenv/versions/2.2.2/lib/ruby/2.2.0/mkmf.rb:910:in `checking_for'
from /Users/t/.rbenv/versions/2.2.2/lib/ruby/2.2.0/mkmf.rb:961:in `have_library'
from extconf.rb:6:in `<main>'
extconf failed, exit code 1
Searched for known issues and found Gem unf_ext failed to build gem native extension, but this appears to be related to an older version & an older version of xcode.
Thank you in advance!

gem install compass not working

having trouble running the line gem install compass in terminal. It's returning the following error. Is anyone able to help out with this problem?
ERROR: Error installing compass:
ERROR: Failed to build gem native extension.
/usr/local/rvm/rubies/ruby-1.9.3-p392/bin/ruby -r ./siteconf20150225-51908-cfetpz.rb extconf.rb
checking for ffi.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/local/rvm/rubies/ruby-1.9.3-p392/bin/ruby
--with-ffi_c-dir
--without-ffi_c-dir
--with-ffi_c-include
--without-ffi_c-include=${ffi_c-dir}/include
--with-ffi_c-lib
--without-ffi_c-lib=${ffi_c-dir}/lib
--with-libffi-config
--without-libffi-config
--with-pkg-config
--without-pkg-config
/usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:381:in
try_do': The compiler failed to generate an executable file.
(RuntimeError)
You have to install development tools first.
from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:506:in
try_cpp'
from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:931:in
block in have_header'
from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:790:in
block in checking_for'
from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:284:in
block (2 levels) in postpone'
from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:254:in
open'
from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:284:in
block in postpone'
from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:254:in
open'
from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:280:in
postpone'
from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:789:in
checking_for'
from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:930:in
have_header'
from extconf.rb:16:in'
extconf failed, exit code 1
Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.3-p392/gems/ffi-1.9.6 for inspection.
Results logged to /usr/local/rvm/gems/ruby-1.9.3-p392/extensions/x86_64-darwin-10/1.9.1-static/ffi-1.9.6/gem_make.out
The error you're getting is
(RuntimeError)
You have to install development tools first.
If you're on OS X (my best guess from the output) you need to install the Xcode developer tools first. You can do this with the command: xcode-select --install.

error in `install bundler` while installing ruby gems on windows machine

I am trying to intsall middleman - a static site generator, which uses ruby gems. It is able to build all native extensions but not wdm. I am getting the below error message when I run install bundler command in my command prompt.
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
C:/Ruby200/bin/ruby.exe -r ./siteconf20140814-4200-t0fvuf.rb extconf.rb
checking for main() in -lkernel32... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/Ruby200/bin/ruby
--with-kernel32lib
--without-kernel32lib
C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:434:in `try_do': The compiler failed to genera
te an executable file. (RuntimeError)
You have to install development tools first.
from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:519:in `try_link0'
from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:534:in `try_link'
from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:720:in `try_func'
from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:950:in `block in have_library'
from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:895:in `block in checking_for'
from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:340:in `block (2 levels) in postp
one'
from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:310:in `open'
from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:340:in `block in postpone'
from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:310:in `open'
from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:336:in `postpone'
from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:894:in `checking_for'
from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:945:in `have_library'
from extconf.rb:19:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in C:/Ruby200/lib/ruby/gems/2.0.0/gems/wdm-0.1.0
for inspection.
Results logged to C:/Ruby200/lib/ruby/gems/2.0.0/extensions/x86-mingw32/2.0.0/wd
m-0.1.0/gem_make.out
An error occurred while installing wdm (0.1.0), and Bundler cannot continue.
Make sure that `gem install wdm -v '0.1.0'` succeeds before bundling.
Do I need to install something before running it.
The answer is in the logs actually. the gem "wdm" which makes the bundle install fail requires the "development tools" to be installed.
You can install those by following the instructions there.

stuck on installing ruby rails

im following a tutorial to do this and done step by step untill this came up i seen somone had the same issue but wasnt sorted please someone direct me on how to finish off what im asking it to do many thanks
c:\dev\mysql2>gem install mysql2-0.3.13.gem --no-ri --no-rdoc -- --with-mysql-di
r=c:\mysql-connector-c-noinstall-6.0.2-win32
Temporarily enhancing PATH to include DevKit...
Building native extensions with: '--with-mysql-dir=c:\mysql-connector-c-noinstal
l-6.0.2-win32'
This could take a while...
ERROR: Error installing mysql2-0.3.13.gem:
ERROR: Failed to build gem native extension.
C:/Ruby200/bin/ruby.exe extconf.rb --with-mysql-dir=c:\mysql-connector-c-noi
nstall-6.0.2-win32
checking for rb_thread_blocking_region()... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/Ruby200/bin/ruby
C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:434:in `try_do': The compiler failed to genera
te an executable file. (RuntimeError)
You have to install development tools first.
from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:519:in `try_link0'
from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:534:in `try_link'
from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:720:in `try_func'
from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:1004:in `block in have_func'
from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:895:in `block in checking_for'
from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:340:in `block (2 levels) in postp
one'
from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:310:in `open'
from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:340:in `block in postpone'
from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:310:in `open'
from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:336:in `postpone'
from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:894:in `checking_for'
from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:1003:in `have_func'
from extconf.rb:9:in `<main>'
Gem files will remain installed in C:/Ruby200/lib/ruby/gems/2.0.0/gems/mysql2-0.
3.13 for inspection.
Results logged to C:/Ruby200/lib/ruby/gems/2.0.0/gems/mysql2-0.3.13/ext/mysql2/g
em_make.out
c:\dev\mysql2>
I would highly reccomend using RailsInstaller to create a development stack on windows.
http://railsinstaller.org/en

Resources