I am trying to use the following code to accept in a file as an argument in a terminal, which will then be read and update the body variable with its contents. If the file is not transferred, then I want to receive an invitation in which the user can enter his own copy of the body.
require 'posterous' Posterous.config = { 'username' => 'name', 'password' => 'pass', 'api_token' => 'token' } include Posterous @site = Site.primary
When I run the program without transferring to the file, I return it:
Post title: Hello posterous.rb:21:in `initialize': can't convert nil into String (TypeError) from posterous.rb:21:in `open' from posterous.rb:21:in `'
I am new to the ruby ββand therefore not the best at it. I tried to shift a lot of things and change things, but to no avail. What am I doing wrong?
source share