我是ROR的新手,我正在尝试在本地服务器上运行现有的rails应用程序。但是当我尝试迁移数据库时,它以某种方式失败。请参阅下面的完整轨迹
耙子中止了! LoadError:无法加载此类文件-eventmachine 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/activesupport-5.0.7/lib/active_support/dependencies.rb:293:in
封锁要求” C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/activesupport-5.0.7/lib/active_support/dependencies.rb:259:inload_dependency' 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/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:in
require' C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.16.4/lib/bundler/runtime.rb:81:inblock (2 levels) in require' C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.16.4/lib/bundler/runtime.rb:76:in
each' C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.16.4/lib/bundler/runtime.rb:76:inblock in require' C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.16.4/lib/bundler/runtime.rb:65:in
each' C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.16.4/lib/bundler/runtime.rb:65:inrequire' C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.16.4/lib/bundler.rb:114:in
require' C:/promotracks-rails/config/application.rb:7:<top (required)>' C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in
中的'require' C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:在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:inload' C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.3.1/lib/rake/rake_module.rb:29:in
load_rakefile' C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.3.1/lib/rake/application.rb:703:在load_rakefile的raw_load_rakefile' C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.3.1/lib/rake/application.rb:104:in
块中 C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.3.1/lib/rake/application.rb:186:在standard_exception_handling' C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.3.1/lib/rake/application.rb:103:in
load_rakefile'中 C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.3.1/lib/rake/application.rb:82:inblock in run' 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:80:inrun' C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.3.1/exe/rake:27:in
' C:/ Ruby24-x64 / bin / rake:23:在load' C:/Ruby24-x64/bin/rake:23:in
'中
(我已经安装了红宝石,导轨,宝石和捆绑器)
答案 0 :(得分:0)
Gist of it Rails应用程序与Windows环境不兼容,因此只需切换到Mac或Linux。
答案 1 :(得分:0)
根据帖子中共享的日志:
尽管eventmachine是作为x64-mingw平台gem提供的,但它不支持ruby-2.4或2.5以前的版本,现在已修复。因此,建议您执行以下操作:
首先,(在Windows + Ruby 2.4上)确保删除所有版本的事件机,例如
gem uninstall eventmachine
然后使用下面提到的命令重新安装:
gem install eventmachine --platform ruby