0

Estoy tratando de hacer una instalación básica de Ruby on Rails en windows7 siguiendo las instrucciones de esta página: https://github.com/oneclick/rubyinstaller2

Cuando voy por la parte de

To install sqlite3 gem:
  ridk exec pacman -S mingw-w64-x86_64-sqlite3
  gem install sqlite3 --platform ruby

Me sale este error:

D:\sites>gem install sqlite3 --platform ruby
Building native extensions. This could take a while...
ERROR:  Error installing sqlite3:
        ERROR: Failed to build gem native extension.

    current directory: C:/Ruby25/lib/ruby/gems/2.5.0/gems/sqlite3-1.3.13/ext/sqlite3
C:/Ruby25/bin/ruby.exe -r ./siteconf20190118-2988-1scxdcu.rb extconf.rb
checking for sqlite3.h... no
sqlite3.h is missing. Install SQLite3 from http://www.sqlite.org/ first.
*** 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=C:/Ruby25/bin/$(RUBY_BASE_NAME)
        --with-sqlite3-config
        --without-sqlite3-config
        --with-pkg-config
        --without-pkg-config
        --with-sqlite3-dir
        --without-sqlite3-dir
        --with-sqlite3-include
        --without-sqlite3-include=${sqlite3-dir}/include
        --with-sqlite3-lib
        --without-sqlite3-lib=${sqlite3-dir}/lib

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  C:/Ruby25/lib/ruby/gems/2.5.0/extensions/x86-mingw32/2.5.0/sqlite3-1.3.13/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in C:/Ruby25/lib/ruby/gems/2.5.0/gems/sqlite3-1.3.13 for inspection.
Results logged to C:/Ruby25/lib/ruby/gems/2.5.0/extensions/x86-mingw32/2.5.0/sqlite3-1.3.13/gem_make.out

Cuando instalo la gema de sqlite3 sola.

D:\sites>gem install sqlite3
Fetching sqlite3-1.3.13-x86-mingw32.gem
Successfully installed sqlite3-1.3.13-x86-mingw32
Parsing documentation for sqlite3-1.3.13-x86-mingw32
Installing ri documentation for sqlite3-1.3.13-x86-mingw32
Done installing documentation for sqlite3 after 1 seconds
1 gem installed

Se instala correctamente y al crear la aplicación….

D:\sites>rails new abc
….
Using sqlite3 1.3.13 (x86-mingw32)
Using turbolinks-source 5.2.0
Using turbolinks 5.2.0
Using tzinfo-data 1.2018.9
Using uglifier 4.1.20
Using web-console 3.7.0
Bundle complete! 12 Gemfile dependencies, 60 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.

Se crea sin errores, todo bien.

Pero al tratar de ejecutarla este error que me tiene loco…

D:\sites>cd abc
D:\sites\abc>rails s
Traceback (most recent call last):
        18: from bin/rails:4:in `<main>'
        17: from bin/rails:4:in `require'
        16: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/railties-5.0.7.1/lib/rails/commands.rb:18:in `<top (required)>'
        15: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/railties-5.0.7.1/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
        14: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/railties-5.0.7.1/lib/rails/commands/commands_tasks.rb:85:in `server'
        13: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/railties-5.0.7.1/lib/rails/commands/commands_tasks.rb:85:in `tap'
        12: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/railties-5.0.7.1/lib/rails/commands/commands_tasks.rb:88:in `block in server'
        11: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/railties-5.0.7.1/lib/rails/commands/commands_tasks.rb:88:in `require'
        10: from D:/sites/abc/config/application.rb:7:in `<top (required)>'
         9: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/bundler-2.0.1/lib/bundler.rb:114:in `require'
         8: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/bundler-2.0.1/lib/bundler/runtime.rb:65:in `require'
         7: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/bundler-2.0.1/lib/bundler/runtime.rb:65:in `each'
         6: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/bundler-2.0.1/lib/bundler/runtime.rb:76:in `block in require'
         5: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/bundler-2.0.1/lib/bundler/runtime.rb:76:in `each'
         4: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/bundler-2.0.1/lib/bundler/runtime.rb:81:in `block (2 levels) in require'
         3: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/bundler-2.0.1/lib/bundler/runtime.rb:81:in `require'
         2: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/sqlite3-1.3.13-x86-mingw32/lib/sqlite3.rb:2:in `<top (required)>'
         1: from C:/Ruby25/lib/ruby/gems/2.5.0/gems/sqlite3-1.3.13-x86-mingw32/lib/sqlite3.rb:6:in `rescue in <top (required)>'
C:/Ruby25/lib/ruby/gems/2.5.0/gems/sqlite3-1.3.13-x86-mingw32/lib/sqlite3.rb:6:in `require': cannot load such file -- sqlite3/sqlite3_native (LoadError)

Mis versiones de ruby y rails respectivamente son:

D:\sites>rails -v
Rails 5.0.7.1
D:\sites>ruby -v
ruby 2.5.3p105 (2018-10-18 revision 65156) [i386-mingw32]

Alguna idea que pueda ser, he probado de todo, todo el día, no he puesto ninguna de esas pruebas para no generar ruido en la pregunta.

2
  • Para ser que windows no encuentra el ejecutable correspondiente, revista tu PATH en las variables de entorno. ¿Ya probaste instalar sqlite tomando los ejecutables directamente de su sitio?
    – Gerry
    Commented el 20 ene. 2019 a las 19:47
  • échale una mirada a esto stackoverflow.com/questions/15480381/… Commented el 20 ene. 2019 a las 21:09

0

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge you have read our privacy policy.

Examina otras preguntas con la etiqueta o formula tu propia pregunta.