error installing waitr in ubuntu 11.10 - ruby

ruby ubuntu rubygems wati automation testing tool watir in the newest version of Ubuntu.
I did a sudo apt-get install ruby to get the latest version of ruby, then I installed Rubygems and tried installing watir, but i'm getting this error.
It's using Ruby 1.8.7
I've also tried removing ruby and ruby gems and reinstalling but the error message still happens.
Can anyone tell me whats wrong?
root#kelley-VirtualBox:/home/kelley# gem -v
bash: /usr/bin/gem: No such file or directory
root#kelley-VirtualBox:/home/kelley# sudo apt-get install rubygems
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
libtcltk-ruby1.8
Use 'apt-get autoremove' to remove them.
The following NEW packages will be installed:
rubygems
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Need to get 0 B/425 kB of archives.
After this operation, 4,166 kB of additional disk space will be used.
Selecting previously deselected package rubygems.
(Reading database ... 157806 files and directories currently installed.)
Unpacking rubygems (from .../rubygems_1.7.2-1_all.deb) ...
Processing triggers for man-db ...
Setting up rubygems (1.7.2-1) ...
root#kelley-VirtualBox:/home/kelley# gem list
*** LOCAL GEMS ***
root#kelley-VirtualBox:/home/kelley# gem install watir
Building native extensions. This could take a while...
ERROR: Error installing watir:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb
checking for strncpy_s()... no
creating Makefile
make
gcc -I. -I. -I/usr/lib/ruby/1.8/i686-linux -I. -D_FILE_OFFSET_BITS=64 -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -c win32/api.c
win32/api.c:2:21: fatal error: windows.h: No such file or directory
compilation terminated.
make: *** [api.o] Error 1
Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/win32-api-1.4.8 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/win32-api-1.4.8/ext/gem_make.out
root#kelley-VirtualBox:/home/kelley#

Look at the Ubuntu documentation. There's a comprehensive, step-by-step guide that you can follow.
It seems like waitr is Windows-only. Try sudo gem install watir-webdriver

Related

Gem will not install sqlite3 despite sqlite3 being installed (Mac)

I'm trying to install Ruby (3.2.0) (and Rails [7.0.4]) on an Intel Mac (OS 12.6). I'm running into issues with sqlite3 — no surprise. My current error message is this:
package configuration for /usr/local/lib/ruby/gems/3.2.0/gems/sqlite3-1.5.4/ports/x86_64-apple-darwin21.6.0/sqlite3/3.40.0/lib/pkgconfig/sqlite3.pc is not found
When I enter gem install sqlite3 I get the following ugly error message:
Building native extensions. This could take a while...
ERROR: Error installing sqlite3:
ERROR: Failed to build gem native extension.
current directory: /usr/local/lib/ruby/gems/3.2.0/gems/sqlite3-1.5.4/ext/sqlite3
/usr/local/opt/ruby/bin/ruby -I /usr/local/lib/ruby/site_ruby/3.2.0 extconf.rb
Building sqlite3-ruby using packaged sqlite3.
Extracting sqlite-autoconf-3400000.tar.gz into tmp/x86_64-apple-darwin21.6.0/ports/sqlite3/3.40.0... OK
Running 'configure' for sqlite3 3.40.0... OK
Running 'compile' for sqlite3 3.40.0... OK
Running 'install' for sqlite3 3.40.0... OK
Activating sqlite3 3.40.0 (from /usr/local/lib/ruby/gems/3.2.0/gems/sqlite3-1.5.4/ports/x86_64-apple-darwin21.6.0/sqlite3/3.40.0)...
Could not configure the build properly (pkg_config). Please install either the `pkg-config` utility or the `pkg-config` rubygem.
*** 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:
[insert long list of options...]
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/usr/local/lib/ruby/gems/3.2.0/extensions/x86_64-darwin-21/3.2.0/sqlite3-1.5.4/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /usr/local/lib/ruby/gems/3.2.0/gems/sqlite3-1.5.4 for inspection.
Results logged to /usr/local/lib/ruby/gems/3.2.0/extensions/x86_64-darwin-21/3.2.0/sqlite3-1.5.4/gem_make.out
I've been through many iterations of solutions found across the interwebs (changing permissions, installing pkg-config per the error message, changing $PATH in .zshrc, installing sqlite binary packages, modifying the Gemfile, total uninstalls of both, and restarts) to no avail.
The Homebrew-installed sqlite3 is working properly. which sqlite3 produces
/usr/local/opt/sqlite3/bin/sqlite3
Happy to provide any more relevant information that's helpful. Any guidance appreciated!
If you do not have pkg-config installed, you should install to proceed
You can check it using:
$ which pkg-config
If not found, install it:
$ curl https://pkg-config.freedesktop.org/releases/pkg-config-0.28.tar.gz -o pkgconfig.tgz
$ tar -zxf pkgconfig.tgz && cd pkg-config-0.28
$ ./configure && make install
I'm just following this page

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

Can't find header files for Ruby on SUSE?

I'm attempting to install compass on SUSE Enterprise 11 SP3. I get the following. Any ideas?
gem install compass
Building native extensions. This could take a while...
ERROR: Error installing compass:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb
<b>mkmf.rb can't find header files for ruby at /usr/lib64/ruby/ruby.h</b>
extconf failed, exit code 1
Gem files will remain installed in /usr/lib64/ruby/gems/1.8/gems/ffi-1.9.3 for inspection.
Results logged to /usr/lib64/ruby/gems/1.8/extensions/x86_64-linux/1.8/ffi-1.9.3gem_make.out
zypper in ruby-devel
It works for me. And if you also miss gcc, then
zypper in gcc
For those with similar issues I got this working by.
Uninsalling ruby and rvm
Building zlib from source with the shared option
./configure --shared
make
make install
I did the same for Ruby and that worked.
I could not get any RPM, Zypper, RVM installers to install properly. In each case they all seemed to have issues with zlib ?
You are possibly missing gcc. Try installing it with zypper (or yum), and then try installing your gems:
zypper in gcc

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.

Rails 3 won't install sqlite3-ruby gem with rvm?

I'm trying out rvm, and installed ruby 1.9.2 and rails 3 with it. I need to re-install the sqlite3-ruby gem (since rvm keeps all gems separate for different versions of ruby).
The problem is, when I try, I get:
gem install sqlite3-ruby
/home/jenny/.rvm/rubies/ruby-1.9.2-p0/bin/gem:4: warning: Insecure world writable dir /home/jenny/.rvm/gems/ruby-1.9.2-p0/bin in PATH, mode 040777
Building native extensions. This could take a while...
ERROR: Error installing sqlite3-ruby:
ERROR: Failed to build gem native extension.
/home/jenny/.rvm/rubies/ruby-1.9.2-p0/bin/ruby extconf.rb
checking for sqlite3.h... yes
checking for sqlite3_libversion_number() in -lsqlite3... yes
checking for rb_proc_arity()... yes
checking for sqlite3_initialize()... yes
checking for sqlite3_next_stmt()... yes
checking for sqlite3_column_database_name()... yes
checking for sqlite3_enable_load_extension()... no
checking for sqlite3_load_extension()... no
creating Makefile
make
gcc -I. -I/home/jenny/.rvm/rubies/ruby-1.9.2-p0/include/ruby-1.9.1/i686-linux -I/home/jenny/.rvm/rubies/ruby-1.9.2-p0/include/ruby-1.9.1/ruby/backward -I/home/jenny/.rvm/rubies/ruby-1.9.2-p0/include/ruby-1.9.1 -I. -DHAVE_RB_PROC_ARITY -DHAVE_SQLITE3_INITIALIZE -DHAVE_SQLITE3_NEXT_STMT -DHAVE_SQLITE3_COLUMN_DATABASE_NAME -I/usr/local/include -I/opt/local/include -I/sw/local/include -I/usr/include -D_FILE_OFFSET_BITS=64 -fPIC -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long -fPIC -o exception.o -c exception.c
In file included from ./sqlite3_ruby.h:42,
from exception.c:1:
./backup.h:7: error: expected specifier-qualifier-list before ‘sqlite3_backup’
make: *** [exception.o] Error 1
I'm really not quite sure what to make of it... I HAVE installed sqlite3-ruby on this machine before (with rails 2.3.5) When I try to reinstall this gem (using rvm system settings) it doesn't install in a ruby 1.8.7 enviornment, EITHER.
Did rvm break the gem? Is the new gem just not compatible with my OS (i'm running opensuse linux)
Edit: When I try re-installing (uninstalling than installing again) sqlite3-ruby in my regular ruby environment, I get the same error, but then see sqlite3-ruby listed in my gem list (not sure if it's somehow restoring from backup, or installing despite the error)
I'd vote up or comment on Brennan's answer but I don't have enough points to do that yet. I figured I'd leave this answer in case it helps anyone else: I've spent a while on this one...I had Ruby 1.9.1 and Rails 3.0.3 installed and working but decided to move to RVM. Installed RVM according to directions and then installed rails again, all gravy...then tried to bundle install and ran into this error with sqlite3:
Building native extensions. This could take a while...
ERROR: Error installing sqlite3:
ERROR: Failed to build gem native extension.
/Users/Jasonp/.rvm/rubies/ruby-1.9.2-p136/bin/ruby extconf.rb
checking for sqlite3.h... yes
checking for sqlite3_libversion_number() in -lsqlite3... no
sqlite3 is missing. Try 'port install sqlite3 +universal'
or 'yum install sqlite3-devel' and check your shared library search path (the
location where your sqlite3 shared library is located).
*** 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 know I had SQLite3 working before in my previous config, so I went to find the original dir. which was usr/local/sqlite3
I tried using that as the --with-sqlite3-dir= path but didn't work. Then just for fun I tried:
gem install sqlite3-ruby -- --with-sqlite3-dir=/usr/local/lib
and for wahtever reason, that worked. So, just in case someone
You could try
gem install sqlite3-ruby -- --with-sqlite3-dir=/path/to/your/sqlite3
And if that doesn't work, you might try to update your sqlite3, 3.6.4 is rather old, and I think the newer versions of Ruby sqlite have problems with something that old.
(And the most likely reason that you're getting different answers with the two is that between versions 2 and 3 was a major change -- mostly dealing with Unicode, I believe -- and some programs still use 2, not 3.)
When I installed sqlite3 from source it placed the include files in /usr/local/include
I tried
gem install sqlite3-ruby -- --with-sqlite3-dir=/usr/local/lib
and it finally installed.
on ubuntu 9.04 I also had to download sqlite and install from source

Resources