RotbotFramework:Rake Aborted无法加载此类文件

时间:2017-06-14 12:40:21

标签: ruby-on-rails robotframework

运行以下命令......

rake RAILS_ENV=production company:process_patient_data_feed_01 search_folder=/var/www/sponsor1_integration/to_process/ processed_folder=/var/www/sponsor1_integration/processed/ failed_folder=/var/www/sponsor1_integration/failed/   

在Jenkins中完成后输出以下内容

Return: (1, "rake aborted!\ncannot load such file -- bundler/setup\n/var/www/sponsor1_integration/config/boot.rb:3:in `<top (required)>'\n/var/www/sponsor1_integration/config/application.rb:1:in `<top (required)>'\n/var/www/sponsor1_integration/Rakefile:4:in `<top (required)>'\n(See full trace by running task with --trace)")

让我感到困惑的是,在本地运行时很好。诚然,不同的机器。我想知道我在哪里可以进行故障排除。

我的代码fyi

Create File  ${BATCH_FILE}
    Append to file  ${BATCH_FILE}  sponsor,protocol,site_number,subject_number,subject_status,randomization_date,treatment_arm_id,treatment_arm_description
    : FOR    ${index}    IN RANGE    1    ${amount_of_patients_to_add}
    \         ${patient_name}=  Run Keyword if  "${subject_number}" == ","
          ...  Set Variable  ${subject_number}
    \         ...  ELSE
          ...  Set Variable  ${subject_number}${index},
    \  Append to file  ${BATCH_FILE}  \n${sponsor},${protocol},${site_number},${patient_name}${subject_status},${randomization_date},${treatment_id},${treatment_arm_description}

    ${base_dir}=  Set Variable  /var/www/${SPONSOR_NAME}_integration/
    ${files_to_process_path}=  Set Variable  ${base_dir}to_process
    ${processed_path}=  Set Variable  ${base_dir}processed/
    ${failed_path}=  Set Variable  ${base_dir}failed/
    ${path_where_file_should_be_post_processing}=  Set Variable
    ...  ${base_dir}${directory_where_file_should_be}/${FILE}

    #Open Connection     ${ENV_NAME}.longboat.com
    #Login With Public Key    jenkins  ~/.ssh/id_rsa
    Run And Return Rc and Output   rm -rf ${processed_path}
    Run And Return Rc and Output   rm -rf ${failed_path}
    Run And Return Rc and Output   rm -rf ${files_to_process_path}
    Run And Return Rc and Output   mkdir ${processed_path}
    Run And Return Rc and Output   mkdir ${failed_path}
    Run And Return Rc and Output   mkdir ${files_to_process_path}
    Run And Return Rc and Output   mv ${BATCH_FILE} ${files_to_process_path}
    Run And Return Rc and Output   cat ${files_to_process_path}${FILE}
    ${RAILS_COMMAND}=  Set Variable
     ...  rake RAILS_ENV=production longboat:process_patient_data_feed_01 search_folder=${files_to_process_path} processed_folder=${processed_path} failed_folder=${failed_path}
    Run And Return Rc and Output  sudo chmod 777 ${files_to_process_path}/${FILE}
    Run And Return Rc and Output  sudo chmod 777 ${processed_path}
    Run And Return Rc and Output  sudo chmod 777 ${failed_path}
    Run And Return Rc and Output  sudo chmod 777 ${files_to_process_path}
    Select From Database
    ...  Select * from visit_pathways order by id desc
    Run And Return Rc and Output  cd ${base_dir}
    Run And Return Rc and Output  ${RAILS_COMMAND}
    Run And Return Rc and Output   ls ${processed_path}
    Run And Return Rc and Output   ls ${failed_path}
    Run And Return Rc and Output   ls ${files_to_process_path}
    Select From Database
    ...  Select * from visit_pathways order by id desc
    Run And Return Rc and Output  cat ${base_dir}/log/production.log \| grep ERROR
    Run And Return Rc and Output  cat /var/www/auth/log/production.log \| grep ERROR
    Run And Return Rc and Output  tail -200 ${base_dir}/log/production.log
    Run And Return Rc and Output  tail -200 /var/www/auth/log/production.log
    ${output}=  Run   ls ${path_where_file_should_be_post_processing} | wc -l
    Should contain  ${output}  1

0 个答案:

没有答案