0
votes

I am new to ROR and I'm trying to run the existing rails app on local server. But somehow it fails when I'm trying to migrate the db. See the full trace below

rake aborted! LoadError: cannot load such file -- eventmachine C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/activesupport-5.0.7/lib/active_support/dependencies.rb:293:in require' C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/activesupport-5.0.7/lib/active_support/dependencies.rb:293:inblock in require' C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/activesupport-5.0.7/lib/active_support/dependencies.rb:259:in load_dependency' C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/activesupport-5.0.7/lib/active_support/dependencies.rb:293:inrequire' C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/thin-1.7.2/lib/thin.rb:7:in <top (required)>' C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.16.4/lib/bundler/runtime.rb:81:inrequire' C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.16.4/lib/bundler/runtime.rb:81:in block (2 levels) in require' C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.16.4/lib/bundler/runtime.rb:76:ineach' C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.16.4/lib/bundler/runtime.rb:76:in block in require' C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.16.4/lib/bundler/runtime.rb:65:ineach' C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.16.4/lib/bundler/runtime.rb:65:in require' C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.16.4/lib/bundler.rb:114:inrequire' C:/promotracks-rails/config/application.rb:7:in <top (required)>' C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:inrequire' C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in require' C:/promotracks-rails/Rakefile:4:in' C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.3.1/lib/rake/rake_module.rb:29:in load' C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.3.1/lib/rake/rake_module.rb:29:inload_rakefile' C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.3.1/lib/rake/application.rb:703:in raw_load_rakefile' C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.3.1/lib/rake/application.rb:104:inblock in load_rakefile' C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.3.1/lib/rake/application.rb:186:in standard_exception_handling' C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.3.1/lib/rake/application.rb:103:inload_rakefile' C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.3.1/lib/rake/application.rb:82:in block in run' C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.3.1/lib/rake/application.rb:186:instandard_exception_handling' C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.3.1/lib/rake/application.rb:80:in run' C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.3.1/exe/rake:27:in' C:/Ruby24-x64/bin/rake:23:in load' C:/Ruby24-x64/bin/rake:23:in'

(I have ruby, rails, gem and bundler installed)

2
Have you got eventmachine in your Gemfile? - The Wizard
No, I don't see it in my gemfile - Mandy Saini
add gem "eventmachine" to your Gemfile and run bundle install. - The Wizard
Did that but now when i try to rake db:migrate it throws this error LoadError: cannot load such file -- 2.4/rubyeventmachine C:/promotracks-rails/config/application.rb:7:in <top (required)>' C:/promotracks-rails/Rakefile:4:in <top (required)>' (See full trace by running task with --trace) - Mandy Saini
Can you try running it as gem install eventmachine --platform ruby - Kedarnag Mukanahallipatna

2 Answers

0
votes

Gist of it Rails app are not compatible with windows environment so just switch to mac or linux.

0
votes

As per the logs shared in the post:

Although eventmachine is provided as x64-mingw platform gem, it doesn't support ruby-2.4 or 2.5 earlier which is fixed now . So would recommend you to do the following:

Firstly, (on Windows + Ruby 2.4) to make sure you remove all versions of eventmachine e.g.

gem uninstall eventmachine

Then reinstall using the below mentioned command:

gem install eventmachine --platform ruby