" sqlite3.h"将Rails应用程序推送到Heroku时缺失 [英] "sqlite3.h" missing when pushing Rails app to Heroku

查看:143
本文介绍了" sqlite3.h"将Rails应用程序推送到Heroku时缺失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遵循本教程,但在尝试推送时失败到Heroku。似乎sqlite3.h缺失。我是开发新手,所以我不确定哪些信息会帮助人们诊断问题,所以这里就是一切:)。我在Mac OS X 10.7 Lion上运行。以下是我使用的所有版本:

  Amits-MacBook-Air-2:demo_app amitgupta $ ruby​​ -v 
ruby​​ 1.9.3p194(2012-04-20修订版35410)[x86_64-darwin11.3.0]
Amits-MacBook-Air-2:demo_app amitgupta $ rails -v
Rails 3.2.3
Amits-MacBook-Air-2:demo_app amitgupta $ sqlite3 -version
3.7.11 2012-03-20 11:35:50 00bb9c9ce4f465e6ac321ced2a9d0062dc364669
Amits-MacBook-Air-2:demo_app amitgupta $ heroku -v
2.25.0
Amits-MacBook-Air-2:demo_app amitgupta $ port -v
MacPorts 2.0.4
进入交互模式...(help 寻求帮助,退出退出)
[RailsApps / demo_app]>退出
再见

当我尝试推送到Heroku时:

  Amits-MacBook-Air-2:demo_app amitgupta $ heroku create --stack cedar 
创建floating-stream-8009 ... done,stack是雪松
http://floating-stream-8009.herokuapp.com/ | git@heroku.com:floating-stream-8009.git
Amits-MacBook-Air-2:demo_app amitgupta $ git push heroku master

以下是我得到的结果:

 计数对象:119,完成。 
使用多达4个线程的增量压缩。
压缩对象:100%(104/104),完成。
写作对象:100%(119/119),33.74 KiB,完成。
共计119(增量17),重用0(增量0)

-----> Heroku接收推送
-----> Ruby / Rails应用程序检测到
----->使用Bundler版本1.1.2安装依赖项
运行:bundle install --without development:test --path vendor / bundle --binstubs bin / --deployment
从https:// ruby​​gems中获取gem元数据。 org / .......
安装rake(0.9.2.2)



使用本机扩展安装sqlite3(1.3.6)
Gem :: Installer :: ExtensionBuildError:错误:无法构建gem本机扩展。
/ usr / local / bin / ruby​​ extconf.rb
检查sqlite3.h ...没有
sqlite3.h缺失。试试'port install sqlite3 + universal'
或'yum install sqlite-devel'并检查你的共享库搜索路径(sqlite3共享库所在的
位置)。
*** extconf.rb失败***
由于某些原因无法创建Makefile,可能缺少
必需的库和/或头文件。查看mkmf.log文件以获取更多
的详细信息。您可能需要配置选项。
提供的配置选项:
--with-opt-dir



--disable-local
Gem文件将保留安装在/tmp/build_2l2dn7bx7lu34/vendor/bundle/ruby/1.9.1/gems/sqlite3-1.3.6中进行检查。
结果记录到/tmp/build_2l2dn7bx7lu34/vendor/bundle/ruby/1.9.1/gems/sqlite3-1.3.6/ext/sqlite3/gem_make.out
安装sqlite3时出现错误(1.3。 6)和Bundler无法继续。
确保在捆绑之前,gem install sqlite3 -v'1.3.6'`成功。

!无法通过Bundler安装宝石。

! Heroku推送被拒绝,未能编译Ruby / rails应用程序

到git@heroku.com:blazing-mountain-3659.git
! [remote rejected] master - > master(pre-receive hook refused)
错误:未能推送一些文件到'git@heroku.com:blazing-mountain-3659.git'

当我这样做时:

  Amits-MacBook-Air-2: demo_app amitgupta $ sudo port install sqlite3 + universal 

我得到:

 密码:
--->计算sqlite3的依赖关系
--->清理sqlite3

接下来我尝试了:

  Amits-MacBook-Air-2:demo_app amitgupta $ sudo gem install sqlite3 -v'1.3.6'

得到:

 构建原生扩展。这可能需要一段时间... 
成功安装了sqlite3-1.3.6
1个安装的gem
为sqlite3-1.3.6安装ri文档...
安装RDoc文档然后:

  Amits-MacBook-Air-2:demo_app amitgupta $ bundle install 

给出:

 使用rake(0.9.2.2)



使用sqlite3(1.3.6)
使用uglifier(1.2.4)
您的包已完成!使用`bundle show [gemname]`来查看捆绑的gem的安装位置。

然后我尝试再次推向Heroku,但遇到同样的问题。也许这与第一条命令Creating floating-stream-8009和第二条命令未能推送一些文件到git@heroku.com:blazing-mountain-3659.git之间的差异有关系? Heroku使用postgresql,因此您想要删除sqlite3或将其移至您的Gemfile中的开发组中。

$ b

解决方案


$ b

检查你的Gemfile.lock是否有其他可能依赖sqlite3的gem,因为这也可能导致问题。


I'm following this tutorial, but it fails when I try to push to Heroku. It seems "sqlite3.h" is missing. I'm new to development so I'm not sure what information will help people diagnose the problem, so here's everything :). I'm running on Mac OS X 10.7 Lion. Here are the versions of everything I'm working with:

Amits-MacBook-Air-2:demo_app amitgupta$ ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.3.0]
Amits-MacBook-Air-2:demo_app amitgupta$ rails -v
Rails 3.2.3
Amits-MacBook-Air-2:demo_app amitgupta$ sqlite3 -version
3.7.11 2012-03-20 11:35:50 00bb9c9ce4f465e6ac321ced2a9d0062dc364669
Amits-MacBook-Air-2:demo_app amitgupta$ heroku -v
2.25.0
Amits-MacBook-Air-2:demo_app amitgupta$ port -v
MacPorts 2.0.4
Entering interactive mode... ("help" for help, "quit" to quit)
[RailsApps/demo_app] > quit 
Goodbye

When I try to push to Heroku:

Amits-MacBook-Air-2:demo_app amitgupta$ heroku create --stack cedar
Creating floating-stream-8009... done, stack is cedar
http://floating-stream-8009.herokuapp.com/ | git@heroku.com:floating-stream-8009.git
Amits-MacBook-Air-2:demo_app amitgupta$ git push heroku master

Here's what I get:

Counting objects: 119, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (104/104), done.
Writing objects: 100% (119/119), 33.74 KiB, done.
Total 119 (delta 17), reused 0 (delta 0)

-----> Heroku receiving push
-----> Ruby/Rails app detected
-----> Installing dependencies using Bundler version 1.1.2
       Running: bundle install --without development:test --path vendor/bundle --binstubs bin/ --deployment
       Fetching gem metadata from https://rubygems.org/.......
       Installing rake (0.9.2.2)
       .
       .
       .
       Installing sqlite3 (1.3.6) with native extensions
       Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
       /usr/local/bin/ruby extconf.rb
       checking for sqlite3.h... no
       sqlite3.h is missing. Try 'port install sqlite3 +universal'
       or 'yum install sqlite-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.
       Provided configuration options:
       --with-opt-dir
       .
       .
       .
       --disable-local
       Gem files will remain installed in /tmp/build_2l2dn7bx7lu34/vendor/bundle/ruby/1.9.1/gems/sqlite3-1.3.6 for inspection.
       Results logged to /tmp/build_2l2dn7bx7lu34/vendor/bundle/ruby/1.9.1/gems/sqlite3-1.3.6/ext/sqlite3/gem_make.out
       An error occured while installing sqlite3 (1.3.6), and Bundler cannot continue.
       Make sure that `gem install sqlite3 -v '1.3.6'` succeeds before bundling.
 !
 !     Failed to install gems via Bundler.
 !
 !     Heroku push rejected, failed to compile Ruby/rails app

To git@heroku.com:blazing-mountain-3659.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:blazing-mountain-3659.git'

When I do:

Amits-MacBook-Air-2:demo_app amitgupta$ sudo port install sqlite3 +universal

I get:

Password:
--->  Computing dependencies for sqlite3
--->  Cleaning sqlite3

Next I tried:

Amits-MacBook-Air-2:demo_app amitgupta$ sudo gem install sqlite3 -v '1.3.6'

And get:

Building native extensions.  This could take a while...
Successfully installed sqlite3-1.3.6
1 gem installed
Installing ri documentation for sqlite3-1.3.6...
Installing RDoc documentation for sqlite3-1.3.6...

Then:

Amits-MacBook-Air-2:demo_app amitgupta$ bundle install

gives:

Using rake (0.9.2.2) 
.
.
.
Using sqlite3 (1.3.6) 
Using uglifier (1.2.4) 
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

Then I try pushing to Heroku again, but get the same problem. Perhaps it has something to do with the discrepancy between the first command "Creating floating-stream-8009" and the second command "failed to push some refs to 'git@heroku.com:blazing-mountain-3659.git'"?

解决方案

Heroku uses postgresql so you want to remove sqlite3 or move it into a development group in your Gemfile.

Check you Gemfile.lock for any other gems that may have dependencies on sqlite3, as this can also cause problems.

这篇关于" sqlite3.h"将Rails应用程序推送到Heroku时缺失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆