安装sqlite3(1.3.11)时发生错误,Bundler不能继续

时间:2022-01-28 23:52:03

So im trying to $ bundle install --without production before I $ git push heroku masterbut i keep getting this error

所以我试着在没有生产的情况下,在我$ git push heroku master但是我一直得到这个错误

$ bundle install --without production
Fetching gem metadata from https://rubygems.org/............
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies......
Using rake 10.4.2
Using i18n 0.7.0
Using json 1.8.3
Using minitest 5.8.3
Using thread_safe 0.3.5
Using tzinfo 1.2.2
Using activesupport 4.1.8
Using builder 3.2.2
Using erubis 2.7.0
Using actionview 4.1.8
Using rack 1.5.5
Using rack-test 0.6.3
Using actionpack 4.1.8
Using mime-types 2.99
Using mail 2.6.3
Using actionmailer 4.1.8
Using activemodel 4.1.8
Using arel 5.0.1.20140414130214
Using activerecord 4.1.8
Using execjs 2.6.0
Using autoprefixer-rails 6.1.2
Using sass 3.2.19
Using bootstrap-sass 3.3.5
Using bundler 1.10.6
Using coffee-script-source 1.10.0
Using coffee-script 2.4.1
Using thor 0.19.1
Using railties 4.1.8
Using coffee-rails 4.0.1
Using hike 1.2.3
Using multi_json 1.11.2
Using jbuilder 2.3.2
Using jquery-rails 3.1.4
Using tilt 1.4.1
Using sprockets 2.12.4
Using sprockets-rails 2.3.3
Using rails 4.1.8
Using rdoc 4.2.0
Using sass-rails 4.0.5
Using sdoc 0.4.1
Installing sqlite3 1.3.11 with native extensions
C:/jruby-9.0.0.0/lib/ruby/stdlib/rubygems/ext/ext_conf_builder.rb:39: warning: Tempfile#unlink or delete called on open file; ignoring

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    C:/jruby-9.0.0.0/bin/jruby.exe -r ./siteconf20151208-25620-qipdd0.rb extconf.rb
NotImplementedError: C extensions are not supported
    <top> at C:/jruby-9.0.0.0/lib/ruby/stdlib/mkmf.rb:1
  require at org/jruby/RubyKernel.java:940
   (root) at C:/jruby-9.0.0.0/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:1
    <top> at extconf.rb:3

extconf failed, exit code 1

Gem files will remain installed in C:/jruby-9.0.0.0/lib/ruby/gems/shared/gems/sqlite3-1.3.11 for inspection.
Results logged to C:/jruby-9.0.0.0/lib/ruby/gems/shared/extensions/universal-java-1.8/2.2.0/sqlite3-1.3.11/gem_make.out
An error occurred while installing sqlite3 (1.3.11), and Bundler cannot
continue.
Make sure that `gem install sqlite3 -v '1.3.11'` succeeds before bundling.

this is my Gemfile

这是我Gemfile

source 'https://rubygems.org'

gem 'rails', '4.1.8'
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'bootstrap-sass'



group :development, :test do
 gem 'sqlite3'
end

group :production do
 gem 'pg'
 gem 'rails_12factor'
end

group :doc do
    gem 'sdoc', require: false
end

I tried to

我试着

gem uninstall sqlite3
gem install sqlite

But i got

但是我有

$ gem install sqlite3
Building native extensions.  This could take a while...
C:/jruby-9.0.0.0/lib/ruby/stdlib/rubygems/ext/ext_conf_builder.rb:39: warning: Tempfile#unlink or delete called on open file; ignoring
ERROR:  Error installing sqlite3:
        ERROR: Failed to build gem native extension.

    C:/jruby-9.0.0.0/bin/jruby.exe -r ./siteconf20151208-19428-iytd2g.rb extconf.rb
NotImplementedError: C extensions are not supported
    <top> at C:/jruby-9.0.0.0/lib/ruby/stdlib/mkmf.rb:1
  require at org/jruby/RubyKernel.java:940
   (root) at C:/jruby-9.0.0.0/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:1
    <top> at extconf.rb:3

extconf failed, exit code 1

Gem files will remain installed in C:/jruby-9.0.0.0/lib/ruby/gems/shared/gems/sqlite3-1.3.11 for inspection.
Results logged to C:/jruby-9.0.0.0/lib/ruby/gems/shared/extensions/universal-java-1.8/2.2.0/sqlite3-1.3.11/gem_make.out

Does any one have any ideas to what could be causing this?

有人知道是什么导致了这种情况吗?

4 个解决方案

#1


2  

As benjamin said, you need to install the sqlite3 database before you can install the sqlite3 gem. It looks like you are on Windows, so try following the instructions listed here:

正如benjamin所说,在安装sqlite3 gem之前,您需要安装sqlite3数据库。看起来你在Windows操作系统上,所以试着按照这里列出的说明:

How do I install sqlite3 for Ruby on Windows?

如何在Windows上为Ruby安装sqlite3 ?

For reference, here is the accepted answer on that thread, by user Williams:

作为参考,以下是用户Williams在该线程上接受的答案:

  1. Install the Ruby Devkit for your setup (DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe for me since I use a x64 machine)

    为您的设置安装Ruby Devkit (Devkit -mingw64-64-4.7.2-20130224-1432-sfx)。因为我用的是x64机器)

  2. Download and extract the autoconf package from Sqlite.org

    从Sqlite.org下载并提取autoconf包

  3. Run msys.bat (it is inside the ruby devkit root folder)

    msys运行。bat(它在ruby devkit根文件夹中)

  4. cd into the path where you downloaded the sqlite source (for example: "cd /c/dev/sqlite3" for path "c:\dev\sqlite3" if you are new to MSYS/MINGW32)

    cd进入你下载sqlite源的路径(例如:“cd /c/dev/sqlite3”的路径“c:\dev\sqlite3”,如果你是MSYS/MINGW32的新手)

  5. Run "./configure"

    运行" . / configure "

  6. Run "make"

    “运行”

  7. Run "make install"

    运行“安装”

  8. Get the sqlite3 gem again, this time specifying the platform and the path to the newly compiled binaries:

    再次获得sqlite3 gem,这一次指定了平台和新编译的二进制文件的路径:

    gem install sqlite3 --platform=ruby -- --with-sqlite3-include=[path\to\sqlite3.h] --with-sqlite3-lib=[path\to\sqlite3.o]

    gem安装sqlite3——platform=ruby——with-sqlite3-include=[path\to\sqlite3]。h]——with-sqlite3-lib =[路径\ \ sqlite3.o]

    For example:

    例如:

    gem install sqlite3 --platform=ruby -- --with-sqlite3-include=/c:/dev/sqlite3/ --with-sqlite3-lib=/c:/dev/sqlite3/.libs/

    gem安装sqlite3——platform=ruby——with-sqlite3-include=/c:/dev/sqlite3/——with-sqlite3-lib=/c:/dev/sqlite3/.libs/

    (from the paths given in step 4)

    (从第4步给出的路径)

  9. Check the Gemfile.lock of your rails app and make sure that it points to the correct sqlite3 version. Mine was "sqlite3 (1.3.7-x86-mingw32)" and manually changed it to "sqlite3 (1.3.7-x64-mingw32)". Removing the platform also works: "sqlite3 (1.3.7)".

    检查Gemfile。锁定您的rails应用程序,并确保它指向正确的sqlite3版本。我的代码是“sqlite3 (1.3.7-x86-mingw32)”,并手动更改为“sqlite3 (1.3.7-x64-mingw32)”。移除平台也可以工作:“sqlite3(1.3.7)”。

Good luck!

好运!

#2


2  

I think you need to install sqlite3 and sqlite3-dev first.

我认为您需要先安装sqlite3和sqlite3-dev。

sudo apt-get install -y sqlite3 libsqlite3-dev

Have a try, might solve your problem

试试看,能不能解决你的问题

#3


0  

You have to install the sqlite3 database for your operating system, preferably through the tool your OS provides. After doing this, try installing the gem again. Chances are you have to resolve similar errors by the same procedure.

您必须为操作系统安装sqlite3数据库,最好是通过操作系统提供的工具。完成此操作后,再尝试安装gem。很有可能你必须用同样的程序来解决类似的错误。

#4


0  

This might helps. I got the same problem, I searched a lot and now I solved this. This is maybe just about sqlite3's version

这可能有帮助。我遇到了同样的问题,我搜索了很多,现在我解决了这个问题。这可能只是sqlite3的版本。

you should do this first

你应该先这么做

sudo apt-get install -y sqlite3 libsqlite3-dev

sudo apt-get install -y sqlite3 libsqlite3-dev

then open your Gemfile and change the line of sqlite3 to

然后打开您的Gemfile并更改sqlite3的行。

gem 'sqlite3', '~> 1.3', '>= 1.3.11'

gem 'sqlite3', '~> 1.3', '>= 1.3.11'

then run

然后运行

bundle install

包安装

I hope this will help you as it helped me.

我希望这能帮助你,因为它帮助了我。

#1


2  

As benjamin said, you need to install the sqlite3 database before you can install the sqlite3 gem. It looks like you are on Windows, so try following the instructions listed here:

正如benjamin所说,在安装sqlite3 gem之前,您需要安装sqlite3数据库。看起来你在Windows操作系统上,所以试着按照这里列出的说明:

How do I install sqlite3 for Ruby on Windows?

如何在Windows上为Ruby安装sqlite3 ?

For reference, here is the accepted answer on that thread, by user Williams:

作为参考,以下是用户Williams在该线程上接受的答案:

  1. Install the Ruby Devkit for your setup (DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe for me since I use a x64 machine)

    为您的设置安装Ruby Devkit (Devkit -mingw64-64-4.7.2-20130224-1432-sfx)。因为我用的是x64机器)

  2. Download and extract the autoconf package from Sqlite.org

    从Sqlite.org下载并提取autoconf包

  3. Run msys.bat (it is inside the ruby devkit root folder)

    msys运行。bat(它在ruby devkit根文件夹中)

  4. cd into the path where you downloaded the sqlite source (for example: "cd /c/dev/sqlite3" for path "c:\dev\sqlite3" if you are new to MSYS/MINGW32)

    cd进入你下载sqlite源的路径(例如:“cd /c/dev/sqlite3”的路径“c:\dev\sqlite3”,如果你是MSYS/MINGW32的新手)

  5. Run "./configure"

    运行" . / configure "

  6. Run "make"

    “运行”

  7. Run "make install"

    运行“安装”

  8. Get the sqlite3 gem again, this time specifying the platform and the path to the newly compiled binaries:

    再次获得sqlite3 gem,这一次指定了平台和新编译的二进制文件的路径:

    gem install sqlite3 --platform=ruby -- --with-sqlite3-include=[path\to\sqlite3.h] --with-sqlite3-lib=[path\to\sqlite3.o]

    gem安装sqlite3——platform=ruby——with-sqlite3-include=[path\to\sqlite3]。h]——with-sqlite3-lib =[路径\ \ sqlite3.o]

    For example:

    例如:

    gem install sqlite3 --platform=ruby -- --with-sqlite3-include=/c:/dev/sqlite3/ --with-sqlite3-lib=/c:/dev/sqlite3/.libs/

    gem安装sqlite3——platform=ruby——with-sqlite3-include=/c:/dev/sqlite3/——with-sqlite3-lib=/c:/dev/sqlite3/.libs/

    (from the paths given in step 4)

    (从第4步给出的路径)

  9. Check the Gemfile.lock of your rails app and make sure that it points to the correct sqlite3 version. Mine was "sqlite3 (1.3.7-x86-mingw32)" and manually changed it to "sqlite3 (1.3.7-x64-mingw32)". Removing the platform also works: "sqlite3 (1.3.7)".

    检查Gemfile。锁定您的rails应用程序,并确保它指向正确的sqlite3版本。我的代码是“sqlite3 (1.3.7-x86-mingw32)”,并手动更改为“sqlite3 (1.3.7-x64-mingw32)”。移除平台也可以工作:“sqlite3(1.3.7)”。

Good luck!

好运!

#2


2  

I think you need to install sqlite3 and sqlite3-dev first.

我认为您需要先安装sqlite3和sqlite3-dev。

sudo apt-get install -y sqlite3 libsqlite3-dev

Have a try, might solve your problem

试试看,能不能解决你的问题

#3


0  

You have to install the sqlite3 database for your operating system, preferably through the tool your OS provides. After doing this, try installing the gem again. Chances are you have to resolve similar errors by the same procedure.

您必须为操作系统安装sqlite3数据库,最好是通过操作系统提供的工具。完成此操作后,再尝试安装gem。很有可能你必须用同样的程序来解决类似的错误。

#4


0  

This might helps. I got the same problem, I searched a lot and now I solved this. This is maybe just about sqlite3's version

这可能有帮助。我遇到了同样的问题,我搜索了很多,现在我解决了这个问题。这可能只是sqlite3的版本。

you should do this first

你应该先这么做

sudo apt-get install -y sqlite3 libsqlite3-dev

sudo apt-get install -y sqlite3 libsqlite3-dev

then open your Gemfile and change the line of sqlite3 to

然后打开您的Gemfile并更改sqlite3的行。

gem 'sqlite3', '~> 1.3', '>= 1.3.11'

gem 'sqlite3', '~> 1.3', '>= 1.3.11'

then run

然后运行

bundle install

包安装

I hope this will help you as it helped me.

我希望这能帮助你,因为它帮助了我。