Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 无法在Windows PC上安装dm sqlite适配器Gem_Ruby On Rails_Ruby_Sqlite - Fatal编程技术网

Ruby on rails 无法在Windows PC上安装dm sqlite适配器Gem

Ruby on rails 无法在Windows PC上安装dm sqlite适配器Gem,ruby-on-rails,ruby,sqlite,Ruby On Rails,Ruby,Sqlite,我是Ruby/Sinatra新手,正在尝试安装DataMapper SQLite适配器。当我运行gem install dm sqlite adapter时,我得到下面的消息。我以前确实使用命令gem install sqlite3安装了sqlite3。但是,如果我尝试调用gem install sqlite3--platform=ruby,就会出现错误 我尝试了多种不同的方法来回避这个问题。我能够安装Ruby开发工具包,就像我能够安装JSON gem一样。类似地,我从下载了SQLite源代码,

我是Ruby/Sinatra新手,正在尝试安装DataMapper SQLite适配器。当我运行
gem install dm sqlite adapter
时,我得到下面的消息。我以前确实使用命令
gem install sqlite3
安装了sqlite3。但是,如果我尝试调用
gem install sqlite3--platform=ruby
,就会出现错误

我尝试了多种不同的方法来回避这个问题。我能够安装Ruby开发工具包,就像我能够安装JSON gem一样。类似地,我从下载了SQLite源代码,但我无法弄清楚如何正确配置该工具可以找到的合并的所有方面。下面是
mkmf.log
的值:

have_header: checking for sqlite3.h... -------------------- no

"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/Ruby200-x64/include/ruby-2.0.0/x64-mingw32 -IC:/Ruby200-x64/include/ruby-2.0.0/ruby/backward -IC:/Ruby200-x64/include/ruby-2.0.0 -I. -I/usr/local/include -I/opt/local/include -I/usr/include -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -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 -Wall  -DHAVE_NO_DATETIME_NEWBANG conftest.c  -L. -LC:/Ruby200-x64/lib -L/usr/local/ -L/opt/local/ -L/usr/ -L.      -lx64-msvcrt-ruby200  -lshell32 -lws2_32 -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 */

"x86_64-w64-mingw32-gcc -E -IC:/Ruby200-x64/include/ruby-2.0.0/x64-mingw32 -IC:/Ruby200-x64/include/ruby-2.0.0/ruby/backward -IC:/Ruby200-x64/include/ruby-2.0.0 -I. -I/usr/local/include -I/opt/local/include -I/usr/include -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -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 -Wall  -DHAVE_NO_DATETIME_NEWBANG  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 */

--------------------
have_头:检查sqlite3.h..------------不
“x86_64-w64-mingw32-gcc-o conftest.exe-IC:/Ruby200-x64/include/ruby-2.0.0/x64-mingw32-IC:/Ruby200-x64/include/ruby-2.0.0/ruby/backward-IC:/Ruby200-x64/include/ruby-2.0.0-I.-I/usr/local/include-I/opt/local/include-I/usr/include-I/usr/include-DFD\u SETSIZE=2048-D\u winno3\t=0x0501-D\u文件偏移量=64位\u-frame\n\n\n\n\n\n\n\nll-Wextra-Wno未使用参数-Wno括号-Wno long long-Wno缺少字段初始值设定项-Wunused变量-Wpointer arith-Wwrite strings-Wdeclaration after语句-Wimplicit函数声明-Wall-DHAVE_NO_DATETIME_NEWBANG conftest.c-L.-LC:/Ruby200-x64/lib-L/usr/local/-L/opt/local/-L/local/-L/usr/-L/usr/-L.-lx64-msvcrt-Ruby200-Lshell32-lws2_32-limagehlp-lshlwapi“
检查的程序是:
/*开始*/
1:#包括“ruby.h”
2: 
3:#包括
4:#包括
5:int main(int argc,字符**argv)
6: {
7:返回0;
8: }
/*结束*/
“x86_64-w64-mingw32-gcc-E-IC:/Ruby200-x64/include/ruby-2.0.0/x64-mingw32-IC:/Ruby200-x64/include/ruby-2.0.0/ruby/backward-IC:/Ruby200-x64/include/ruby-2.0.0-I.-I/usr/local/include-I/include-I/usr/include-I/include-I/usr/include-include-include-DFD\u SETSIZE=2048-D\u 32\u WINNT=0x0501-D\u-D\u文件偏移量=64位\u-winnometer=64-fno-fno-fno-W无未使用的参数-Wno括号-Wno long long-Wno缺少字段初始值设定项-Wunused变量-Wpointer arith-Wwrite strings-Wdeclaration after语句-Wimplicit函数声明-Wall-DHAVE_no_DATETIME_NEWBANG conftest.c-o conftest.i“
conftest.c:5:21:致命错误:sqlite3.h:没有这样的文件或目录
编译终止。
检查的程序是:
/*开始*/
1:#包括“ruby.h”
2: 
3:#包括
4:#包括
5:#包括
/*结束*/
--------------------
我尝试了很多不同的方法让它工作,我意识到这可能是一个愚蠢的问题。然而,在这一点上,我的想法。任何帮助都将不胜感激

系统信息:

  • Windows 7 64位
  • Ruby版本:2.0.0 p247 x64
  • 安装程序-标准Ruby Exe安装程序

我最终能够解决这个问题。对于那些在未来遇到这种情况的人,博斯科·伊万尼塞维奇(Bosko Ivanisevic)写了一本关于如何解决这一问题的优秀指南

请看这里:

这里有很多细节需要注意,所以一定要一步一步地阅读,并严格按照每件事进行。很好的解释

have_header: checking for sqlite3.h... -------------------- no

"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/Ruby200-x64/include/ruby-2.0.0/x64-mingw32 -IC:/Ruby200-x64/include/ruby-2.0.0/ruby/backward -IC:/Ruby200-x64/include/ruby-2.0.0 -I. -I/usr/local/include -I/opt/local/include -I/usr/include -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -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 -Wall  -DHAVE_NO_DATETIME_NEWBANG conftest.c  -L. -LC:/Ruby200-x64/lib -L/usr/local/ -L/opt/local/ -L/usr/ -L.      -lx64-msvcrt-ruby200  -lshell32 -lws2_32 -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 */

"x86_64-w64-mingw32-gcc -E -IC:/Ruby200-x64/include/ruby-2.0.0/x64-mingw32 -IC:/Ruby200-x64/include/ruby-2.0.0/ruby/backward -IC:/Ruby200-x64/include/ruby-2.0.0 -I. -I/usr/local/include -I/opt/local/include -I/usr/include -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -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 -Wall  -DHAVE_NO_DATETIME_NEWBANG  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 */

--------------------