在Windows上为现有ROR应用程序设置本地服务器的指导

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了在Windows上为现有ROR应用程序设置本地服务器的指导相关的知识,希望对你有一定的参考价值。

我是ROR的新手,我正在尝试在本地服务器上运行现有的rails应用程序。但是当我尝试迁移数据库时,它以某种方式失败了。请参阅下面的完整描述

耙子流产了! LoadError:无法加载此类文件 - eventmachine C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/activesupport-5.0.7/lib/active_support/dependencies.rb:293:在require' C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/activesupport-5.0.7/lib/active_support/dependencies.rb:293:inblock中的require'C :/Ruby24-x64/lib/ruby/gems/2.4.0/gems/activesupport-5.0.7/lib/active_support/dependencies.rb:259:在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:在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:在<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:inrequire' 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/ applicati on.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:inblock'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: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:in load' C:/Ruby24-x64/bin/rake:23:in'

(我安装了ruby,rails,gem和bundler)

答案

它的主旨Rails应用程序与Windows环境不兼容所以只需切换到mac或linux。

另一答案

根据帖子中分享的日志:

尽管eventmachine是作为x64-mingw平台gem提供的,但它不支持早期修复的ruby-2.4或2.5。所以会建议你做以下事情:

首先,(在Windows + Ruby 2.4上)确保删除所有版本的eventmachine,例如

gem uninstall eventmachine

然后使用下面提到的命令重新安装:

gem install eventmachine --platform ruby

以上是关于在Windows上为现有ROR应用程序设置本地服务器的指导的主要内容,如果未能解决你的问题,请参考以下文章

如何在我的本地网络上为 IoT 运行 Prometheus?

在桌面上为 Windows 10 UWP 应用设置窗口大小

在 Windows 上为 localhost 创建自签名证书

如何在Windows上为Google云平台添加docker-registry secret(就是在PowerShell中,不是Bash)?

使用 ngrok 在 Windows PC 上为 Slack 本地开发时无法运行 sudo

在 Windows 10 上为 http 链接启动应用程序是不是需要服务器端更改?