During the occupation of Norway by Nazi Germany Ramm was arrested several times. He was imprisoned in Grini concentration camp and Akershus Fortress before being shipped to Germany. After falling ill he got permission to go home in November 1943, but died in Denmark on his way back.