0

I am about to learn more about Rails "way" of developing web applications (i have asp.net background). I want to create a simple application with Rails as mainframe, MongoDB as db and angularJS as front-end. But right now i am having huge problems to get rails working with MongoDB. I added folowing into my gemfile :

gem 'rails', '4.1.1'
gem 'mongoid', github: 'mongoid/mongoid'

but when i run bundle update og bundle install i am getting folowing error:

>     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.

As i can see there are multiple problems with maeking mongoDB to work with Rails 4, does anyone have an idea what i am doing wrong? Or maybe i should switch to some other noSQL db?

1

1 Answer 1

1

I checked Mongid at Ready For Rails 4, and got this:

Version 4 will support Rails 4 but it hasn't been released yet

There is only 4.0.0.rc2,4.0.0.rc1,4.0.0.beta,4.0.0.alpha

Sign up to request clarification or add additional context in comments.

1 Comment

You can try forcing 4.0.0.rc2 in gemfile.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.