Re: [sqlite3-ruby] Ruby 2.0 and SQLite3 install issues

1,511 views
Skip to first unread message
Message has been deleted

Luis Lavena

unread,
Mar 8, 2013, 6:07:52 PM3/8/13
to sqlite...@googlegroups.com
Hello,

On Fri, Mar 8, 2013 at 3:54 PM, <dhbk...@googlemail.com> wrote:
> Luis, sorry to bother you. I am getting lost with Sqlite3 compile and
> install issues. I spent already quite some time with this. Still no real
> progress. If you find time, I would very much appreciate your advise.
>

I just shared a precompiled sqlite package at RubyInstaller group:

https://groups.google.com/d/topic/rubyinstaller/gedIaMryCFQ/discussion

And included instructions on how to use with sqlite3 gem.

> My scenario:
>
> Prelude: I want to switch to Ruby2.0 the sooner the better. Rspec
> performance is killing me and I hoped to have at least some relief with
> Ruby2.0. However, migrating to Ruby2.0 turned out to be something like yak
> shaving.
>
> My environment:
>
> Windows7, ruby 2.0.0p0 (2013-02-24) [i386-mingw32], rails 3.2.12 and Rails
> 3.2.13.rc1, Gem 2.0.2, Bundler version 1.3.2, gcc version 4.7.2
> (rubenvb-4.7.2-release).
>
> I downloaded and un-zipped sqlite-autoconf-3071502.tar.gz.
>
> I modified sqlite3.c.
>

See knapsack sqlite package linked above.

>
>
> 1. Question: I would expect to see the mingw32 platform extension.
>
> Instead I see:
>
>
>
> $ gem list --local sq
>
> *** LOCAL GEMS ***
>
> sqlite3 (1.3.7)
>
>

You will not see "mingw32" either x86 or x64 listed as part of the
extension, you forced "ruby" platform to compile locally, so platform
is "ruby".

> 2. Question:
>
> I modified the Gemfile to point to my local sqlite3 gem.
> gem 'sqlite3', '3.1.7', :path =>
> 'H:Ruby200_p0\lib\ruby\gems\2.0.0\gems\sqlite3-1.3.7'
> $ bundle update
>

Why you pointed to you local sqlite3 gem? once you have the gem
installed, there is no need to tell bundler were to find it.

Also, sqlite3 repository lacks gemspec required for bundler to work,
so is pointless.

>
> $ rake -T
>
> rake aborted!
>
> cannot load such file -- sqlite3/sqlite3_native
>
> h:/workspace3/ruby2_test2/config/application.rb:7:in `<top (required
>
> h:/workspace3/ruby2_test2/Rakefile:5:in `<top (required)>'
>
> (See full trace by running task with --trace)
>
>


If the gem was properly compiled, like I show in the link above, then
the sqlite3/sqlite3_native issue shouldn't have raised. It seems
something else is going on with that particular setup.

See above about your local clone and Bundler.

>
> Is there something where I am totally wrong? I believe I spent too much
> time with this. I am getting lost.
>

Please see my first link on how to get this running.

Once I have the gem installed in my system, I can simply "bundle
install" and will generate the Gemfile.lock accordingly.

Of course, I recommend locking the Gemfile to ruby "2.0.0" and ensure
you're using RubyGems 2.0.2 and latest Bundler too.

--
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry

Dietmar H. Büto

unread,
Mar 13, 2013, 10:04:58 AM3/13/13
to sqlite...@googlegroups.com

On Friday, March 8, 2013 7:54:24 PM UTC+1, Dietmar H. Büto wrote:

Luis, sorry to bother you.  I am getting lost with Sqlite3 compile and install issues. I spent already quite some time with this. Still no real progress. If you find time, I would very much appreciate your advise.

My scenario:

Prelude: I want to switch to Ruby2.0 the sooner the better.  Rspec performance is killing me and I hoped to have at least some relief with Ruby2.0.  However, migrating to Ruby2.0 turned out to be something  like yak shaving.

My environment:

Windows7, ruby 2.0.0p0 (2013-02-24) [i386-mingw32], rails 3.2.12 and Rails 3.2.13.rc1, Gem 2.0.2, Bundler version 1.3.2, gcc version 4.7.2 (rubenvb-4.7.2-release).

I downloaded and un-zipped sqlite-autoconf-3071502.tar.gz.

I modified sqlite3.c.

#define SQLITE_CORE 1

 #define SQLITE_AMALGAMATION 1

 #ifndef SQLITE_PRIVATE

 # define SQLITE_PRIVATE static

 #endif

 #ifndef SQLITE_API

 # define SQLITE_API

 #endif

 #define SQLITE_ENABLE_COLUMN_METADATA # << inserted >>

 # /************** Begin file sqliteInt.h ***************************************/

 
 
$ ./configure --prefix=h:/database/sqlite3 
$ make clean
$ make 
$ make install
$ cp h:/database/sqlite3/bin/* h:/Ruby200_p0/bin

 

 

The configure worked (I believe), make gave some warnings about some libraries it could not find.

I can provide a gist of mkmf.log if required.

gem install sqlite3 --platform=ruby -- --with-sqlite3-include="h:/database/sqlite3/include" --with-sqlite3-lib="h:/database/sqlite3/lib"

 

1.   Question: I would expect to see the mingw32 platform extension.

Instead I see:

 

$ gem list --local sq

*** LOCAL GEMS ***

sqlite3 (1.3.7)
 

2. Question:  

I  modified the Gemfile to point to my local sqlite3 gem.
gem 'sqlite3', '3.1.7', :path => 'H:Ruby200_p0\lib\ruby\gems\2.0.0\gems\sqlite3-1.3.7'
$ bundle update
 

$ rake -T

rake aborted!

cannot load such file -- sqlite3/sqlite3_native

h:/workspace3/ruby2_test2/config/application.rb:7:in `<top (required

h:/workspace3/ruby2_test2/Rakefile:5:in `<top (required)>'

(See full trace by running task with --trace)

 

Is there something where I am totally wrong?  I believe I spent too much time with this.  I am getting lost.

Again, no real urgency.  My ruby 193 p392 environment works fine – with Sqlite and MySQL.  It’s just the slow Rspecs killing me on Windows.
Thank you for help and your excellent work on RubyInstaller.
 
 
 

Hi Luis,

sorry, I could not come back any earlier. Busy with other stuff.

Thank you again, for all your help.

Your instructions worked very well for me, I had no problem to install the pre-compiled binaries you provided.

During the course of troubleshooting I installed pik 3.0.0 and latest git. I had some issues with path re-assignments for bash – I believe this was also part of my issues.  Also for this you had very useful guidance here – Thank you for it as well.

Had no time yet to check and try to also local compile SQlite3.

As I said, the knapsack pre-compiled package did it.  Muchas gracias.

Regards, Dietmar

 
Reply all
Reply to author
Forward
0 new messages