I can't run a program I just created! Are spaces in file names a problem?

Using ruby with windows vista, created a new programming and I'm in the
correct directory on the command line but I keep getting a load error
after checking my spelling exactly matches the file name. I put a space
in the name of the file I created does this cause problems?

···

--
Posted via http://www.ruby-forum.com/.

more or less. You either need to:

1) remove the space(s) from the ruby filename.
2) use quotes around the name like this:
    c:>ruby “my filename.rb”

I tend to avoid spaces whenever possible but quotes also work.

···

On Nov 20, 2013, at 6:32 AM, Joshua P. <lists@ruby-forum.com> wrote:

Using ruby with windows vista, created a new programming and I'm in the
correct directory on the command line but I keep getting a load error
after checking my spelling exactly matches the file name. I put a space
in the name of the file I created does this cause problems?

--
Posted via http://www.ruby-forum.com/\.

Wayne Brissette wrote in post #1128038:

more or less. You either need to:

1) remove the space(s) from the ruby filename.
2) use quotes around the name like this:
    c:>ruby my filename.rb

I tend to avoid spaces whenever possible but quotes also work.

I can't see the quotes, it should be c:>ruby "my filename.rb"
The usual Ruby way is to use underscores in place of spaces, and all
lowercase as well.

···

--
Posted via http://www.ruby-forum.com/\.

I believe that the reason for a lowercase standard is that Linux tends
to be case-sensitive when dealing with filenames. If it's all lowercase,
there's no misunderstanding. If you were to write a program which worked
on Windows' case-insensitive filesystem then it might fail when migrated
into a Linux environment.

Not directly related, but useful to know: Anything starting with an
uppercase letter in Ruby is a constant.

Another reason (in my mind), is that CamelCaseIsHarderToRead
than_underscored_phrases.

···

--
Posted via http://www.ruby-forum.com/.

Legend! As always! That text really illustrates it nicely.

···

--
Posted via http://www.ruby-forum.com/.

Thanks again guys, I had no idea about quotes or underscores, is there
any reason for always using lowercase. Also funny story Joel, I know a
programmer friend of mine who's name is Joel Parsons. Spooky!

···

--
Posted via http://www.ruby-forum.com/.

also_known_as_snake_case :slight_smile:

···

On Nov 20, 2013, at 6:26 AM, Joel Pearson <lists@ruby-forum.com> wrote:

I believe that the reason for a lowercase standard is that Linux tends
to be case-sensitive when dealing with filenames. If it's all lowercase,
there's no misunderstanding. If you were to write a program which worked
on Windows' case-insensitive filesystem then it might fail when migrated
into a Linux environment.

Not directly related, but useful to know: Anything starting with an
uppercase letter in Ruby is a constant.

Another reason (in my mind), is that CamelCaseIsHarderToRead
than_underscored_phrases.

--
Posted via http://www.ruby-forum.com/\.