[DataMapper] Error installing dm-sqlite-adapter: sqlite3.h missing | OS X 10.8.2 (Mountain Lion)

2013-01-31 Thread Naii
Hi there,


*1. THE SITUATION*

I try to create my first Sinatra (Ruby) app. Therefore I want to use the 
dm-sqlite-adapter gem,
which shall now be installed after data_mapper was installed before.


*2. THE PROBLEM*

So I did run:

sudo gem install dm-sqlite-adapter


in the terminal and got the following output:

Building native extensions.  This could take a while...

ERROR:  Error installing dm-sqlite-adapter:

ERROR: Failed to build gem native extension.


 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby 
 extconf.rb

checking for sqlite3.h... 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.


 Provided configuration options:

--with-opt-dir

--without-opt-dir

--with-opt-include

--without-opt-include=${opt-dir}/include

--with-opt-lib

--without-opt-lib=${opt-dir}/lib

--with-make-prog

--without-make-prog

--srcdir=.

--curdir

--ruby=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby

--with-sqlite3-dir

--without-sqlite3-dir

--with-sqlite3-include

--without-sqlite3-include=${sqlite3-dir}/include

--with-sqlite3-lib

--without-sqlite3-lib=${sqlite3-dir}/lib



 Gem files will remain installed in 
 /Library/Ruby/Gems/1.8/gems/do_sqlite3-0.10.12 for inspection.

Results logged to 
 /Library/Ruby/Gems/1.8/gems/do_sqlite3-0.10.12/ext/do_sqlite3/gem_make.out


In addition, in the mkmf.log it's written:

have_header: checking for sqlite3.h...  no
 xcrun cc -E -I. 
 -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin12.0
  
 -I. -I/usr/local/include -I/opt/local/include -I/usr/include 
  -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE-g -Os -pipe -fno-common 
 -DENABLE_DTRACE  -fno-common  -pipe -fno-common   -Wall   conftest.c -o 
 conftest.i
 xcode-select: Error: No Xcode is selected. Use xcode-select -switch 
 path-to-xcode, or see the xcode-select manpage (man xcode-select) for 
 further information.
 checked program was:
 /* begin */
 1: #include sqlite3.h
 /* end */
 



*3. A SOLUTION, not yet.*

Does anybody know how to tackle this issue?

I did already look on several websites (including a question at 
Stackoverflowhttp://stackoverflow.com/questions/12451964/gem-install-sqlite3-gives-error-sqlite3-h-is-missing,
 
or 
thishttp://stackoverflow.com/questions/1143776/install-sqlite3-on-mac-osxone) 
where they recommend to use sudo 
apt-get install libsqlite3-dev which is only valid for Ubuntu or similar 
Linux operating systems. I can't seem to find the right way to make the 
sqlite3.h (Header file) detectable.

But I did install sqlite3 using MacPorts with:

sudo port install sqlite3

 and asking the terminal with which sqlite3 results in:

/opt/local/bin/sqlite3


So, sqlite3 seems to be installed properly.


*4. ASK FOR HELP*

Any tip or link is very much appreciated!

Thanks in advance,
- Alex 

-- 
You received this message because you are subscribed to the Google Groups 
DataMapper group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to datamapper+unsubscr...@googlegroups.com.
To post to this group, send email to datamapper@googlegroups.com.
Visit this group at http://groups.google.com/group/datamapper?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [DataMapper] Error installing dm-sqlite-adapter: sqlite3.h missing | OS X 10.8.2 (Mountain Lion)

2013-01-31 Thread Ben Lovell
On 30 January 2013 20:41, Naii alexanderkluge...@gmail.com wrote:

 Hi there,

 *4. ASK FOR HELP*

 Any tip or link is very much appreciated!

 Thanks in advance,
 - Alex

 Hey,

I believe macports installs the dev headers as part of the sqlite3 package.
You should just be able to specify the path to sqlite3.h when you install
the gem and it will pick up the headers from there:

gem install sqlite3-ruby -- --with-sqlite3-dir={...}

To find where sqlite3.h is just use `locate sqlite3.h`

Cheers,
Ben Lovell

-- 
You received this message because you are subscribed to the Google Groups 
DataMapper group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to datamapper+unsubscr...@googlegroups.com.
To post to this group, send email to datamapper@googlegroups.com.
Visit this group at http://groups.google.com/group/datamapper?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [DataMapper] Error installing dm-sqlite-adapter: sqlite3.h missing | OS X 10.8.2 (Mountain Lion)

2013-01-31 Thread Naii

Thx Mr. Lovell,

I did try your approach but unfortunately wasn't successful.

The error was not shown in terminal but was thrown only
into the gem_make.out. The error message was this one:

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby 
 extconf.rb
 checking for sqlite3.h... 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.
 Provided configuration options:
 --with-opt-dir
 --without-opt-dir
 --with-opt-include
 --without-opt-include=${opt-dir}/include
 --with-opt-lib
 --without-opt-lib=${opt-dir}/lib
 --with-make-prog
 --without-make-prog
 --srcdir=.
 --curdir
 --ruby=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
 --with-sqlite3-dir
 --without-sqlite3-dir
 --with-sqlite3-include
 --without-sqlite3-include=${sqlite3-dir}/include
 --with-sqlite3-lib
 --without-sqlite3-lib=${sqlite3-dir}/lib


So, the same as before. The only difference was that
it wasn't displayed in the terminal window.

Nevertheless, I really appreciate your answer! :)

Best regards,
- Alex


On Thursday, January 31, 2013 3:15:06 PM UTC+1, benlovell wrote:

 On 30 January 2013 20:41, Naii alexande...@gmail.com javascript:wrote:

 Hi there,

 *4. ASK FOR HELP*

 Any tip or link is very much appreciated!

 Thanks in advance,
 - Alex 

 Hey,

 I believe macports installs the dev headers as part of the sqlite3 
 package. You should just be able to specify the path to sqlite3.h when you 
 install the gem and it will pick up the headers from there:

 gem install sqlite3-ruby -- --with-sqlite3-dir={...}

 To find where sqlite3.h is just use `locate sqlite3.h`

 Cheers,
 Ben Lovell


-- 
You received this message because you are subscribed to the Google Groups 
DataMapper group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to datamapper+unsubscr...@googlegroups.com.
To post to this group, send email to datamapper@googlegroups.com.
Visit this group at http://groups.google.com/group/datamapper?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.