I'm having trouble getting started with the P4Ruby API. I've been in touch with one of the guys at Perforce, but he so far hasn't been able to see what's wrong. He's proving helpful, so will continue trading messages with him, but with him seemingly in the US, and me in the UK, it's a one message each way a day situation - not ideal for such problems! Anyway.... I've tried a simple connect/sync test in Ruby (Rails), and in IRB:
irb(main):001:0> require "P4" => true irb(main):002:0> p4 = P4.new => P4: [ssl:server:1666] steve_hall@fullmars (not connected) irb(main):003:0> p4.debug = 1 => 1 irb(main):004:0> p4.user = "steve_hall" => "steve_hall" irb(main):005:0> p4.port = "ssl:server.com:1666" => "ssl:server:1666" irb(main):006:0> p4.password = "<<ahem!>>" => "<<ahem!>>" irb(main):007:0> p4.client = "fullmars" => "fullmars" irb(main):008:0> p4.connect [P4] Connecting to Perforce => true irb(main):009:0> p4.run_login [P4] Received input for next command [P4] Executing "p4 login" => ["User Steve_Hall logged in."]All good so far... Now...
irb(main):010:0> p4.run_sync [P4] Executing "p4 sync" P4Exception: [P4#run] Errors during command execution( "p4 sync" ) [Error]: Perforce password (P4PASSWD) invalid or unset. from /usr/local/lib/ruby/site_ruby/1.9.1/P4.rb:110:in `run' from /usr/local/lib/ruby/site_ruby/1.9.1/P4.rb:110:in `method_missing' from (irb):10 from /usr/local/bin/irb:12:in `<main>'My contact at perforce has suggested trying to connect directly to our P4 server bypassing the proxy. I wasn't aware we WERE using a proxy! Can anyone advise on how to check? I'm not sure it CAN be bypassed?
He also suggested "2. Please try the script after running "p4 login -a", does it still fail?":
irb(main):007:0> p4.client = "fullmars" => "fullmars" irb(main):008:0> p4.connect [P4] Connecting to Perforce => true irb(main):009:0> p4.run("login","-a") [P4] Executing "p4 login -a" Fatal client error; disconnecting! No user-input supplied. => If anyone can suggest what I'm getting wrong, it'd be most welcome!