{"id":7018,"date":"2014-05-17T00:20:59","date_gmt":"2014-05-17T00:20:59","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/05\/17\/require-statement-not-working-in-ruby-from-bash-collection-of-common-programming-errors\/"},"modified":"2014-05-17T00:20:59","modified_gmt":"2014-05-17T00:20:59","slug":"require-statement-not-working-in-ruby-from-bash-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/05\/17\/require-statement-not-working-in-ruby-from-bash-collection-of-common-programming-errors\/","title":{"rendered":"Require statement not working in ruby from bash-Collection of common programming errors"},"content":{"rendered":"<p>I&#8217;m trying to get ttscoff&#8217;s TaskPaper to Markdown ruby script https:\/\/gist.github.com\/511174 working. However, I use rvm, which seems to present some challenges.<\/p>\n<p><code>-rjcode<\/code> is a no-longer needed Unicode flag and -Ku is another encoding flag I can probably ignore.<\/p>\n<p>I found instructions for adding rvm as a function to your script, but the script still errors as soon as it hits <code>require ftools<\/code>.<\/p>\n<p>What I added is:<\/p>\n<pre><code>#!\/usr\/bin\/env bash\n# TaskPaper to Markdown converter\n# Usage: tp2md.rb filename.taskpaper &gt; output.md\n# Load RVM into a shell session *as a function*\n\n\n# Load RVM into a shell session *as a function*\nif [[ -s \"$HOME\/.rvm\/scripts\/rvm\" ]] ; then\n  # First try to load from a user install\n  source \"$HOME\/.rvm\/scripts\/rvm\"\nelif [[ -s \"\/usr\/local\/rvm\/scripts\/rvm\" ]] ; then\n  # Then try to load from a root install\n  source \"\/usr\/local\/rvm\/scripts\/rvm\"\nelse\n  printf \"ERROR: An RVM installation was not found.\\n\"\nfi\n\n# Configure ruby and gemset\nrvm ruby-1.9.2-p290@global\n\nruby<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m trying to get ttscoff&#8217;s TaskPaper to Markdown ruby script https:\/\/gist.github.com\/511174 working. However, I use rvm, which seems to present some challenges. -rjcode is a no-longer needed Unicode flag and -Ku is another encoding flag I can probably ignore. I found instructions for adding rvm as a function to your script, but the script still [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7018","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7018","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=7018"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7018\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=7018"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=7018"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=7018"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}