Teamcity:抱歉,当 运行ning "bundle install" 时,您必须有 运行 sudo 的 tty
Teamcity: sorry, you must have a tty to run sudo when running "bundle install"
背景
我正在尝试 运行 centos 上的黄瓜场景(通过 teamcity)。构建配置的第一步是:
bundle install
但是,这只会给我以下错误:
[12:39:52][Step 1/4] Starting: /home/pgscutv/TeamCity-9.1.7/buildAgent/temp/agentTmp/custom_script4075833203409573811
[12:39:52][Step 1/4] in directory: /home/pgscutv/TeamCity-9.1.7/buildAgent/work/37e3a4176e075735
[12:40:00][Step 1/4] Fetching gem metadata from https://rubygems.org/
[12:40:06][Step 1/4] Fetching version metadata from https://rubygems.org/
[12:40:09][Step 1/4] Fetching dependency metadata from https://rubygems.org/
[12:40:11][Step 1/4] Rubygems 1.3.7 is not threadsafe, so your gems will be installed one at a time. Upgrade to Rubygems 2.1.0 or higher to enable parallel gem installation.
[12:40:12][Step 1/4]
[12:40:12][Step 1/4] sudo: sorry, you must have a tty to run sudo
[12:40:12][Step 1/4] Gem::Exception: Cannot load gem at [/usr/lib/ruby/gems/1.8/cache/rake-11.2.2.gem] in /home/pgscutv/TeamCity-9.1.7/buildAgent/work/37e3a4176e075735
[12:40:13][Step 1/4] sudo: sorry, you must have a tty to run sudo
[12:40:13][Step 1/4]
[12:40:13][Step 1/4] Gem::Exception: Cannot load gem at [/usr/lib/ruby/gems/1.8/cache/addressable-2.4.0.gem] in /home/pgscutv/TeamCity-9.1.7/buildAgent/work/37e3a4176e075735
[12:40:13][Step 1/4] Using builder 3.2.2
[12:40:13][Step 1/4] sudo: sorry, you must have a tty to run sudo
我犹豫要不要在这里使用 sudo
因为通常不建议使用 bundle 这样做。此外,当我使用与 teacmity 相同的用户登录机器时:
[pgscutv@pgsc-TC-build 37e3a4176e075735]$ gem -v
2.4.8
当我将 gem -v
添加到第一个构建步骤时,这是我得到的:
[12:51:40][Step 1/4] in directory: /home/pgscutv/TeamCity-9.1.7/buildAgent/work/37e3a4176e075735
[12:51:40][Step 1/4] 1.3.7
问题
所以我的问题是双重的:
- 为什么
rubygems 1.3.7
被 bundle 使用?
rubygems 1.3.7
是否也导致了 sudo 的问题?
编辑:如果合适,请随时建议将此移动到另一个站点。
事实证明,我需要做的只是以下操作(在 运行 teamcity 上的任何内容之前)
bundle install
bundle update capybara
bundle update selenium-webdriver
背景
我正在尝试 运行 centos 上的黄瓜场景(通过 teamcity)。构建配置的第一步是:
bundle install
但是,这只会给我以下错误:
[12:39:52][Step 1/4] Starting: /home/pgscutv/TeamCity-9.1.7/buildAgent/temp/agentTmp/custom_script4075833203409573811
[12:39:52][Step 1/4] in directory: /home/pgscutv/TeamCity-9.1.7/buildAgent/work/37e3a4176e075735
[12:40:00][Step 1/4] Fetching gem metadata from https://rubygems.org/
[12:40:06][Step 1/4] Fetching version metadata from https://rubygems.org/
[12:40:09][Step 1/4] Fetching dependency metadata from https://rubygems.org/
[12:40:11][Step 1/4] Rubygems 1.3.7 is not threadsafe, so your gems will be installed one at a time. Upgrade to Rubygems 2.1.0 or higher to enable parallel gem installation.
[12:40:12][Step 1/4]
[12:40:12][Step 1/4] sudo: sorry, you must have a tty to run sudo
[12:40:12][Step 1/4] Gem::Exception: Cannot load gem at [/usr/lib/ruby/gems/1.8/cache/rake-11.2.2.gem] in /home/pgscutv/TeamCity-9.1.7/buildAgent/work/37e3a4176e075735
[12:40:13][Step 1/4] sudo: sorry, you must have a tty to run sudo
[12:40:13][Step 1/4]
[12:40:13][Step 1/4] Gem::Exception: Cannot load gem at [/usr/lib/ruby/gems/1.8/cache/addressable-2.4.0.gem] in /home/pgscutv/TeamCity-9.1.7/buildAgent/work/37e3a4176e075735
[12:40:13][Step 1/4] Using builder 3.2.2
[12:40:13][Step 1/4] sudo: sorry, you must have a tty to run sudo
我犹豫要不要在这里使用 sudo
因为通常不建议使用 bundle 这样做。此外,当我使用与 teacmity 相同的用户登录机器时:
[pgscutv@pgsc-TC-build 37e3a4176e075735]$ gem -v
2.4.8
当我将 gem -v
添加到第一个构建步骤时,这是我得到的:
[12:51:40][Step 1/4] in directory: /home/pgscutv/TeamCity-9.1.7/buildAgent/work/37e3a4176e075735
[12:51:40][Step 1/4] 1.3.7
问题
所以我的问题是双重的:
- 为什么
rubygems 1.3.7
被 bundle 使用? rubygems 1.3.7
是否也导致了 sudo 的问题?
编辑:如果合适,请随时建议将此移动到另一个站点。
事实证明,我需要做的只是以下操作(在 运行 teamcity 上的任何内容之前)
bundle install
bundle update capybara
bundle update selenium-webdriver