Re: Trouble starting new project from command line in Windows 10

320 views
Skip to first unread message

Chris Reed

unread,
Feb 7, 2019, 12:15:53 PM2/7/19
to RailsInstaller
Hi there,

I am having some trouble starting a new rails project from the command line on a Windows 10 machine.  I installed RailsInstaller for Windows (Ruby 2.3).  Here are some details about the verisons of software I have:

ruby -v ==> ruby 2.3.3p222 (2016-11-21 revision 56859) [i386-mingw32]

rails -v ==> Rails 4.2.8

When I run the command "rails new test_install" from the command line, this is a portion of what I see from the command line:

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

current directory:
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/sqlite3-1.4.0/ext/sqlite3
C:/RailsInstaller/Ruby2.3.3/bin/ruby.exe -r ./siteconf20190207-2600-5f4xpz.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.
*****************************************************************************************************

And, the contents of my mkmf.log file are:

*****************************************************************************************************
package configuration for sqlite3 is not found
find_header: checking for sqlite3.h... -------------------- no

"gcc -o conftest.exe -IC:/RailsInstaller/Ruby2.3.3/include/ruby-2.3.0/i386-mingw32 -IC:/RailsInstaller/Ruby2.3.3/include/ruby-2.3.0/ruby/backward -IC:/RailsInstaller/Ruby2.3.3/include/ruby-2.3.0 -I. -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64   -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat conftest.c  -L. -LC:/RailsInstaller/Ruby2.3.3/lib -L.      -lmsvcrt-ruby230  -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: int main(int argc, char **argv)
6: {
7:   return 0;
8: }
/* end */

"gcc -E -IC:/RailsInstaller/Ruby2.3.3/include/ruby-2.3.0/i386-mingw32 -IC:/RailsInstaller/Ruby2.3.3/include/ruby-2.3.0/ruby/backward -IC:/RailsInstaller/Ruby2.3.3/include/ruby-2.3.0 -I. -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64   -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat  conftest.c -o conftest.i"
conftest.c:5:21: fatal error: sqlite3.h: No such file or directory
compilation terminated.
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <sqlite3.h>
/* end */
******************************************************************************************************

Any help or direction would be greatly appreciated.

Thanks,
Chris

Chris Reed

unread,
Feb 7, 2019, 5:16:58 PM2/7/19
to RailsInstaller
Hi, I wanted to let group members know that this issue has been resolved.  Apparently, it was an issue with the latest sqlite3 gem.  Modifying the gem file worked.

michae...@gmail.com

unread,
Feb 7, 2019, 8:06:51 PM2/7/19
to RailsInstaller
Hi Chris,

How did you modify the Gemfile?  I'm having the exact same problem.

Chris Reed

unread,
Feb 7, 2019, 9:44:18 PM2/7/19
to RailsInstaller
Hi,

From the command line, I executed the command "rails new <name_of_install>".  Then, in the <name_of_install> directory I modified the "Gemfile" by changing the line from "gem 'sqlite3'" TO "gem 'sqlite3', '1.3.13'".  Then from within that directory, I ran the command "bundle update".  And, finally I ran the command "rails server".  That seemed to the do the trick for me.

Hope this works for you too,
Chris

michae...@gmail.com

unread,
Feb 8, 2019, 4:17:32 PM2/8/19
to RailsInstaller
This worked.  Thanks so much for the specifics!

Abdul Wadood Butt

unread,
Feb 13, 2019, 9:18:13 PM2/13/19
to RailsInstaller
Thank you so much!

Cori Eby

unread,
May 13, 2019, 1:49:23 AM5/13/19
to RailsInstaller

@Chris_Reed: 
Thank you. So much. I have searched for this answer literally for days and only found this answer here. I personally would really appreciate it if this were part of an FAQ somewhere.

hassan abdi

unread,
May 27, 2019, 3:52:52 PM5/27/19
to RailsInstaller
Hi 
I am using windows 10 and trying to start new project. this is my first I am doing ruby on rails. 
I am still having a same trouble even though I tried the rails new. This is what i see in command line. If anyone can help me please.

Thank you so much for your help!
error.PNG
Reply all
Reply to author
Forward
0 new messages