@markwilkinson: It was my uid/pwd which needed to be dav:dav , then I was able to run the ruby program against a local Virtuoso instance.
With the local test the prefixes are also mixed with between lines of data ie
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix ns1: <http://localhost:8890/DAV/ldp/> .
@prefix ldp: <http://www.w3.org/ns/ldp#> .
ns1:obs_1-19e1 rdf:type ldp:Resource ,
ldp:RDFSource .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
ns1:obs_1-19e1 rdf:type rdfs:Resource .
@prefix ns4: <http://www.w3.org/ns/posix/stat#> .
ns1:obs_1-19e1 ns4:mtime 1560460142 ;
ns4:size 103 .
ns1:obs_2-130d rdf:type ldp:Resource ,
ldp:RDFSource ,
rdfs:Resource ;
ns4:mtime 1560460142 ;
ns4:size 103 .
.
.
.
But adding the data snippet to a Turtle validator like http://ttl.summerofcode.be it is reported as being valid, thus is seems it is not a requirement for all prefixes to be specified at the beginning of the file ?