Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/59.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 为什么我的Rails应用程序无法部署到AWS Elastic Beanstalk?_Ruby On Rails_Ruby_Amazon Web Services_Amazon Elastic Beanstalk - Fatal编程技术网

Ruby on rails 为什么我的Rails应用程序无法部署到AWS Elastic Beanstalk?

Ruby on rails 为什么我的Rails应用程序无法部署到AWS Elastic Beanstalk?,ruby-on-rails,ruby,amazon-web-services,amazon-elastic-beanstalk,Ruby On Rails,Ruby,Amazon Web Services,Amazon Elastic Beanstalk,当我将我的应用程序部署到他们的服务时,AWS Elastic Beanstalk从不接受我的应用程序。我试图通过阅读日志来解决所有问题,但似乎没有任何效果。我的开发IDE是Rubymine/ruby 2.4.5/Rails 5.2.0/Windows 10 Pro x64/Bundler verion 1.16.4。我收到的错误如下。如何将我的应用程序成功部署到AWS Elastic Beanstalk?? 在开发过程中,无论怎样,我都不会对启动应用程序产生任何问题。我尝试以尽可能少的依赖项启动

当我将我的应用程序部署到他们的服务时,AWS Elastic Beanstalk从不接受我的应用程序。我试图通过阅读日志来解决所有问题,但似乎没有任何效果。我的开发IDE是Rubymine/ruby 2.4.5/Rails 5.2.0/Windows 10 Pro x64/Bundler verion 1.16.4。我收到的错误如下。如何将我的应用程序成功部署到AWS Elastic Beanstalk?? 在开发过程中,无论怎样,我都不会对启动应用程序产生任何问题。我尝试以尽可能少的依赖项启动应用程序。我清除了资产缓存。我删除了不必要的文件。似乎没有什么能满足弹性豆茎的需求。这是我第一次使用这项服务

注意:我正在为这个特定的应用程序使用actioncable

database.yml

错误日志:

您的Gemfile.lock是在Windows x64-mingw32平台上生成的,包含与Linux不兼容的gems版本。但是Amazon只支持ruby或x86_64-linux平台

Your bundle only supports platforms ["x64-mingw32"] but your local platforms are
["ruby", "x86_64-linux"], and there's no compatible match between those two lists.
这基本上意味着您根本无法在Linux机器或Mac上使用当前的Gemfile.lock。您需要在该OSs上运行bundle update而不是bundle install,以便bundler找到一组新的匹配的gem版本

当然,这有点冒险,因为这样您可能会在生产系统上运行其他gem版本,而不是在开发环境中运行,因此我建议在部署时实际切换到新版本之前再次运行测试


当您计划定期使用RubyonRails应用程序时,我建议您将Linux作为本地开发环境。虚拟机中的Linux或通过docker映像可能是您的另一种选择。

虽然您可能应该使用某种虚拟机为生产环境开发ruby/rails,但现在请尝试在您的文件中更改此选项:

group :development do
  gem 'byebug'
  gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby]
  gem 'web-console', '>= 3.3.0'
  gem 'rubocop', require: false
end
您可以删除此项以测试部署:

platform :mswin, :mingw, :x64_mingw do
  gem 'tzinfo-data'
  gem 'byebug', platforms: %i[mri mingw x64_mingw], group: :development
end
您在开发中也应该只需要rubocop,所以也可以将其移动到开发块中

然后跑

bundle install

然后再试试你的部署

我完全同意。我不知道任何人怎么能从Windows开发rails应用程序——一想到它就让我头疼。我将使用我的Ubuntu实例创建一个模拟rails 5.2.0应用程序。拉出默认值并将它们放在gemfile中…重新初始化gems并将它们全部配置为Linux。谢谢
Your bundle only supports platforms ["x64-mingw32"] but your local platforms are
["ruby", "x86_64-linux"], and there's no compatible match between those two lists.
group :development do
  gem 'byebug'
  gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby]
  gem 'web-console', '>= 3.3.0'
  gem 'rubocop', require: false
end
platform :mswin, :mingw, :x64_mingw do
  gem 'tzinfo-data'
  gem 'byebug', platforms: %i[mri mingw x64_mingw], group: :development
end
bundle install