- xml - AJAX/Jquery XML 解析
- 具有多重继承的 XML 模式
- .net - 枚举序列化 Json 与 XML
- XML 简单类型、简单内容、复杂类型、复杂内容
此错误消息是众所周知的错误消息。 (例如,参见 https://bundler.io/blog/2019/01/04/an-update-on-the-bundler-2-release.html。)虽然我是通过一个新的 Elastic Beanstalk 应用程序获得它的,该应用程序具有 Ruby 2.6.1 和 bundler 2.0.1。错误是:
/opt/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems.rb:289:in `find_spec_for_exe': can't find gem bundler (>= 0.a) with executable bundle (Gem::GemNotFoundException)
from /opt/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems.rb:308:in `activate_bin_path'
from /opt/rubies/ruby-2.6.1/bin/bundle:23:in `<main>' (ElasticBeanstalk::ExternalInvocationError)
我尝试将以下文件:01_install_bundler.config
放入 .ebextensions
文件夹中:
container_commands:
01_install_bundler:
command: "gem install bundler —-version 2.0.1"
虽然这永远不会运行,因为如果我查看上面的错误,我可以看到它是在部署过程的这一点发生的:
.../AppDeployStage0/AppDeployPreHook/10_bundle_install.sh] : Activity failed.
(即在 AppDeployPreHook 脚本的 bundle install
命令期间)。参见 https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/custom-platform-hooks.html供 PlatformHooks 引用。
我很确定,如果我能确保使用的 bundler 版本至少是 2.0.0 版本,那么就不会有问题。虽然我不知道如何轻松指定。目前,我正在通过 SSH 连接到服务器以 /opt/elasticbeanstalk/hooks/appdeploy/pre/
编辑和摆弄脚本。尽管我显然需要一种自动化的、可重复的方式来完成它。
令人沮丧的是,ruby 2.6.1 没有默认选择 bundler 版本 2.0.0。有什么想法吗?
==============================
更新:
如果我编辑文件 /opt/elasticbeanstalk/hooks/appdeploy/pre/10_bundle_install.sh
if [ -f Gemfile ]; then
echo "running 'bundle install' with Gemfile:"
cat Gemfile
+++ gem install bundler +++
if [ -d $EB_APP_STAGING_DIR/vendor/cache ]; then
bundle install --local
else
bundle install
fi
else
echo "no Gemfile found! Skipping bundle install stage!"
fi
并添加 gem install bundler
(没有加号),这就解决了问题,因为它安装了最新的 bundler ,即 2.0.1。对于那些想了解黑客的人,命令是:
eb ssh
sudo -i
cd/opt/elasticbeanstalk/hooks/appdeploy/pre
vim 10_bundle_install.sh
这个解决方案的问题在于它感觉有点像 hack,因为它不使用 .ebextensions
。有没有更合适的方法来解决这个问题?
最佳答案
下面是上述问题的编程解决方案。在 .ebextensions/gem_install_bundler.config
下创建以下文件:
files:
# Runs before `./10_bundle_install.sh`:
"/opt/elasticbeanstalk/hooks/appdeploy/pre/09_gem_install_bundler.sh" :
mode: "000775"
owner: root
group: users
content: |
#!/usr/bin/env bash
EB_APP_STAGING_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k app_staging_dir)
EB_SCRIPT_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k script_dir)
# Source the application's ruby, i.e. 2.6. Otherwise it will be 2.3, which will give this error: `bundler requires Ruby version >= 2.3.0`
. $EB_SCRIPT_DIR/use-app-ruby.sh
cd $EB_APP_STAGING_DIR
echo "Installing compatible bundler"
gem install bundler -v 2.0.1
那么当你下一次eb deploy
时,bundler已经更新到2.0.1版本了,你就不会再出现上面的错误了。
此处文档中的更多信息:
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/custom-platform-hooks.html
这里:
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html#linux-files
最后一点:确保您在运行 eb deploy
之前提交这些更改,或者暂存它们并运行 eb deploy --staged
。请参阅:https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb3-cli-git.html .我通过艰难的方式学到了这一点!
关于ruby-on-rails - Elastic Beanstalk:找不到带有可执行包的 gem bundler (>= 0.a) (Gem::GemNotFoundException),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55360450/
所以问题是:如何使用标准 C 库以跨平台方式实现简单的自检可执行文件? 在这里,我正在寻找技术,而不是特定的检查方法(如 CRC 或哈希码),但该技术可能包含更适合某些方法的元素(例如见下文)。 目的
我想构建一个 C++ 可执行文件,以便所有库也附加到可执行文件。构建这样一个可执行文件的方法是什么?因此,每当我在其他 PC(运行 Ubuntu)上使用 g++ 编译我的代码时,它不需要运行该可执行文
我在 Netbeans IDE 8.0.1 中编写了一个名为 SampleChat 的 Java GUI 程序,并使用“clean and build”功能创建了一个 jar 文件。 我进入 Netb
我有两个 DLL,一个用 native C++ 编写,另一个用 C++/CLI 编写。前者被注入(inject)到进程中,并在稍后的时间点加载后者。在调试时,我注意到 native DLL 的断点运行
如何访问可执行文件的机器代码(二进制文件)? 详情 我使用的是 Ubuntu (Linux) 我想访问 .exe 文件(文件遵循 PE 格式)的机器代码(二进制文件) 我正在使用 C 来实现 最佳答案
这个问题在这里已经有了答案: Run java jar file on a server as background process (4 个回答) 关闭1年前. 我正在使用命令提示符运行一个可执行
我的 jar 没有运行,我可以告诉它尝试运行,因为 log4j 文件设法创建日志文件夹,但没有任何 react 并且日志为空白。 我的问题是我在名为 bin 的文件夹中有 jar 文件,在名为 lib
我正在为我教育第一学期的编程考试创建一个程序。它应该向用户显示哥本哈根和其他 6 个城市(在其他时区)的时间。用户还应该能够将城市添加到列表中。我正在用 JAVA 编写程序(下面提供源代码)。当我从
我正在查看雅虎的 YUI 压缩器可执行 jar,他们有这个类,从 list 文件链接为“主类”: package com.yahoo.platform.yui.compressor; import j
问题是:从 Eclipse 导出时可执行 jar 中包含什么?我问这个问题是因为我想知道,例如,如果我在项目根目录中有一个图像,该图像是否会包含在导出中? 澄清:我说的是可运行的 jar 文件(已编辑
我知道这个问题已经被问了很多,并且我已经尝试了 eclipse(Kepler、Ganymede、Galileo)、fatJar、netbeans、blueJ、命令行和手册中的大约 20-30 种不同的
我从 IntelliJ 14.03 中的一个工件构建了一个 .jar。当我尝试在 JRE 中打开它时,没有任何反应。这只是一个简单的 GUI。 提前致谢。 最佳答案 在jar位置运行命令,例如 jav
我使用 eclipse 创建了一个可执行 JAR 文件。我在项目文件夹中有资源当框架打开时不会出现。我的意思是当我双击 JAR 文件时。更多的所以,在我尝试删除 JAR 文件后,我收到一条警告,表明该
我创建了一个尺寸相当大(125,000 kb)的可运行 Jar 文件。当我运行它时,该 jar 文件内的应用程序不会显示,但在任务管理器中 javaw.exe(应链接到该 jar 文件)进程正在运行。
我已经使用 Eclipse(文件->导出)为我的 java 程序创建了一个可执行 jar 文件。 当我双击 jar 时,它工作正常。将 jar 文件复制到另一台计算机(Windows)后,我收到错误“
我用 eclipse indigo 创建了一个可执行的 jar 文件,但是当我双击它时什么也没有发生。但是当我将 java -jar c:/dir/filename.jar 写入 cmd 时,它可以工
已关闭。这个问题是 off-topic 。目前不接受答案。 想要改进这个问题吗? Update the question所以它是on-topic用于堆栈溢出。 已关闭10 年前。 Improve th
如何让该 Java 代码在 Eclipse 之外运行? import java.util.*; public class Calculations { public static void main(
今天我第一次启动 jar 文件时遇到问题。现在我知道(解压 jar 后)当我在 Eclipse 中导出并创建程序的 jar 包时,文本文件并没有出现。 为什么文本文件没有与类文件一起出现?我应该将它们
我不知道为什么,但是当我将项目导出到可执行 jar 文件时,有些东西并不像从 eclipse 运行程序一样。一帧不会打开,其中只包含文本。我有另一个内部框架,它是一个分割 Pane ,包含右侧面板上的
我是一名优秀的程序员,十分优秀!