当我尝试运行Rally-User-Management的/update_project_permissions.rb脚本时,我收到了上述错误。
update_project_permissions.rb
#include for rally json library gem
require 'rally_api'
require 'csv'
require './lib/multi_io.rb'
require './lib/rally_user_helper.rb'
require './lib/go_update_project_permissions.rb'
$project_identifier_arg = ARGV[0]
$new_permission_arg = ARGV[1]
if $project_identifier_arg.nil? || $new_permission_arg.nil? then
puts "Usage: ruby update_all_project_permissions.rb \"My Project\" \"Editor\""
puts "or: ruby update_all_project_permissions 12345678910 \"No Access\""
puts "Where in number form, the project identifier is the Project's ObjectID."
end
begin
go_update_project_permissions($project_identifier_arg, $new_permission_arg)
end
调用文件
中的lib / go_update_project_permissions.rbgo_update_project_permissions go_update_project_permissions
命令行参数是 - ruby update_project_permissions.rb“40880544785”“无法访问”
我收到以下错误
错误 - :nil的未定义方法`each':NilClass(NoMethodError)
c:/Users/vorad/Documents/Rally-User-Management/lib/go_update_project_permissions.rb:92:in`is_workspace_admin'
c:/Users/vorad/Documents/Rally-User-Management/lib/go_update_project_permissions.rb:137:在`update_project_permissions'
c:/Users/vorad/Documents/Rally-User-Management/lib/go_update_project_permissions.rb:309:in block in go_update_project_permissions'
c:/Users/vorad/Documents/Rally-User-Management/lib/go_update_project_permissions.rb:308:在'each'
c:/Users/vorad/Documents/Rally-User-Management/lib/go_update_project_permissions.rb:308:在`go_update_project_permissions'中 update_project_permissions.rb:38:in
[2015-08-10T15:38:28.854098#15504]错误 - : [“c:/Users/vorad/Documents/Rally-User-Management/lib/go_update_project_permissions.rb:92:in”is_workspace_admin“”,“ c:/Users/vorad/Documents/Rally-User-Management/lib/go_update_project_permissions.rb:137:在`update_project_permissions'“,” c:/Users/vorad/Documents/Rally-User-Management/lib/go_update_project_permissions.rb:309:在`block in go_update_project_permissions'“,” c:/Users/vorad/Documents/Rally-User-Management/lib/go_update_project_permissions.rb:308:在'each'“,” c:/Users/vorad/Documents/Rally-User-Management/lib/go_update_project_permissions.rb:308:在`go_update_project_permissions'“,”update_project_permissions.rb:38:in“] E,
[2015-08-10T15:38:28.857098#15504]错误 - :nil的未定义方法`each':NilClass
答案 0 :(得分:0)