问题描述
1-我搜索了很多东西,并尝试加载之前考虑发布在stackoverflow上。
2-运行时
git push heroku master
我得到这个:
检查sqlite3.h ...没有
sqlite3.h丢失。试试'port install sqlite3 + universal'
或'yum install sqlite-devel'并检查你的共享库搜索路径(sqlite3共享库所在的
位置)。
我检查了Gemfile:production和dev / test分别为pg和sqlite3分别配置
$ b
pcbo $ ls - l /usr/include/sqlite3.h
-rw -r - r-- 1个根轮322724 2011年12月7日/usr/include/sqlite3.h
5-忘记提及我使用的是mac os x ..
6-输出:
pcbo $ git push heroku master
计数对象:71,完成。
使用多达4个线程的增量压缩。
压缩对象:100%(58/58),完成。
写作对象:100%(71/71),26.46 KiB,完成。
总计71(增量8),重用0(增量0)
-----> Heroku接收推送
-----> Ruby / Rails应用程序检测到
----->使用Bundler版本1.2.0.pre $ b $安装依赖项运行:bundle install --without development:test --path vendor / bundle --binstubs bin / --deployment
从https://获取gem元数据rubygems.org / .......
安装rake(0.9.2.2)
安装i18n(0.6.0)
安装multi_json(1.3.6)
安装activesupport (3.2.3)
安装构建器(3.0.0)
安装activemodel(3.2.3)
安装erubis(2.7.0)
安装旅程(1.0.3)
安装机架(1.4.1)
安装机架高速缓存(1.2)
安装机架测试(0.6.1)
安装远程(1.2.1)
安装倾斜(1.3.3)
安装链轮(2.1.3)
安装actionpack(3.2.3)
安装MIME类型(1.18)
安装多边形(0.3.3)
安装treetop(1.4.10)
安装邮件(2.4.4)
安装actionmailer(3.2.3)
安装arel(3.0.2)
安装tzinfo (0.3.33)
安装activerecord(3.2.3)
安装activeresource(3.2.3)
安装coffee-script-source(1.3.3)
安装execjs(1.4 .0)
安装coffee-script(2.2.0)
安装rack-ssl(1.3.2)
使用本机扩展安装json(1.7.3)
安装rdoc( 3.12)
安装thor(0.14.6)
安装railties(3.2.3)
安装咖啡栏(3.2.2)
安装jquery-rails(2.0.2)
使用原生扩展安装pg(0.12.2)
使用bundler(1.2.0.pre)
安装rails(3.2.3)
安装sass(3.1.19)
安装sass-rails(3.2.5)
使用本机扩展安装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
--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 = / usr / local / 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
--enable-local
--disable -local
Gem文件将保留安装在/tmp/build_zmjrcoagwpai/vendor/bundle/ruby/1.9.1/宝石/ sqlite3-1.3.6进行检查。
记录到/tmp/build_zmjrcoagwpai/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应用程序
7-任何帮助都非常感谢! p>
[Update1]
git push log,这是你的罪魁祸首: - 使用原生扩展安装sqlite3(1.3.6)
code>
所以,正如我最初所怀疑的,错误是试图加载 sqlite3
gem这将在heroku上失败。如前所述,这可能是由于以下两个原因造成的:
- Gemfile被错误配置为生产中需要sqlite3 gem
- 其他一些gem依赖于
sqlite3
gem。使用gem dependency
命令来显示gem&删除那个依赖于sqlite3
的宝石。
之后,重新运行 bundle install
&它会工作。
--- [结束更新1] ---
您可以获得的唯一原因这个错误是当试图在不支持的heroku上使用 sqlite3
数据库时。仔细检查你的 Gemfile
,并确保它的设置与此类似
group:production do
gem'pg'
end
group:development,:test do
gem'sqlite3'
end
然后执行 bundle install
来重新生成您的 Gemfile.lock
。现在,尝试推Herku。如果你仍然得到这个错误,那么你可能使用的一些gem已经在 gemspec $ c $中列出了
sqlite3
作为硬编码依赖项c>文件。所以实际上,sqlite3正在被加载,即使它不存在于gemfile中。所以验证一下,在localhost上运行以下命令:
$ bundle install | grep sqlite
最后,尝试此操作后。它不起作用。回发的完整日志git push heroku master
&输出 heroku日志
。
first post here =) Thanks in advance for helping out, any help is cool at this point!
1- I've searched quite a lot and tried loads of stuff before considering posting on stackoverflow..
2- When running
git push heroku master
I get this:
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).
3- I checked the Gemfile: production and dev/test are well configured for pg and sqlite3 respectively
4- Sqlite3.h is here:
pcbo$ ls -l /usr/include/sqlite3.h
-rw-r--r-- 1 root wheel 322724 7 Dec 2011 /usr/include/sqlite3.h
5- Forgot to mention i'm using mac os x..
6- Output of: pcbo$ git push heroku master
Counting objects: 71, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (58/58), done.
Writing objects: 100% (71/71), 26.46 KiB, done.
Total 71 (delta 8), reused 0 (delta 0)
-----> Heroku receiving push
-----> Ruby/Rails app detected
-----> Installing dependencies using Bundler version 1.2.0.pre
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 i18n (0.6.0)
Installing multi_json (1.3.6)
Installing activesupport (3.2.3)
Installing builder (3.0.0)
Installing activemodel (3.2.3)
Installing erubis (2.7.0)
Installing journey (1.0.3)
Installing rack (1.4.1)
Installing rack-cache (1.2)
Installing rack-test (0.6.1)
Installing hike (1.2.1)
Installing tilt (1.3.3)
Installing sprockets (2.1.3)
Installing actionpack (3.2.3)
Installing mime-types (1.18)
Installing polyglot (0.3.3)
Installing treetop (1.4.10)
Installing mail (2.4.4)
Installing actionmailer (3.2.3)
Installing arel (3.0.2)
Installing tzinfo (0.3.33)
Installing activerecord (3.2.3)
Installing activeresource (3.2.3)
Installing coffee-script-source (1.3.3)
Installing execjs (1.4.0)
Installing coffee-script (2.2.0)
Installing rack-ssl (1.3.2)
Installing json (1.7.3) with native extensions
Installing rdoc (3.12)
Installing thor (0.14.6)
Installing railties (3.2.3)
Installing coffee-rails (3.2.2)
Installing jquery-rails (2.0.2)
Installing pg (0.12.2) with native extensions
Using bundler (1.2.0.pre)
Installing rails (3.2.3)
Installing sass (3.1.19)
Installing sass-rails (3.2.5)
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
--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=/usr/local/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
--enable-local
--disable-local
Gem files will remain installed in /tmp/build_zmjrcoagwpai/vendor/bundle/ruby/1.9.1/gems/sqlite3-1.3.6 for inspection.
Results logged to /tmp/build_zmjrcoagwpai/vendor/bundle/ruby/1.9.1/gems/sqlite3-1.3.6/ext/sqlite3/gem_make.out
An error occurred 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
7- Any help is really appreciated !
[Update1]
From your git push log, Here is your culprit:-
Installing sqlite3 (1.3.6) with native extensions
So, As I initially suspected, blunder is trying to load sqlite3
gem which WILL fail on heroku. as said earlier this can happen because of two reasons
- Gemfile is wrongly configured to require sqlite3 gem in production
- Some other gem has dependency on
sqlite3
gem. use thegem dependency
command to show the dependencies of gem & remove that gem which depends onsqlite3
.
After that, rerun bundle install
& it would work.
---[End Update1]---
The only reason you can get this error is when, trying to use sqlite3
database on heroku which is not supported. so closely inspect your Gemfile
and make sure its setup similar to this
group :production do
gem 'pg'
end
group :development, :test do
gem 'sqlite3'
end
And then do bundle install
to regenerate your Gemfile.lock
. now, try to push heroku. if you still get this error, then probably some gem that you are using has listed sqlite3
as hard-coded dependency in its gemspec
file. so in effect, sqlite3 is being loaded even though its not present in gemfile. so verify this, run the following command on localhost:
$ bundle install | grep sqlite
Lastly, after trying this. it doesn't work. Post back the complete log of git push heroku master
& output of heroku logs
.
这篇关于无法推送到heroku - sqlite3.h丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!