Problem z instalacją gemu sqlite3

Witam,

to mój pierwszy post na tym forum, chciałbym wszystkich przywitać. Dopiero niedawno zacząłem przygodę z RoR, więc mogło mi sporo rzeczy umknąć - dlatego zwracam się do Was o pomoc.
Napisałem prostą aplikację i chciałbym ją umieścić na serwerze, jednak mam problem z instalacją gemu sqlite3 na CentOS 5.4 x86_64 (niestety nie da się zmienić systemu- już działa na produkcji)
moja wersja rubiego: ruby 1.9.2p136 (2010-12-25 revision 30365) [x86_64-linux]
rails: Rails 3.1.3
gem: 1.8.13

podczas próby instalacji otrzymuje taki komunikat:

[code][kkozlow@nut public]$ gem sqlite3
ERROR: While executing gem … (RuntimeError)
Unknown command sqlite3
[kkozlow@nut public]$ sudo gem install sqlite3
Building native extensions. This could take a while…
ERROR: Error installing sqlite3:
ERROR: Failed to build gem native extension.

    /usr/local/ruby/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()… no
checking for sqlite3_backup_init()… no
checking for sqlite3_column_database_name()… no
checking for sqlite3_enable_load_extension()… no
checking for sqlite3_load_extension()… no
creating Makefile

make
gcc -I. -I/usr/local/ruby/include/ruby-1.9.1/x86_64-linux -I/usr/local/ruby/include/ruby-1.9.1/ruby/backward -I/usr/local/ruby/include/ruby-1.9.1 -I. -DHAVE_RB_PROC_ARITY -fPIC -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long -o database.o -c database.c
database.c: In function ‘initialize’:
database.c:47: error: ‘SQLITE_OPEN_READWRITE’ undeclared (first use in this function)
database.c:47: error: (Each undeclared identifier is reported only once
database.c:47: error: for each function it appears in.)
database.c:47: error: ‘SQLITE_OPEN_CREATE’ undeclared (first use in this function)
database.c:79: error: ‘SQLITE_OPEN_READONLY’ undeclared (first use in this function)
database.c: In function ‘set_sqlite3_func_result’:
database.c:285: error: ‘sqlite3_int64’ undeclared (first use in this function)
make: *** [database.o] Error 1

Gem files will remain installed in /usr/local/ruby/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.5 for inspection.
Results logged to /usr/local/ruby/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.5/ext/sqlite3/gem_make.out

[kkozlow@nut public]$ ruby -v
ruby 1.9.2p136 (2010-12-25 revision 30365) [x86_64-linux]
[kkozlow@nut public]$ rails -v
Rails 3.1.3
[kkozlow@nut public]$ gem --version
1.8.13[/code]
Czy ktoś mógłby mi podsunąć jakiś pomysł jak to ugryźć ?

masz zainstalowane paczki -dev/-devel (nie wiem jaka konwencja jest w CentOS)? To kompilacji gemów potrzebne Ci są paczki z odpowiednimi headerami tzn. np. paczka sqlite3-dev

jeśli chodzi o paczki sqlite-devel to mam zainstalowaną tę dla systemów x64

[code][kkozlow@nut ~]$ yum info sqlite-devel
Loaded plugins: fastestmirror
Reducing CentOS-5 Testing to included packages only
Finished
Installed Packages
Name : sqlite-devel
Arch : x86_64
Version : 3.3.6
Release : 5
Size : 1.0 M
Repo : installed
Summary : Development tools for the sqlite3 embeddable SQL database engine.
URL : http://www.sqlite.org/
License : Public Domain
Description: This package contains the header files, static libraries and
: development documentation for sqlite. If you like to develop
: programs using sqlite, you will need to install sqlite-devel.

Available Packages
Name : sqlite-devel
Arch : i386
Version : 3.3.6
Release : 5
Size : 257 k
Repo : base
Summary : Development tools for the sqlite3 embeddable SQL database engine.
URL : http://www.sqlite.org/
License : Public Domain
Description: This package contains the header files, static libraries and
: development documentation for sqlite. If you like to develop
: programs using sqlite, you will need to install sqlite-devel.[/code]
EDIT: Zainstalowanie paczki sqlite-devel dla i386 niestety nic nie dało

Mógłbyś wylistować wszystkie paczki które zawierają w sobie frazę sqlite?

[code][kkozlow@nut ~]$ yum search sqlite
Loaded plugins: fastestmirror
Reducing CentOS-5 Testing to included packages only
Finished
=========================================================================== Matched: sqlite ============================================================================
mono-data-sqlite.x86_64 : sqlite database connectivity for Mono
pdns-backend-sqlite.x86_64 : SQLite backend for pdns
php-pear-Log.noarch : Abstracted logging facility for PHP
python-sqlite.x86_64 : Python bindings for sqlite.
qt4-sqlite.x86_64 : SQLite drivers for Qt’s SQL classes
sqlite.i386 : Library that implements an embeddable SQL database engine
sqlite.x86_64 : Library that implements an embeddable SQL database engine
sqlite-devel.i386 : Development tools for the sqlite3 embeddable SQL database engine.
sqlite-devel.x86_64 : Development tools for the sqlite3 embeddable SQL database engine.
[kkozlow@nut ~]$ yum info sqlite
Loaded plugins: fastestmirror
Reducing CentOS-5 Testing to included packages only
Finished
Installed Packages
Name : sqlite
Arch : i386
Version : 3.3.6
Release : 5
Size : 413 k
Repo : installed
Summary : Library that implements an embeddable SQL database engine
URL : http://www.sqlite.org/
License : Public Domain
Description: SQLite is a C library that implements an SQL database engine. A large
: subset of SQL92 is supported. A complete database is stored in a
: single disk file. The API is designed for convenience and ease of use.
: Applications that link against SQLite can enjoy the power and
: flexibility of an SQL database without the administrative hassles of
: supporting a separate database server. Version 2 and version 3 binaries
: are named to permit each to be installed on a single host

Name : sqlite
Arch : x86_64
Version : 3.3.6
Release : 5
Size : 402 k
Repo : installed
Summary : Library that implements an embeddable SQL database engine
URL : http://www.sqlite.org/
License : Public Domain
Description: SQLite is a C library that implements an SQL database engine. A large
: subset of SQL92 is supported. A complete database is stored in a
: single disk file. The API is designed for convenience and ease of use.
: Applications that link against SQLite can enjoy the power and
: flexibility of an SQL database without the administrative hassles of
: supporting a separate database server. Version 2 and version 3 binaries
: are named to permit each to be installed on a single host

[kkozlow@nut ~]$ yum info sqlite-devel
Loaded plugins: fastestmirror
Reducing CentOS-5 Testing to included packages only
Finished
Installed Packages
Name : sqlite-devel
Arch : i386
Version : 3.3.6
Release : 5
Size : 1.0 M
Repo : installed
Summary : Development tools for the sqlite3 embeddable SQL database engine.
URL : http://www.sqlite.org/
License : Public Domain
Description: This package contains the header files, static libraries and development
: documentation for sqlite. If you like to develop programs using sqlite,
: you will need to install sqlite-devel.

Name : sqlite-devel
Arch : x86_64
Version : 3.3.6
Release : 5
Size : 1.0 M
Repo : installed
Summary : Development tools for the sqlite3 embeddable SQL database engine.
URL : http://www.sqlite.org/
License : Public Domain
Description: This package contains the header files, static libraries and development
: documentation for sqlite. If you like to develop programs using sqlite,
: you will need to install sqlite-devel.[/code]

Twoja wersja SQLite3 to 3.3.6, a gem sqlite3 wymaga wersji 3.6.16 lub nowszej.

Faktycznie zainstalowałem ze źródeł najnowszą wersję (rozwiązując przy okazji problem z dowiązaniem biblioteki - bez tego yum mi się wyłożył) i wszystko chodzi jak należy.
Ten link okazał się pomocny z problemem z dowiązaniem: http://www.centos.org/modules/newbb/viewtopic.php?topic_id=25279&forum=37

Problem rozwiązany :slight_smile:
Bardzo Wam dziękuję

Przy okazji życząc Wesołych Świąt :slight_smile: