0
votes

I am trying to set up a RoR development environment on my Windows 7 PC.

I have so far been able to:

  1. Install Ruby

  2. Install Rails

  3. Install a few gems, including the mysql2 gem (I had to download and install the MySQL community server again, since the one which came with XAMPP was 32 bit, and my Ruby is 64 bit)

  4. Execute the 'Rails New' command to create a project

  5. Run 'Bundler Install' command

Now however, when I try to run the server from the project root, I am getting a huge error message of more than 600 lines, beginning with:

C:\Users\Chinmay\Documents\Sites\TaxCloud>rails s C:/Ruby21-x64/lib/ruby/gems/2.1.0/extensions/x64-mingw32/2.1.0/mysql2-0.3.16/mysql2/mysql2.so: [BUG] Segmentation fault ruby 2.1.4p265 (2014-10-27 revision 48166) [x64-mingw32]

-- Control frame information ----------------------------------------------- c:0020 p:-10803034 s:0067 e:000066 TOP [FINISH] c:0019 p:---- s:0065 e:000064 CFUNC :require c:0018 p:0083 s:0061 e:000060 TOP
C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/mysql2-0.3.16/lib/mysql2.rb:8 [FINISH] c:0017 p:---- s:0059 e:000058 CFUNC :require c:0016 p:0037 s:0055 e:000054 BLOCK C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.7.4/lib/bundler/runtime.rb:76 [FINISH] c:0015 p:---- s:0052 e:000051 CFUNC :each c:0014 p:0055 s:0049 e:000048 BLOCK C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.7.4/lib/bundler/runtime.rb:72 [FINISH] c:0013 p:---- s:0042 e:000041 CFUNC :each c:0012 p:0030 s:0039 e:000038 METHOD C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.7.4/lib/bundler/runtime.rb:61 c:0011 p:0013 s:0035 e:000034 METHOD C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.7.4/lib/bundler.rb:133 c:0010 p:0047 s:0031 e:000030 TOP
C:/Users/Chinmay/Documents/Sites/TaxCloud/config/application.rb:7 [FINISH] c:0009 p:---- s:0029 e:000028 CFUNC :require c:0008 p:0014 s:0025 e:000024 BLOCK C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.1.7/lib/rails/commands/commands_tasks.rb :79 [FINISH] c:0007 p:---- s:0022 e:000021 CFUNC :tap c:0006 p:0031 s:0019 e:000018 METHOD C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.1.7/lib/rails/commands/commands_tasks.rb :76 c:0005 p:0033 s:0016 e:000015 METHOD C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.1.7/lib/rails/commands/commands_tasks.rb :40 c:0004 p:0116 s:0012 e:000011 TOP
C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.1.7/lib/rails/commands.rb:17 [FINISH] c:0003 p:---- s:0008 e:000007 CFUNC :require c:0002 p:0034 s:0004 E:000218 EVAL bin/rails:4 [FINISH] c:0001 p:0000 s:0002 E:000a78 TOP [FINISH]

-- Ruby level backtrace information ---------------------------------------- bin/rails:4:in <main>' bin/rails:4:inrequire' C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.1.7/lib/rails/commands.rb:17:in <top (required)>' C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.1.7/lib/rails/commands/commands_tasks.rb:40:in run_command!' C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.1.7/lib/rails/commands/commands_tasks.rb:76:in server' C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.1.7/lib/rails/commands/commands_tasks.rb:76:in tap' C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.1.7/lib/rails/commands/commands_tasks.rb:79:in block in server' C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.1.7/lib/rails/commands/commands_tasks.rb:79:in require' C:/Users/Chinmay/Documents/Sites/TaxCloud/config/application.rb:7:in <top (required)>' C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.7.4/lib/bundler.rb:133:in require' C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.7.4/lib/bundler/runtime.rb:61:in require' C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.7.4/lib/bundler/runtime.rb:61:in each' C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.7.4/lib/bundler/runtime.rb:72:in block in require' C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.7.4/lib/bundler/runtime.rb:72:in each' C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.7.4/lib/bundler/runtime.rb:76:in block (2 levels) in require' C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.7.4/lib/bundler/runtime.rb:76:in require' C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/mysql2-0.3.16/lib/mysql2.rb:8:in <top (required)>' C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/mysql2-0.3.16/lib/mysql2.rb:8:in require'

-- C level backtrace information ------------------------------------------- C:\Windows\SYSTEM32\ntdll.dll(ZwWaitForSingleObject+0xa) [0x0000000077B3F6FA] C:\Windows\system32\KERNELBASE.dll(WaitForSingleObjectEx+0x9c) [0x000007FEFE1810DC] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_vm_bugreport+0xa4) [0x000000006B417364] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_name_err_mesg_new+0x841) [0x000000006B2C9801] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_bug+0x45) [0x000000006B2CA545] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_check_safe_str+0x351) [0x000000006B398E11] [0x0000000000401A85] C:\Windows\SYSTEM32\ntdll.dll(_C_specific_handler+0x9c) [0x0000000077B04F58] C:\Windows\SYSTEM32\ntdll.dll(RtlCompareUnicodeString+0x7d) [0x0000000077B24F4D] C:\Windows\SYSTEM32\ntdll.dll(RtlTimeToSecondsSince1970+0x63c) [0x0000000077B05B3C] C:\Windows\SYSTEM32\ntdll.dll(KiUserExceptionDispatcher+0x2e) [0x0000000077B3F638] [0x000003B7A8300000] [0x000000000202343D] C:\Ruby21-x64\lib\ruby\gems\2.1.0\extensions\x64-mingw32\2.1.0\mysql2-0.3.16\mysql2\mysql2.so(Init_mysql2+0x5a) [0x000000000202 43BA] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(dln_load+0x1d6) [0x000000006B281646] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_vm_call_cfunc+0x130) [0x000000006B414300] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_require_safe+0x56f) [0x000000006B2D558F] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_error_arity+0x1c6) [0x000000006B402206] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_f_send+0x5c1) [0x000000006B411601] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_vm_localjump_error+0x1618) [0x000000006B406C98] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_vm_localjump_error+0x5a8d) [0x000000006B40B10D] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_iseq_eval+0x183) [0x000000006B413C23] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_rubylevel_errinfo+0x66c) [0x000000006B2D396C] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_require_safe+0x5a9) [0x000000006B2D55C9] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_error_arity+0x1c6) [0x000000006B402206] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_vm_localjump_error+0x1618) [0x000000006B406C98] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_vm_localjump_error+0x5a8d) [0x000000006B40B10D] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_funcall+0x503) [0x000000006B40C503] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_yield+0x74) [0x000000006B4134D4] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_ary_each+0x51) [0x000000006B281971] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_error_arity+0x1c6) [0x000000006B402206] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_vm_localjump_error+0x1f61) [0x000000006B4075E1] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_vm_localjump_error+0x5a8d) [0x000000006B40B10D] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_funcall+0x503) [0x000000006B40C503] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_yield+0x74) [0x000000006B4134D4] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_ary_each+0x51) [0x000000006B281971] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_error_arity+0x1c6) [0x000000006B402206] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_f_send+0x5c1) [0x000000006B411601] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_vm_localjump_error+0x1f61) [0x000000006B4075E1] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_vm_localjump_error+0x5a8d) [0x000000006B40B10D] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_iseq_eval+0x183) [0x000000006B413C23] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_rubylevel_errinfo+0x66c) [0x000000006B2D396C] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_require_safe+0x5a9) [0x000000006B2D55C9] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_error_arity+0x1c6) [0x000000006B402206] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_f_send+0x5c1) [0x000000006B411601] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_vm_localjump_error+0x1618) [0x000000006B406C98] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_vm_localjump_error+0x5a8d) [0x000000006B40B10D] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_funcall+0x503) [0x000000006B40C503] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_yield+0x74) [0x000000006B4134D4] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_obj_tap+0x16) [0x000000006B32D5C6] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_error_arity+0x1c6) [0x000000006B402206] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_f_send+0x5c1) [0x000000006B411601] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_vm_localjump_error+0x1f61) [0x000000006B4075E1] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_vm_localjump_error+0x5a8d) [0x000000006B40B10D] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_iseq_eval+0x183) [0x000000006B413C23] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_rubylevel_errinfo+0x66c) [0x000000006B2D396C] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_require_safe+0x5a9) [0x000000006B2D55C9] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_error_arity+0x1c6) [0x000000006B402206] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_f_send+0x5c1) [0x000000006B411601] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_vm_localjump_error+0x1618) [0x000000006B406C98] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_vm_localjump_error+0x5a8d) [0x000000006B40B10D] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_iseq_eval_main+0x1d0) [0x000000006B413E40] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(rb_check_copyable+0x304a) [0x000000006B2CF31A] C:\Ruby21-x64\bin\x64-msvcrt-ruby210.dll(ruby_run_node+0x51) [0x000000006B2D2231] [0x0000000000402D14] [0x00000000004013D7] [0x00000000004014F8] C:\Windows\system32\kernel32.dll(BaseThreadInitThunk+0xd) [0x000000007763F34D]

-- Other runtime information -----------------------------------------------

  • Loaded script: bin/rails

  • Loaded features:

    0 enumerator.so 1 C:/Ruby21-x64/lib/ruby/2.1.0/x64-mingw32/enc/encdb.so 2 C:/Ruby21-x64/lib/ruby/2.1.0/x64-mingw32/enc/iso_8859_1.so 3 C:/Ruby21-x64/lib/ruby/2.1.0/x64-mingw32/enc/trans/transdb.so 4 C:/Ruby21-x64/lib/ruby/2.1.0/x64-mingw32/rbconfig.rb 5 thread.rb 6 C:/Ruby21-x64/lib/ruby/2.1.0/x64-mingw32/thread.so 7 C:/Ruby21-x64/lib/ruby/site_ruby/2.1.0/rubygems/compatibility.rb 8 C:/Ruby21-x64/lib/ruby/site_ruby/2.1.0/rubygems/defaults.rb 9 C:/Ruby21-x64/lib/ruby/site_ruby/2.1.0/rubygems/deprecate.rb

And ending with:

580 C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/activesupport-4.1.7/lib/active_support/number_helper.rb 581 C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/actionview-4.1.7/lib/action_view/helpers/number_helper.rb 582 C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/activesupport-4.1.7/lib/active_support/core_ext/module/concerning.rb 583 C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/activesupport-4.1.7/lib/active_support/core_ext/module/qualified_const.rb 584 C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/activesupport-4.1.7/lib/active_support/core_ext/module.rb 585 C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/actionview-4.1.7/lib/action_view/record_identifier.rb 586 C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/actionview-4.1.7/lib/action_view/helpers/record_tag_helper.rb 587 C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/actionview-4.1.7/lib/action_view/helpers/rendering_helper.rb 588 C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/actionview-4.1.7/lib/action_view/helpers/translation_helper.rb 589 C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/actionview-4.1.7/lib/action_view/helpers.rb 590 C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sprockets-rails-2.2.0/lib/sprockets/rails/helper.rb 591 C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sprockets-rails-2.2.0/lib/sprockets/rails/version.rb 592 C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.1.7/lib/rails/engine/configuration.rb 593 C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.1.7/lib/rails/application/configuration.rb 594 C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sprockets-rails-2.2.0/lib/sprockets/railtie.rb 595 C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.1.7/lib/rails/all.rb 596 C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/mysql2-0.3.16/lib/mysql2/version.rb 597 C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/mysql2-0.3.16/lib/mysql2/error.rb

[NOTE] You may have encountered a bug in the Ruby interpreter or extension libraries. Bug reports are welcome. For details: http://www.ruby-lang.org/bugreport.html

This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information.

[NOTE] You may have encountered a bug in the Ruby Interpreter or extension libraries. Bug reports and welcome. For details: http://www.ruby-lang.org/bugreport.html

This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information.

So, what do I need to do, to ride ruby on rails?

BTW: Initially I thought the problem could have been with the Webrick Server. So I have configured apache manually to listen to port 3000. However, this hasn't helped.

Another concern is that I can neither see the full output in the command prompt, nor can I save it to a text file. So I do not really know what the full error message is.

1
Just an advice , use any other linux distro to learn rails ...will make your life much easier . - Caffeine Coder
Thanks for the tip, but my production server will need to be a windows machine, because my application has to interact with Adobe Acrobat, which cannot be installed on Linux. - Chinmay Kamat
This should do good for you in windows - railsinstaller.org/en - Caffeine Coder
Also could you post the first 40-50 lines of the error , as that's where the main log is and not at the end . - Caffeine Coder
Thanks again, but it has the older rails version bundled. I'd prefer to learn on the latest. - Chinmay Kamat

1 Answers

0
votes

Webrick uses port 3000. Don't set Apache to listen to port 3000 because that will create a port conflict. Start webrick from the command line with 'rails s'.