Skip to content

Instantly share code, notes, and snippets.

@jakenotjacob
Created January 23, 2014 05:51
Show Gist options
  • Save jakenotjacob/8573593 to your computer and use it in GitHub Desktop.
Save jakenotjacob/8573593 to your computer and use it in GitHub Desktop.
Error when passing in ARGV values.
#!/usr/bin/env ruby
puts "Enter the tags for this post: "
tags = gets.chomp
date = Time.now.to_s.split(' ').first
args = ARGV
file_title = args.join("-")
post_title = args.join(" ")
File.open("#{date}-#{file_title}.md", "w") {|post|
post.write("
---\n
layout: post\n
title: #{post_title}\n
tags: #{tags}
---\n
")
}
#$ ./make.rb asdf asdf
#Enter the tags for this post:
#./make.rb:6:in `gets': No such file or directory @ rb_sysopen - asdf (Errno::ENOENT)#
# from ./make.rb:6:in `gets'
# from ./make.rb:6:in `<main>'
@Nowaker
Copy link

Nowaker commented Jun 12, 2014

I get this as well. How to do it right?

@Nowaker
Copy link

Nowaker commented Jun 12, 2014

@NamanJn
Copy link

NamanJn commented Feb 1, 2015

Yeah I'm getting the same error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment