Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/68.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/24.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 让mongoDB使用Rails 4.1.1_Ruby On Rails_Ruby_Mongodb - Fatal编程技术网

Ruby on rails 让mongoDB使用Rails 4.1.1

Ruby on rails 让mongoDB使用Rails 4.1.1,ruby-on-rails,ruby,mongodb,Ruby On Rails,Ruby,Mongodb,我将进一步了解Rails开发web应用程序的“方式”(我有asp.net背景)。我想创建一个简单的应用程序,Rails作为大型机,MongoDB作为db,angularJS作为前端。但是现在我在让rails与MongoDB合作方面遇到了巨大的问题。我在我的文件中添加了以下内容: gem 'rails', '4.1.1' gem 'mongoid', github: 'mongoid/mongoid' 但是当我运行bundle updateogbundle install时,我得到以下错误: &

我将进一步了解Rails开发web应用程序的“方式”(我有asp.net背景)。我想创建一个简单的应用程序,Rails作为大型机,MongoDB作为db,angularJS作为前端。但是现在我在让rails与MongoDB合作方面遇到了巨大的问题。我在我的文件中添加了以下内容:

gem 'rails', '4.1.1'
gem 'mongoid', github: 'mongoid/mongoid'
但是当我运行
bundle update
og
bundle install
时,我得到以下错误:

>     Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
> 
>     C:/Ruby200/bin/ruby.exe extconf.rb creating Makefile
> 
> make "DESTDIR=" clean
> 
> make "DESTDIR=" generating native-i386-mingw32.def compiling native.c
> In file included from c:/Ruby200/include/ruby-2.0.0/ruby.h:33:0,
>                  from native.c:26: c:/Ruby200/include/ruby-2.0.0/ruby/ruby.h:125:14: error: size of array
> 'ruby_che ck_sizeof_voidp' is negative In file included from
> c:/Ruby200/include/ruby-2.0.0/ruby.h:33:0,
>                  from native.c:26: c:/Ruby200/include/ruby-2.0.0/ruby/ruby.h: In function
> 'rb_float_value': c:/Ruby200/include/ruby-2.0.0/ruby/ruby.h:826:13:
> warning: cast to pointer from integer of different size
> [-Wint-to-pointer-cast] c:/Ruby200/include/ruby-2.0.0/ruby/ruby.h: In
> function 'rb_num2char_inline':
> c:/Ruby200/include/ruby-2.0.0/ruby/ruby.h:1214:35: warning: cast to
> pointer from  integer of different size [-Wint-to-pointer-cast]
> c:/Ruby200/include/ruby-2.0.0/ruby/ruby.h:1214:35: warning: cast to
> pointer from  integer of different size [-Wint-to-pointer-cast]
> c:/Ruby200/include/ruby-2.0.0/ruby/ruby.h:1214:35: warning: cast to
> pointer from  integer of different size [-Wint-to-pointer-cast]
> c:/Ruby200/include/ruby-2.0.0/ruby/ruby.h:1215:9: warning: cast to
> pointer from integer of different size [-Wint-to-pointer-cast]
> c:/Ruby200/include/ruby-2.0.0/ruby/ruby.h:1215:9: warning: cast to
> pointer from integer of different size [-Wint-to-pointer-cast]
> c:/Ruby200/include/ruby-2.0.0/ruby/ruby.h:1215:9: warning: cast to
> pointer from integer of different size [-Wint-to-pointer-cast]
> c:/Ruby200/include/ruby-2.0.0/ruby/ruby.h: In function 'rb_class_of':
> c:/Ruby200/include/ruby-2.0.0/ruby/ruby.h:1515:12: warning: cast to
> pointer from  integer of different size [-Wint-to-pointer-cast]
> c:/Ruby200/include/ruby-2.0.0/ruby/ruby.h: In function 'rb_type':
> c:/Ruby200/include/ruby-2.0.0/ruby/ruby.h:1532:12: warning: cast to
> pointer from  integer of different size [-Wint-to-pointer-cast]
> native.c: In function 'rb_float_from_bson_double': native.c:213:11:
> warning: cast to pointer from integer of different size [-Wint-
> to-pointer-cast] native.c:213:11: warning: cast to pointer from
> integer of different size [-Wint- to-pointer-cast] native.c:213:11:
> warning: cast to pointer from integer of different size [-Wint-
> to-pointer-cast] native.c:214:21: warning: cast to pointer from
> integer of different size [-Wint- to-pointer-cast] native.c:214:21:
> warning: cast to pointer from integer of different size [-Wint-
> to-pointer-cast] native.c:214:21: warning: cast to pointer from
> integer of different size [-Wint- to-pointer-cast] native.c: In
> function 'rb_integer_from_bson_int32': native.c:358:39: warning: cast
> to pointer from integer of different size [-Wint- to-pointer-cast]
> native.c:358:39: warning: cast to pointer from integer of different
> size [-Wint- to-pointer-cast] native.c:358:39: warning: cast to
> pointer from integer of different size [-Wint- to-pointer-cast]
> native.c: In function 'rb_bson_to_int64_t': native.c:381:18: warning:
> cast to pointer from integer of different size [-Wint-
> to-pointer-cast] native.c:381:18: warning: cast to pointer from
> integer of different size [-Wint- to-pointer-cast] native.c:381:18:
> warning: cast to pointer from integer of different size [-Wint-
> to-pointer-cast] native.c: In function 'rb_string_set_int32':
> native.c:529:34: warning: cast to pointer from integer of different
> size [-Wint- to-pointer-cast] native.c:529:34: warning: cast to
> pointer from integer of different size [-Wint- to-pointer-cast]
> native.c:529:34: warning: cast to pointer from integer of different
> size [-Wint- to-pointer-cast] native.c:532:10: warning: cast to
> pointer from integer of different size [-Wint- to-pointer-cast]
> native.c:532:10: warning: cast to pointer from integer of different
> size [-Wint- to-pointer-cast] native.c:532:10: warning: cast to
> pointer from integer of different size [-Wint- to-pointer-cast]
> native.c: In function 'rb_string_check_for_illegal_characters':
> native.c:548:14: warning: cast to pointer from integer of different
> size [-Wint- to-pointer-cast] native.c:548:14: warning: cast to
> pointer from integer of different size [-Wint- to-pointer-cast]
> native.c:548:14: warning: cast to pointer from integer of different
> size [-Wint- to-pointer-cast] native.c:548:45: warning: cast to
> pointer from integer of different size [-Wint- to-pointer-cast]
> native.c:548:45: warning: cast to pointer from integer of different
> size [-Wint- to-pointer-cast] native.c:548:45: warning: cast to
> pointer from integer of different size [-Wint- to-pointer-cast] make:
> *** [native.o] Error 1
> 
> make failed, exit code 2
> 
> Gem files will remain installed in
> C:/Ruby200/lib/ruby/gems/2.0.0/gems/bson-2.3. 0 for inspection.
> Results logged to
> C:/Ruby200/lib/ruby/gems/2.0.0/extensions/x86-mingw32/2.0.0/bs
> on-2.3.0/gem_make.out An error occurred while installing bson (2.3.0),
> and Bundler cannot continue. Make sure that `gem install bson -v
> '2.3.0'` succeeds before bundling.
正如我所看到的,maeking mongoDB在使用Rails 4时存在多个问题,有人知道我做错了什么吗?或者我应该切换到其他noSQL数据库

我在上查看了Mongid,得到了以下信息:

版本4将支持Rails4,但尚未发布


只有
4.0.0.rc2,4.0.0.rc1,4.0.0.beta,4.0.0.alpha

看看这个,可以帮助您在Windows上安装
mongoid
。您可以尝试在文件中强制执行
4.0.0.rc2