zendesk app tools ZAT Installation errorFailed to build gem native extension - zendesk

I am trying to install "ZAT" the Zendesk app tools following the documentation, but receiving this error: \
Building native extensions. This could take a while...
ERROR: Error installing zendesk_apps_tools:
ERROR: Failed to build gem native extension.
current directory: /Library/Ruby/Gems/2.6.0/gems/eventmachine-1.2.7/ext
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20220105-47488-6pwgmm.rb extconf.rb
checking for -lcrypto... *** 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.
ruby version => ruby 2.6.3p62 (2019-04-16 revision 67580)
xcode-select => xcode-select version 2384.
macOs : BIg Sur version 11.6.2
any idea what is the issue?

Installation via rvm resolves this issue.

I had the same problem on my Mac Big Sur 11.6 with M1 chip. None of the suggested solutions helps me (I tried to reinstall Xcode, updating/reinstalling command line tools, deal with the installation of thin separately, etc.). One thing that really helps me it's changing the ruby version to 2.6.9 with rbenv (https://gorails.com/setup/osx/11-big-sur - check Installing Ruby . Follow this instruction, but choose another ruby version). After change ruby version, make sure the correct version of ruby is currently selected with ruby -v and then try execute gem install zendesk_apps_tools again. I tried several versions of ruby before it worked for me, but in the end everything was fine on 2.6.9 version

Related

Unable to install cocoapods

Hi I am learning React Native, I was able to build Android version successfully but here in the iOS version I am facing so many issues. I'm developing a Podcast application for both Android and iOS but when I'm trying to install cocoapods in my Application I am getting the following error,
Building native extensions. This could take a while...
ERROR: Error installing cocoapods:
ERROR: Failed to build gem native extension.
current directory: /Library/Ruby/Gems/2.6.0/gems/json-2.3.1/ext/json/ext/generator
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20201214-42573-vm30sv.rb extconf.rb
creating Makefile
current directory: /Library/Ruby/Gems/2.6.0/gems/json-2.3.1/ext/json/ext/generator
make "DESTDIR=" clean
current directory: /Library/Ruby/Gems/2.6.0/gems/json-2.3.1/ext/json/ext/generator
make "DESTDIR="
compiling generator.c
In file included from generator.c:1:
In file included from ./../fbuffer/fbuffer.h:5:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby.h:33:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:24:10: fatal error: 'ruby/config.h' file not found
#include "ruby/config.h"
^~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:24:10: note: did not find header 'config.h' in framework 'ruby' (loaded from '/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks')
1 error generated.
make: *** [generator.o] Error 1
make failed, exit code 2
Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/json-2.3.1 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/json-2.3.1/gem_make.out
Hardware: Mac Mini
Can anyone help me in solving this issue. I'd like to install it with sudo gem install cocoapods rather than brew
You should not use Apple's Ruby installation. That installation exists solely for internal use by Apple itself.
Since you have specified in your question that you want to use Apple's Ruby installation, I am afraid there is nothing that can be done to fix the problem.
If, on the other hand, you are willing to use a different Ruby installation (installed by hand, with Homebrew, with ruby-install, with ruby-build, with RVM, asdf, or any other way), then the problem should not present itself in the first place.
For more information, see for example
macOS 10.15 Catalina Release Notes
PSA: Do not use system Ruby
Why you shouldn't use the System Ruby
If possible, do not use the ruby system version on Mac OSX
you need to install Xcode Command Line Tools。
command:
xcode-select --install

Rails install fails - cause by Nokogiri gem?

I am trying to setup a ruby on rails environment on my mac in order to start using the RubyMine IDE.
I have used homebrew, rbenv and all other required libraries in order to install ruby/rails - however when I sudo gem install rails the install fails due to :
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
current directory: /usr/local/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/ext/nokogiri
/usr/local/opt/ruby/bin/ruby -r ./siteconf20161110-767-xwnfls.rb extconf.rb
checking if the C compiler accepts ... yes
checking if the C compiler accepts -Wno-error=unused-command-line-argument-hard-error-in-future... no
Building nokogiri using packaged libraries.
Using mini_portile version 2.1.0
checking for iconv.h... yes
checking for gzdopen() in -lz... no
zlib is missing; necessary for building libxml2
*** 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.
I have tried to install Nokogiri on it's own and I get the following error:
ERROR: While executing gem ... (Errno::EACCES)
Permission denied # rb_sysopen - /usr/local/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/.autotest
I really hope somebody can help me as I am quite a noob to RonR and I feel like things have gotten messy directory/permission wise,
Thank you.
Let's take a quick look at a small part of the error that you have provided us.
zlib is missing; necessary for building libxml2
It's trying to tell you that you do not have zlib, so let's get it. Since you said you're using a Mac, I would install a package manager like Homebrew. Try doing brew install zlib to install this package.
Additionally, if you're starting out learning Ruby, regardless of what platform you are using, it might be helpful to use something like rbenv or rvm to manage different versions of Ruby and the gems that go along with those versions. You will run into less permissions issues (e.g. having to run gem install as a privileged user), some of which may be easy to solve, but some of which may send you down a rabbit hole for a few hours.

Failed to build native gem extension sqlite3

I'm trying to install sqlite3-ruby on Cygwin with gem install sqlite3-ruby -v x.x.x and I get the following error:
Building native extensions. This could take a while...
ERROR: Error installing sqlite3-ruby:
ERROR: Failed to build gem native extension.
/usr/bin/ruby.exe extconf.rb
checking for fdatasync() in -lrt... *** 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.
Does anyone know how to install sqlite3 for Ruby on Rails on Cygwin. As I understand it the SQLite RubyGem isn't actually a *Ruby*Gem, it's a "*C*Gem", IOW it's written in C. This means it has to be compiled and linked to the Ruby interpreter when you install it, so any help?
So this isn't a complete solution as I don't have a windows box and cygwin handy but the error message suggests that the linux utility fdatasync can't be found.
The tools linux man page can be found here
http://linux.die.net/man/2/fdatasync
Maybe find out if you have fdatasync installed correctly and try again.
I ran into this issue just now – the first time I wanted to install a Ruby gem
on my new Cygwin 64-bit system.
As I understand it the SQLite RubyGem isn't actually a RubyGem, it's a
"CGem", IOW it's written in C. This means it has to be compiled and linked
to the Ruby interpreter when you install it.
Cygwin actually provide a pre-compiled package which installs the sqlite3
gem files including the sqlite3_native.so linked library file. The name of
the package is ruby-sqlite3 and you can install it using Cygwin’s Setup.exe.
I personally like to use apt-cyg
when possible (not always) so I installed the package using:
apt-cyg install ruby-sqlite3
This package installs the appropriate gem files as can be seen by running
cygcheck -l ruby-sqlite3:
/usr/lib/gems/ruby/2.0.0/sqlite3-1.3.9/gem.build_complete
/usr/lib/gems/ruby/2.0.0/sqlite3-1.3.9/sqlite3/sqlite3_native.so
/usr/share/gems/gems/sqlite3-1.3.9/API_CHANGES.rdoc
/usr/share/gems/gems/sqlite3-1.3.9/ChangeLog.cvs
/usr/share/gems/gems/sqlite3-1.3.9/CHANGELOG.rdoc
/usr/share/gems/gems/sqlite3-1.3.9/faq/faq.rb
/usr/share/gems/gems/sqlite3-1.3.9/faq/faq.yml
/usr/share/gems/gems/sqlite3-1.3.9/Gemfile
/usr/share/gems/gems/sqlite3-1.3.9/lib/sqlite3/constants.rb
/usr/share/gems/gems/sqlite3-1.3.9/lib/sqlite3/database.rb
/usr/share/gems/gems/sqlite3-1.3.9/lib/sqlite3/errors.rb
/usr/share/gems/gems/sqlite3-1.3.9/lib/sqlite3/pragmas.rb
/usr/share/gems/gems/sqlite3-1.3.9/lib/sqlite3/resultset.rb
/usr/share/gems/gems/sqlite3-1.3.9/lib/sqlite3/statement.rb
/usr/share/gems/gems/sqlite3-1.3.9/lib/sqlite3/translator.rb
/usr/share/gems/gems/sqlite3-1.3.9/lib/sqlite3/value.rb
/usr/share/gems/gems/sqlite3-1.3.9/lib/sqlite3/version.rb
/usr/share/gems/gems/sqlite3-1.3.9/lib/sqlite3.rb
/usr/share/gems/gems/sqlite3-1.3.9/LICENSE
/usr/share/gems/gems/sqlite3-1.3.9/Manifest.txt
/usr/share/gems/gems/sqlite3-1.3.9/README.rdoc
/usr/share/gems/gems/sqlite3-1.3.9/tasks/faq.rake
/usr/share/gems/gems/sqlite3-1.3.9/tasks/gem.rake
/usr/share/gems/gems/sqlite3-1.3.9/tasks/native.rake
/usr/share/gems/gems/sqlite3-1.3.9/tasks/vendor_sqlite3

rvm install rails on Mac OSX 10.7.3

was hoping someone could point me in the right direction as I am unable to find a previously posted answer to my question of trying to install rails on my mac mini running Lion OSX 10.7.3. I have ruby version 1.8.7 and rvm 1.12.5 but when I come to install rails using sudo gem install rails I get the following:
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/json-1.7.0 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/json-1.7.0/ext/json/ext/parser/gem_make.out
The content of gem_make.out are:
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h
which did not really help me so not sure what it is I am missing? Any help or directions to help me solve this problem would be appreciated. Many thanks.
rvm is not intended to be used with sudo except during a multi-user installation - try simply gem install rails. Even better, rvm now has a guided rails install,
curl -L get.rvm.io | bash -s stable --rails
Take a look at RVM installation page for more details. If you're still having trouble, post the commands you're trying. The #rvm channel on irc.freenode.net is very helpful too.
In order to build Ruby and many other gems you'll need a working compiler. Unfortunately Apple has made this quite complex so there's a command in rvm to help: rvm requirements
you should not use sudo gem ... it basically looses your environment settings and prevents you from using RVM.
Please follow #tantrix instructions.
Sounds like you'll need to install XCode on your machine to get the necessary header files for building the Rails gem. It's a huge installation, unfortunately.
There was, at one point, a way to load (e.g.) the stuff on your machine that you need to build Rails without installing XCode, but I can't seem to locate it at the moment.
In my case,
I run rvm requirements and it helps me install gcc.
But the problem still exists and only solved after I restarted osx.

Error while installing cucumber (involving gherkin)

I'm trying to set up cucumber for rails. I included this in my Gemfile and ran bundle install.
gem 'cucumber-rails'
gem 'database_cleaner'
I got this error. What should I do?
ERROR: Error installing gherkin:
ERROR: Failed to build gem native extension.
/Users/[my_user_name]/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb
checking for main() in -lc... *** 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.
This question is a bit old, but as I just had a similar problem on my machine I will document my solution here.
The problem seems to be related to OS X Lion, GCC, clang etc. (see https://github.com/carlhuda/bundler/issues/1590 and https://github.com/carlhuda/bundler/issues/1600). As how ruby was compiled seems to be the problem I decided to re-install (and also upgrade) ruby.
Here is what solved this issue for me:
I use the Command Line Tools for Xcode package.
Furthermore the current version of rbenv and ruby-build (both installed via homebrew)
rbenv install 1.9.3-p125 failed (see https://github.com/sstephenson/ruby-build/issues/129 and https://github.com/sstephenson/ruby-build/issues/130)
remove the require_gcc line for 1.9.3-p125 (if installed with homebrew you find the file under /usr/local/Cellar/ruby-build/20120216/share/ruby-build/1.9.3-p125)
finally successfully install 1.9.3-p125 with env CC=/usr/bin/gcc rbenv install 1.9.3-p125
Complicated but I can now install gems with natiive extensions.
Hope this helps.
Update: btw. It is possible to keep using ruby-1.9.2-p290, all you have to do is re-install it.
First "uninstall" the old ruby-1.9.2-p290: rm -rf .rbenv/versions/1.9.2-p290
Next remove the require_gcc line for 1.9.2-p290
Finally install with env CC=/usr/bin/gcc rbenv install 1.9.2-p290

Resources