无法推送到heroku - sqlite3.h丢失了

时间:2020-12-20 20:38:40

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 *..

1-我在搜索*之前已经搜索了很多并尝试了很多东西。

2- When running

2-运行时

   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

3-我检查了Gemfile:分别为pg和sqlite3配置了生产和开发/测试

4- Sqlite3.h is here:

4- Sqlite3.h在这里:

   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..

5-忘了提到我正在使用mac os x ..

6- Output of: pcbo$ git push heroku master

6-输出: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 !

7-非常感谢任何帮助!

2 个解决方案

#1


11  

[Update1]

From your git push log, Here is your culprit:-

从你的git推送日志,这是你的罪魁祸首: -

 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

所以,正如我最初所怀疑的那样,错误是试图加载sqlite3 gem,这将在heroku上失败。如前所述,这可能是因为两个原因

  1. Gemfile is wrongly configured to require sqlite3 gem in production
  2. Gemfile配置错误,需要在生产中使用sqlite3 gem

  3. Some other gem has dependency on sqlite3 gem. use the gem dependency command to show the dependencies of gem & remove that gem which depends on sqlite3.
  4. 其他一些gem依赖于sqlite3 gem。使用gem依赖命令来显示gem的依赖关系并删除依赖于sqlite3的gem。

After that, rerun bundle install & it would work.

之后,重新运行bundle install,它会起作用。

---[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

您可以获得此错误的唯一原因是,尝试在heroku上使用不受支持的sqlite3数据库。仔细检查你的Gemfile并确保其设置与此类似

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以重新生成Gemfile.lock。现在,尝试推动heroku。如果你仍然得到这个错误,那么你正在使用的一些gem已经将sqlite3列为其gemspec文件中的硬编码依赖项。所以实际上,sqlite3正在加载,即使它不存在于gemfile中。所以验证这一点,在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.

最后,尝试了这个。它不起作用。回发git push heroku master的完整日志和heroku日志的输出。

#2


0  

Seems that the sqlite library is missing. Try and find it with

似乎缺少sqlite库。尝试找到它

whereis sqlite3.h

If it is in your system, try:

如果它在您的系统中,请尝试:

sudo gem install sqlite3-ruby -- --with-sqlite3-include=<"url where it is(for eg: /usr/include)">

Regards

#1


11  

[Update1]

From your git push log, Here is your culprit:-

从你的git推送日志,这是你的罪魁祸首: -

 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

所以,正如我最初所怀疑的那样,错误是试图加载sqlite3 gem,这将在heroku上失败。如前所述,这可能是因为两个原因

  1. Gemfile is wrongly configured to require sqlite3 gem in production
  2. Gemfile配置错误,需要在生产中使用sqlite3 gem

  3. Some other gem has dependency on sqlite3 gem. use the gem dependency command to show the dependencies of gem & remove that gem which depends on sqlite3.
  4. 其他一些gem依赖于sqlite3 gem。使用gem依赖命令来显示gem的依赖关系并删除依赖于sqlite3的gem。

After that, rerun bundle install & it would work.

之后,重新运行bundle install,它会起作用。

---[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

您可以获得此错误的唯一原因是,尝试在heroku上使用不受支持的sqlite3数据库。仔细检查你的Gemfile并确保其设置与此类似

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以重新生成Gemfile.lock。现在,尝试推动heroku。如果你仍然得到这个错误,那么你正在使用的一些gem已经将sqlite3列为其gemspec文件中的硬编码依赖项。所以实际上,sqlite3正在加载,即使它不存在于gemfile中。所以验证这一点,在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.

最后,尝试了这个。它不起作用。回发git push heroku master的完整日志和heroku日志的输出。

#2


0  

Seems that the sqlite library is missing. Try and find it with

似乎缺少sqlite库。尝试找到它

whereis sqlite3.h

If it is in your system, try:

如果它在您的系统中,请尝试:

sudo gem install sqlite3-ruby -- --with-sqlite3-include=<"url where it is(for eg: /usr/include)">

Regards