watir install report failed to build gem native extension - ruby

I've installed a instantrail2.0. I want to install watir 1.65
First I installed watir-1.6.5.gem it said 302 fetching http://gems.r....
then I downlord a rubygems-update-1.3.7.gem and type
gem install --local rubygems-update-1.3.7.gem
successfully installed.
then I type in update_rubygems
next I type in gem install watir-1.6.5.gem
but it appears ERROR:Failed to build gem native extension
I searched and found an answer that 1.3.7 doesn't support win32.
then I type
gem install sqlite3-ruby -v 1.3.0 gem install watir-1.6.5.gem
ERROR:Failed to build gem native extension
gem install sqlite3-ruby -v 1.2.3 gem install watir-1.6.5.gem
ERROR:Failed to build gem native extension
How can I do next??

use a more current version of Watir

I second Zeljko, going with the latest versions of rubygems and watir totally makes sense. If you must stick to older gems, try installing Ruby DevKit and then do the gem install to see if that helps.

What version of Ruby are you using? You should be using Ruby 1.8.6 with that version of Watir. I am also wondering if part of your problem is that you are doing a local install, instead of installing from internet. Local installs of Watir are difficult because of all of its dependencies.

Related

Installing Ruby on Rails latest version matching Ruby 3.0

When I try the following, after installing Ruby 3.0 from snap on Ubuntu 18.04::
gem install rails
I get this error:
/snap/ruby/201/lib/ruby/3.0.0/x86_64-linux/rbconfig.rb:13:in `<module:RbConfig>': ruby lib version (3.0.0) doesn't match executable version (2.5.1) (RuntimeError)
It was right after using
rails new rest-api-messages --api --database=postgresql
and trying to install PostGRES
gem install pg -v '1.2.3' --source 'https://rubygems.org/'
How could I solve this? is Ruby on Rails only for version 2.5.1 and lower?
edit: Then I got
Can't find the 'libpq-fe.h header when trying to install pg gem
Solved with
sudo apt-get install libpq-dev
Duplicate from Can't find the 'libpq-fe.h header when trying to install pg gem
My guess is you already had Ruby 2.5 installed and they are stepping on each other. Ruby versions don't overwrite each other. You need to uninstall Ruby 3.0 and 2.5 and install a Ruby version manager then install Ruby using it. This will also give you a path to move forward easily. Check out Ruby version manager like rbenv or RVM. Take a look at both. For what it's worth. I have used both and finally settled on rbenv.

Unable to Install Shoes :ruby

I am beginner in ruby and wanted to install and GUI toolkit. So i surfed web and found shoes was one toolkit so i downloaded the ".install" file it didn't work saying some permission error, then i downloaded the older version which was ".run" format and that too didn't work so i found a gem of shoes when i try to download i get the below in ruby. i downloaded this shoes from git and still facing some error.
root#Drona:/home/naren/shoes4# gem install bundler && bundle install
Successfully installed bundler-1.10.5
1 gem installed
Installing ri documentation for bundler-1.10.5...
Installing RDoc documentation for bundler-1.10.5...
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all
non-root users on this machine.
Fetching gem metadata from https://rubygems.org/............
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies....
Using rake 10.4.2
Using addressable 2.3.8
Using after_do 0.3.1
Using ast 2.0.0
Using parser 2.2.2.6
Using astrolabe 1.3.0
Using benchmark-ips 2.2.0
Using bouncy-castle-java 1.5.0147
Using docile 1.1.5
Installing json 1.8.3 with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from extconf.rb:1:in `<main>'
Gem files will remain installed in /var/lib/gems/1.9.1/gems/json-1.8.3 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/json-1.8.3/ext/json/ext/generator/gem_make.out
An error occurred while installing json (1.8.3), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.3'` succeeds before bundling.
the above is the terminal output.
Ruby version installed is :
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]
someone help we out with this installation
and if i have done anything wrong in installation of shoes then let me know
From your terminal directory it seems like you are trying to install shoes4 on ruby 1.9.3. To install shoes4 you need JRuby and a JDK - please follow the instructions in the readme
Shoes 3 can't be installed through gem install due to the way it was built. For Shoes 3 you need the install script, I recommend the appropriate Shoes 3.2 version from this page. If this fails with some error please let us know the error so we can help :)
You should use the gem program to install shoes. If on your command line you type gem install shoes you should be fine.
to use it in an app, you would need to create a Gemfile and run Bundle install within your folder

Updating Ruby to 2.0.0 using Pik

After installing pik and changing my Ruby version to 2.0.0, bundler no long works properly
C:\Users\Me\Documents\Work Projects\Application>bundle install
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/..
Using rake (10.1.0)
Using i18n (0.6.5)
Using minitest (4.7.5)
Using multi_json (1.8.0)
Installing atomic (1.1.14)
Gem::InstallError: The 'atomic' native gem requires installed build tools.
Please update your PATH to include build tools or download the DevKit
from 'http://rubyinstaller.org/downloads' and follow the instructions
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'
An error occurred while installing atomic (1.1.14), and Bundler cannot continue.
Make sure that `gem install atomic -v '1.1.14'` succeeds before bundling.
Installing the devkit from Ruby Installer sort of defeats the reason why I went to the trouble of installing pik. How can I fix this, so that in the future, I can easily update ruby using pik and still have everything working?
I had the same problem - if you follow the instructions listed (ie installing devkit and following their directions [they don't actually tell you to use rubyinstaller]), you'll be fine. Also make sure that during the init phase of the Devkit instructions that it doesn't miss any of your ruby installations.
A note though, it seems that pik can't specify the x64 version of 2.0.0, so you may run into problems if that's the case. In the end I had to use the rubyinstaller for the x64 version of ruby, and then ran the x64 version of the devkit.
Hope this helps.
I think Josh' answer is probably right, but I actually installed Ubuntu as a VM in the end, just so I could use RVM.
RVM is a thousand times better than Pik, and it installs the DevKit. It's so good it's genuinely worth installing Ubuntu just so you can use it.

Ruby and gem version compatibility

I had an SSH-session to some Ubuntu Server. The latest available Ruby package with -full was an apt-get install ruby1.9.1-full. But after apt-get install rubygems1.9.1 the problem was that:
root#...:~# gem install nokogiri
ERROR: Error installing nokogiri:
nokogiri requires Ruby version >= 1.9.2
And I didn't know, which version of Nokogiri I had to install. I tried to guess:
root#...:~# gem install nokogiri -v 1.5.10
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
..........bla..bla..bla...
and had to switch to RVM way (there I had 1.9.3 and no further problems with gems I needed).
But anyway I prefer non-RVM way, so the question is: How do I know, which version of the gem is compatible with my Ruby?
Inspecting from the CHANGLOG.rdoc of Nokogiri in its source:
1.6.0.rc1 / 2013-04-14
This release was based on v1.5.9, and so does not contain any fixes mentioned in the notes for v1.5.10.
Notes
mini_portile is now a runtime dependency
Ruby 1.9.2 and higher now required
Features
(MRI) Source code for libxml 2.8.0 and libxslt 1.2.26 is packaged with the gem. These libraries are compiled at gem install time unless the environment variable NOKOGIRI_USE_SYSTEM_LIBRARIES is set. VERSION_INFO (also `nokogiri -v`) exposes whether libxml was compiled from packaged source, or the system library was used.
(Windows) libxml upgraded to 2.8.0
Deprecations
Support for Ruby 1.8.7 and prior has been dropped
You may give the previous version a try, say 1.5.10 / 2013-06-07
For the errors of building native extension, you shall check the build log of Nokogiri. It's likely that your system missed some library dependencies, such as libxml, libyaml, etc. RVM may handle the dependency for you, in its manner, so you don't get error while building with RVM.

sqlite3-ruby gem: Failed to build gem native extension

Update: Check out this follow-up question: Gem Update on Windows - is it broken?
On Windows, when I do this:
gem install sqlite3-ruby
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.
c:/ruby/bin/ruby.exe extconf.rb install sqlite3-ruby --platform Win32
checking for fdatasync() in rt.lib... no
checking for sqlite3.h... no
nmake
'nmake' is not recognized as an internal or external command,
operable program or batch file.
Gem files will remain installed in c:/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.4 for inspection.
Results logged to c:/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.4/ext/sqlite3_api/gem_make.out
Same thing happens with the hpricot gem. I seem to remember these gems installed just fine on < 1.0 gems, but now I'm on 1.2.0, things have gone screwy.
I have also tried this:
gem install sqlite3-ruby --platform Win32
Needless to say, this doesn't work either (same error)
Does anyone know what is going on here and how to fix this?
Update: Check out this follow-up question: Gem Update on Windows - is it broken?
As Nathan suggests, this does appear to be related to the fact that the latest versions of the sqlite3-ruby and hpricot gems don't appear to have Windows versions. Here's what to do when faced with this situation (note, the name of the gem is automatically wildcarded, so you can type just sql and get a list of all gems beginning with sql):
$ gem list --remote --all sqlite
*** REMOTE GEMS ***
sqlite (2.0.1, 2.0.0, 1.3.1, 1.3.0, 1.2.9.1, 1.2.0, 1.1.3, 1.1.2, 1.1.1, 1.1)
sqlite-ruby (2.2.3, 2.2.2, 2.2.1, 2.2.0, 2.1.0, 2.0.3, 2.0.2)
sqlite3-ruby (1.2.4, 1.2.3, 1.2.2, 1.2.1, 1.2.0, 1.1.0, 1.0.1, 1.0.0, 0.9.0, 0.6.0, 0.5.0)
Then you can choose the version you would like to install:
gem install sqlite3-ruby -v 1.2.3
To successfully install hpricot, I did this:
gem install hpricot -v 0.6
Annoyingly, doing a gem update tries to update the gems to their latest, broken-on-Windows, versions. When the update routine encounters an error, it ditches you out of the whole process. There's a (hacky) solution to this problem here.
So, is this issue a bug in gems? Should gems not automatically detect the platform and install the latest compatible version?
I had the same problem on Ubuntu, this solved the problem for me:
http://newsgroups.derkeiler.com/Archive/Comp/comp.lang.ruby/2008-08/msg00339.html
first from sqlite.org(http://www.sqlite.org/download.html)
download ->
Precompiled Binaries: sqlite-dll-win32-x86-3071700.zip
and Source Code: sqlite-autoconf-3071700.tar.gz
then extract as:
-include
--sqlite3.h
--sqlite3ext.h
-lib
--shell.c
--sqlite3.c
--sqlite3.def
--sqlite3.dll
last install gem like:
gem install sqlite3 --platform=ruby -- --with-sqlite3-include=path\to\include
--with-sqlite3-lib=path\to\lib --no-ri --no-rdoc
Good luck!
Is it possible that the newest version has not yet been ported to Win32 yet? Since this particular gem does have bindings to compiled code, it would require a platform-specific gem. If I force installation of version 1.2.3 rather than the current 1.2.4, the platform-specific version does install, but when I allow gem to try to install the current version, I get the generic 1.2.4 version (in the gems library folder, it lacks the -x86-mswin32 suffix that the other sqlite3-ruby folders have in their names.
Maybe someone else can answer how gem handles platform specific gems. Are separate gems uploaded for each platform and the gem software selects which one to pull down?
I also ran into this problem. It's worth knowing that the difference between 1.2.3 and 1.2.4 is not significant. Here are the 1.2.4. release notes:
Release Name: 1.2.4
Notes: This release only updates the
generated C file to reflect the
compatibility changes that were made
to the SWIG file. Binary builds (e.g.,
Windows) are not affected, and need no
update. In general, you will not need
this update unless you are using a
version of Ruby prior to 1.8.6.
(source: 1.2.4. release notes)
Hope that helps others!
I had the same problem on Windows and I have installe MinGW
http://sourceforge.net/projects/mingw/files/Automated%20MinGW%20Installer/MinGW%205.1.6/MinGW-5.1.6.exe/download
and the problem has gone :-)
C:>gem install hpricot
Successfully installed hpricot-0.8.2-x86-mswin32
1 gem installed
Installing ri documentation for hpricot-0.8.2-x86-mswin32...
Installing RDoc documentation for hpricot-0.8.2-x86-mswin32...
C:>gem install ruby-postgres
Successfully installed ruby-postgres-0.7.1.2006.04.06-x86-mswin32
1 gem installed
Installing ri documentation for ruby-postgres-0.7.1.2006.04.06-x86-mswin32...
Installing RDoc documentation for ruby-postgres-0.7.1.2006.04.06-x86-mswin32...

Resources