Teamcity:对不起,运行“bundle install”时你必须有一个运行sudo的tty

时间:2016-07-08 13:00:19

标签: teamcity bundler

背景

我正在尝试在centos上运行黄瓜场景(通过teamcity)。构建配置的第一步是:

webView = (WebView)findViewById(R.id.terms_of_services_webview);
webView.post(new Runnable()
{
    @Override
    public void run()
    {
       String Path = "...";  //html file path
       WebSettings websettings = webView.getSettings();  
       websettings.setSupportZoom(true);  
       websettings.setBuiltInZoomControls(true);   
       websettings.setJavaScriptEnabled(true);  

       webView.setWebViewClient(new WebViewClient() {

       @Override
       public boolean shouldOverrideUrlLoading(WebView view, String url) {
        if(url.equals(Path)) {
            view.loadUrl(url);
        }
        else {
            Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
            TermsOfServicesActivity.this.startActivity(intent);
        }
        return true;  
      }
      });

        webView.loadUrl(Path);  
    }
});

但是,这只会给我以下错误:

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 犹豫不决,因为通常不建议使用bundle。当我使用与用户相同的用户登录机器时:

sudo

当我将[pgscutv@pgsc-TC-build 37e3a4176e075735]$ gem -v 2.4.8 添加到第一个buildstep时,我得到的是:

gem -v

问题(S)

所以我的问题有两个:

  1. 为什么捆绑使用[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
  2. rubygems 1.3.7是否也会导致sudo出现问题?
  3. 编辑:如果合适,建议您将其移至其他网站。

1 个答案:

答案 0 :(得分:0)

事实证明,我需要做的就是以下(在团队城市上运行之前)

bundle install
bundle update capybara
bundle update selenium-webdriver