sqlite3-ruby 无法在 RVM 1.8.7 上运行

发布于 2024-09-04 15:07:30 字数 3393 浏览 3 评论 0原文

从 RVM 1.8.7 开始升级到 Rails 3。 OSX 10.5.8

Output:
josh-crewss-macbook:~ joshcrews$ gem install sqlite3-rubyBuilding native extensions.  This could take a while...ERROR:  Error installing sqlite3-ruby:  ERROR: Failed to build gem native extension.
/Users/joshcrews/.rvm/rubies/ruby-1.8.7-p174/bin/ruby extconf.rb
checking for sqlite3.h... yes
checking for sqlite3_libversion_number() in -lsqlite3... yes
checking for rb_proc_arity()... 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. -I/Users/joshcrews/.rvm/rubies/ruby-1.8.7-p174/lib/ruby/1.8/i686-darwin9.8.0 -I. -I/usr/local/include -I/opt/local/include -I/usr/include  -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -fno-common -g -O2  -fno-common -pipe -fno-common  -O3 -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline  -c database.c
database.c: In function ‘deallocate’:
database.c:17: warning: implicit declaration of function ‘sqlite3_next_stmt’
database.c:17: warning: assignment makes pointer from integer without a cast
database.c: In function ‘initialize’:
database.c:76: warning: implicit declaration of function ‘sqlite3_open_v2’
database.c:79: error: ‘SQLITE_OPEN_READWRITE’ undeclared (first use in this function)
database.c:79: error: (Each undeclared identifier is reported only once
database.c:79: error: for each function it appears in.)
database.c:79: error: ‘SQLITE_OPEN_CREATE’ undeclared (first use in this function)
database.c: In function ‘set_sqlite3_func_result’:
database.c:277: error: ‘sqlite3_int64’ undeclared (first use in this function)
database.c: In function ‘rb_sqlite3_func’:
database.c:311: warning: passing argument 1 of ‘ruby_xcalloc’ as signed due to prototype
database.c: In function ‘rb_sqlite3_step’:
database.c:378: warning: passing argument 1 of ‘ruby_xcalloc’ as signed due to prototype
make: *** [database.o] Error 1

Gem 列表(这些在 RVM 下,在系统下我有更多的 gem,包括已经工作了 1.5 年的 sqlite3-ruby)

josh-crewss-macbook:~ joshcrews$ gem list

*** LOCAL GEMS ***

abstract (1.0.0)
actionmailer (3.0.0.beta3)
actionpack (3.0.0.beta3)
activemodel (3.0.0.beta3)
activerecord (3.0.0.beta3)
activeresource (3.0.0.beta3)
activesupport (3.0.0.beta3, 2.3.8)
arel (0.3.3)
builder (2.1.2)
bundler (0.9.25)
capybara (0.3.8)
configuration (1.1.0)
cucumber (0.7.2)
cucumber-rails (0.3.1)
culerity (0.2.10)
database_cleaner (0.5.2)
diff-lcs (1.1.2)
erubis (2.6.5)
ffi (0.6.3)
gherkin (1.0.30)
i18n (0.4.0, 0.3.7)
json_pure (1.4.3)
launchy (0.3.5)
mail (2.2.1)
memcache-client (1.8.3)
mime-types (1.16)
nokogiri (1.4.2)
polyglot (0.3.1)
rack (1.1.0)
rack-mount (0.6.3)
rack-test (0.5.4)
rails (3.0.0.beta3)
railties (3.0.0.beta3)
rake (0.8.7)
rdoc (2.5.8)
rspec (2.0.0.beta.10, 2.0.0.beta.8)
rspec-core (2.0.0.beta.10, 2.0.0.beta.8)
rspec-expectations (2.0.0.beta.10, 2.0.0.beta.8)
rspec-mocks (2.0.0.beta.10, 2.0.0.beta.8)
rspec-rails (2.0.0.beta.10, 2.0.0.beta.8)
rubygems-update (1.3.7)
selenium-webdriver (0.0.20)
spork (0.8.3)
term-ansicolor (1.0.5)
text-format (1.0.0)
text-hyphen (1.0.0)
thor (0.13.6)
treetop (1.4.8)
trollop (1.16.2)
tzinfo (0.3.22)
webrat (0.7.1)

XCode 版本:3.1.1

我怀疑它与“-I”有关/Users/joshcrews/.rvm/rubies/ruby-1.8.7-p174/lib/ruby/1.8/i686-darwin9.8.0”,因为该文件中不存在 i686-darwin9.8.0

Upgrading to Rails 3 by starting with RVM 1.8.7. OSX 10.5.8

Output:
josh-crewss-macbook:~ joshcrews$ gem install sqlite3-rubyBuilding native extensions.  This could take a while...ERROR:  Error installing sqlite3-ruby:  ERROR: Failed to build gem native extension.
/Users/joshcrews/.rvm/rubies/ruby-1.8.7-p174/bin/ruby extconf.rb
checking for sqlite3.h... yes
checking for sqlite3_libversion_number() in -lsqlite3... yes
checking for rb_proc_arity()... 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. -I/Users/joshcrews/.rvm/rubies/ruby-1.8.7-p174/lib/ruby/1.8/i686-darwin9.8.0 -I. -I/usr/local/include -I/opt/local/include -I/usr/include  -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -fno-common -g -O2  -fno-common -pipe -fno-common  -O3 -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline  -c database.c
database.c: In function ‘deallocate’:
database.c:17: warning: implicit declaration of function ‘sqlite3_next_stmt’
database.c:17: warning: assignment makes pointer from integer without a cast
database.c: In function ‘initialize’:
database.c:76: warning: implicit declaration of function ‘sqlite3_open_v2’
database.c:79: error: ‘SQLITE_OPEN_READWRITE’ undeclared (first use in this function)
database.c:79: error: (Each undeclared identifier is reported only once
database.c:79: error: for each function it appears in.)
database.c:79: error: ‘SQLITE_OPEN_CREATE’ undeclared (first use in this function)
database.c: In function ‘set_sqlite3_func_result’:
database.c:277: error: ‘sqlite3_int64’ undeclared (first use in this function)
database.c: In function ‘rb_sqlite3_func’:
database.c:311: warning: passing argument 1 of ‘ruby_xcalloc’ as signed due to prototype
database.c: In function ‘rb_sqlite3_step’:
database.c:378: warning: passing argument 1 of ‘ruby_xcalloc’ as signed due to prototype
make: *** [database.o] Error 1

Gem list (these are under RVM, under system I've got lot more gems included the sqlite3-ruby that's worked for 1.5 years)

josh-crewss-macbook:~ joshcrews$ gem list

*** LOCAL GEMS ***

abstract (1.0.0)
actionmailer (3.0.0.beta3)
actionpack (3.0.0.beta3)
activemodel (3.0.0.beta3)
activerecord (3.0.0.beta3)
activeresource (3.0.0.beta3)
activesupport (3.0.0.beta3, 2.3.8)
arel (0.3.3)
builder (2.1.2)
bundler (0.9.25)
capybara (0.3.8)
configuration (1.1.0)
cucumber (0.7.2)
cucumber-rails (0.3.1)
culerity (0.2.10)
database_cleaner (0.5.2)
diff-lcs (1.1.2)
erubis (2.6.5)
ffi (0.6.3)
gherkin (1.0.30)
i18n (0.4.0, 0.3.7)
json_pure (1.4.3)
launchy (0.3.5)
mail (2.2.1)
memcache-client (1.8.3)
mime-types (1.16)
nokogiri (1.4.2)
polyglot (0.3.1)
rack (1.1.0)
rack-mount (0.6.3)
rack-test (0.5.4)
rails (3.0.0.beta3)
railties (3.0.0.beta3)
rake (0.8.7)
rdoc (2.5.8)
rspec (2.0.0.beta.10, 2.0.0.beta.8)
rspec-core (2.0.0.beta.10, 2.0.0.beta.8)
rspec-expectations (2.0.0.beta.10, 2.0.0.beta.8)
rspec-mocks (2.0.0.beta.10, 2.0.0.beta.8)
rspec-rails (2.0.0.beta.10, 2.0.0.beta.8)
rubygems-update (1.3.7)
selenium-webdriver (0.0.20)
spork (0.8.3)
term-ansicolor (1.0.5)
text-format (1.0.0)
text-hyphen (1.0.0)
thor (0.13.6)
treetop (1.4.8)
trollop (1.16.2)
tzinfo (0.3.22)
webrat (0.7.1)

Version of XCode: 3.1.1

My suspicion is it has to do with "-I/Users/joshcrews/.rvm/rubies/ruby-1.8.7-p174/lib/ruby/1.8/i686-darwin9.8.0", because i686-darwin9.8.0 doesnt exist in that file

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

掐死时间 2024-09-11 15:07:30

我在 Railsconf 得到了一位(?)sqlite3-ruby gem 维护者 Aaron Patterson 的帮助。

选项:

  • 在 Snow Leopard 上
  • 安装 sqlite3-ruby 1.2.5
  • 首先通过 macports 安装 sqlite3

在 Snow Leopard 上安装

sqlite3- ruby >= 1.3.0 未针对 OSX 10.5 进行测试。 Snow Leopard 应该可以

安装 sqlite3-ruby 1.2.5

gem install sqlite3-ruby -v 1.2.5

然后设置每个 Rails3 Gemfile 来说明

gem 'sqlite3-ruby', '1.2.5', :require => 'sqlite3'

首先通过 macports 安装 sqlite3

sudo port install sqlite3
gem install sqlite3-ruby

I got help at Railsconf from a (the?) sqlite3-ruby gem maintainer, Aaron Patterson

Options:

  • Get on Snow Leopard
  • Install sqlite3-ruby 1.2.5
  • Install sqlite3 via macports first

Get on Snow Leopard

sqlite3-ruby >= 1.3.0 not tested for OSX 10.5. Snow Leopard should work

Install sqlite3-ruby 1.2.5

gem install sqlite3-ruby -v 1.2.5

Then set each Rails3 Gemfile to say this

gem 'sqlite3-ruby', '1.2.5', :require => 'sqlite3'

Install sqlite3 via macports first

sudo port install sqlite3
gem install sqlite3-ruby
沧笙踏歌 2024-09-11 15:07:30

我不是 100% 确定导致问题的原因,但我通过自制程序安装 sqlite3 使其正常工作: http: //github.com/mxcl/homebrew

之后,gem 安装得很好。 Leopard 版本的 sqlite3 必须与新版本的 sqlite3-ruby 不兼容。

I'm not 100% sure what is causing the issue, but I got it working by installing sqlite3 via homebrew: http://github.com/mxcl/homebrew

After that, the gem installed just fine. Leopard's version of sqlite3 must not be compatible with the new version of sqlite3-ruby.

离旧人 2024-09-11 15:07:30

如果您已经安装了sqlite3 macport 或brew,但仍然存在问题,则可能需要在安装gem 时指定构建选项。

示例:

gem install sqlite3 -v 1.3.5 -- --with-sqlite3-include=/opt/local/include --with-sqlite3-lib=/opt/local/lib

如果您使用自制软件,请使用 /usr/local 而不是 /opt/local 。

要配置捆绑器以记住 sqlite3 的构建选项(运行“bundle help config”以获取更多信息):

bundle config build.sqlite3 --with-sqlite3-include=/opt/local/include --with-sqlite3-lib=/opt/local/lib

If you already have the sqlite3 macport or brew installed, and you still have the issue, you might have to specify build options when installing the gem.

Example:

gem install sqlite3 -v 1.3.5 -- --with-sqlite3-include=/opt/local/include --with-sqlite3-lib=/opt/local/lib

If you're on homebrew, use /usr/local instead of /opt/local .

To configure bundler to remember the build options for sqlite3 (run "bundle help config" for more info):

bundle config build.sqlite3 --with-sqlite3-include=/opt/local/include --with-sqlite3-lib=/opt/local/lib
随遇而安 2024-09-11 15:07:30

我在 Linux 上遇到同样的问题,并运行以下两个命令。工作完美。

sudo aptitude install sqlite3 libsqlite3-dev
sudo gem install sqlite3-ruby

I have the same issue on Linux, and runs bellow two commands. Works perfectly.

sudo aptitude install sqlite3 libsqlite3-dev
sudo gem install sqlite3-ruby
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文