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
Related
I am installing gem sqlite3 for rails 4 and get a compilation error. This is a completely new macbook pro with Mavericks OS installed. I have installed XCode, but then also installed gcc 4.9 using Homebrew (using instructions here). Everything was going smooth until I started getting a compilation error while trying to install the gem sqlite3:
app_folder git:(mybranch) gem install sqlite3 -v '1.3.8'
Building native extensions. This could take a while...
ERROR: Error installing sqlite3:
ERROR: Failed to build gem native extension.
/Users/myname/.rvm/rubies/ruby-2.0.0-p353/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_backup_init()... yes
checking for sqlite3_column_database_name()... no
checking for sqlite3_enable_load_extension()... no
checking for sqlite3_load_extension()... no
checking for sqlite3_open_v2()... yes
checking for sqlite3_prepare_v2()... yes
checking for sqlite3_int64 in sqlite3.h... yes
checking for sqlite3_uint64 in sqlite3.h... yes
creating Makefile
make "DESTDIR="
compiling backup.c
gcc-4.9: error: unrecognized command line option '-Wshorten-64-to-32'
make: *** [backup.o] Error 1
Upon doing some research of the issue, I have found little information besides that this command line option is mac-specific and Homebrew-installed gcc compiler does not have it! Is there a way for me to switch back to native mac gcc compiler? How do I resolve this and why is it barely mentioned anywhere?
gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx- include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.1
I just installed Rails and had a similar experience. I fixed it by getting osx to recognize the correct g++ version and then reinstalling ruby. Here are a few suggestions:
You can set your gcc and g++ version via .bash_profile with the following code
export CC=gcc-4.9
export CXX=g++-4.9
export CPP=cpp-4.9
check your g++ version with g++ -v. If this doesn't work you may need to do bit of hacking.
Per http://instantbadger.blogspot.com/2011/11/porting-rails-23-app-to-ruby-19.html, you can remove the default g++ in /usr/bin and substitute it with a new symlink to g++-4.9:
sudo mv /usr/bin/g++ /usr/bin/g++.bak && sudo ln -s /usr/local/bin/g++-4.9 /usr/bin/g++
Note: this command is different from the one present in the linked page (which moves /usr/local/bin/g++). I didn't have a copy of g++ in /usr/local/bin/, so I adapted the command to work with /usr/bin instead.
Check g++ -v again. It should now reflect the correct version of g++.
Once your g++ version checks out, you can try reinstalling ruby. This insures that your ruby version is compiled with the same compiler that your going to build your gems with.
rvm install 2.0.0
Once you've done that, repeat
gem install sqlite3 -v '1.3.8'
Hopefully, this should work now.
I am trying to install ruby-perf. I had problems but after installing ruby-dev, it went well via console.
ubuntu#ubuntu-VirtualBox:~/web$ sudo gem install ruby-prof -v '0.13.0'
Fetching: ruby-prof-0.13.0.gem (100%)
Building native extensions. This could take a while...
Successfully installed ruby-prof-0.13.0
1 gem installed
But when I run the bundler, it stills says error.
ubuntu#ubuntu-VirtualBox:~/web$ bundle install
. . .
Installing ruby-prof (0.13.0)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/home/ubuntu/jruby-1.7.3/bin/jruby extconf.rb
/home/ubuntu/jruby-1.7.3/lib/ruby/shared/mkmf.rb:14: Use RbConfig instead of obsolete and deprecated Config.
checking for sys/times.h... yes
checking for rb_os_allocated_objects()... no
checking for rb_gc_allocated_size()... no
checking for rb_gc_collections()... no
checking for rb_gc_time()... no
checking for rb_class_superclass()... checking for rb_heap_total_mem()... no
checking for rb_gc_heap_info()... no
checking for rb_fiber_current()... no
extconf.rb:54 warning: tracing (e.g. set_trace_func) will not capture all events without --debug flag
creating Makefile
make
cc -I. -I. -I/home/ubuntu/jruby-1.7.3/lib/native/include/ruby -I. -DHAVE_SYS_TIMES_H -DHAVE_RB_CLASS_SUPERCLASS -DRUBY_VERSION=193 -DTHREADS_INHERIT_EVENT_FLAGS=0 -fPIC -fno-omit-frame-pointer -fno-strict-aliasing -fexceptions -m32 -c rp_measure_gc_time.c
In file included from rp_measure_gc_time.c:6:0:
ruby_prof.h:23:18: fatal error: node.h: No such file or directory
compilation terminated.
make: *** [rp_measure_gc_time.o] Error 1
Gem files will remain installed in /home/ubuntu/jruby-1.7.3/lib/ruby/gems/shared/gems/ruby-prof-0.13.0 for inspection.
Results logged to /home/ubuntu/jruby-1.7.3/lib/ruby/gems/shared/gems/ruby-prof-0.13.0/ext/ruby_prof/gem_make.out
An error occurred while installing ruby-prof (0.13.0), and Bundler cannot
continue.
Make sure that `gem install ruby-prof -v '0.13.0'` succeeds before bundling.
I verified the gems are installed also.
ubuntu#ubuntu-VirtualBox:~/web$ sudo gem list
*** LOCAL GEMS ***
json (1.8.0, 1.7.7)
minitest (5.0.6)
rake (10.1.0)
rake-compiler (0.8.3)
ruby-prof (0.13.0)
You are running the first command with sudo and the second command without sudo.
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
I have previously successfully installed the Jekyll gem on a Mac with the gcc compiler that shipped with Xcode 3. Unfortunately I can't install it on a different Mac that now has Xcode 4.1. This Mac used to have Xcode 3, but I uninstalled it using the command sudo /Developer-3.2.5/Library/uninstall-devtools --mode=all.
When trying to sudo gem install jekyll I get the compilation error shown below:
Building native extensions. This could take a while...
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
creating Makefile
make
gcc -I. -I/usr/local/lib/ruby/1.8/i686-darwin10.3.2 -I/usr/local/lib/ruby/1.8/i686-darwin10.3.2 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -D_XOPEN_SOURCE=1 -fno-common -pipe -fno-common -c porter.c
porter.c:31:44: error: stdlib.h: No such file or directory
porter.c:32:47: error: string.h: No such file or directory
porter.c: In function ‘create_stemmer’:
porter.c:85: warning: incompatible implicit declaration of built-in function ‘malloc’
porter.c: In function ‘setto’:
porter.c:199: warning: incompatible implicit declaration of built-in function ‘memmove’
make: *** [porter.o] Error 1
Gem files will remain installed in /usr/local/lib/ruby/gems/1.8/gems/fast-stemmer-1.0.0 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.8/gems/fast-stemmer-1.0.0/ext/gem_make.out
There seems to be a fairly fundamental problem here! How can I fix this? I'm using Ruby 1.8.7 and RubyGems 1.3.7 1.8.10.
Thanks in advance.
Now this is weird. I reinstalled Xcode 4.1 last night and it's fixed the problem: I can compile the native extensions and install the Jekyll gem.
I was able to reinstall Xcode because according to the Mac App Store it wasn't installed at all, even though I've been happily using it! I think the store must look for the existence of the Install XCode application in the /Applications folder, which I'd deleted because it's just an installer and takes up over 3GB.
Before running gem install jekyll try entering export CC=gcc-4.2 as per: RVM with Lion If this fixes your issue, it's because gems is depending on GCC instead of LLVM, which is now default in 4.1. Add the export CC=gcc-4.2 to your ~/.bashrc file to not have to enter it every time you need to compile gem.
RubyGems 1.3.7 is quite out of date. We're talking about 1.8.9... I suggest you to upgrade it.
I'm using Lion without any issue, but I have to admit I'm not using system Ruby. I installed a different 1.8.7 (and 1.9.2) version using RVM.
sudo env ARCHFLAGS="-arch x86_64" gem install do_sqlite3
Building native extensions. This could take a while...
ERROR: Error installing do_sqlite3:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for sqlite3.h... yes
checking for sqlite3_open() in -lsqlite3... no
*** 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 sqlite3-ruby installed as well as the header files, but for some reason it fails when checking for sqlite3_open()
I am having the same issue:
sudo env ARCHFLAGS="-arch x86_64" gem install do_sqlite3
Building native extensions. This could take a while...
ERROR: Error installing do_sqlite3:
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/do_sqlite3-0.10.1.1 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/do_sqlite3-0.10.1.1/ext/do_sqlite3/gem_make.out
I am running Snow Leopard. I'm not sure about previous installations of sqlite3 but I did try this:
port search sqlite
And it returned the following (among others):
...
sqlite3 #3.6.17 (databases)
an embedded SQL database engine
To be honest I'm not sure what all this means. What would anyone suggest for getting do_sqlite3 installed for use in Rails 3 with DataMapper? (Also, running it without the 'env ARCHFLAGS="-arch x86_64"' gives the same errors.)
Ok, first question is why are you passing the ARCHFLAGS? That should not be necessary, if it also doesn't work without passing them, what is the output you get then?
Next question is what version of sqlite3 is it picking up? Do you have sqlite3 installed through Macports for example? Did you upgrade to Snow Leopard recently and still have an sqlite3 install from before upgrading?