Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #7203

Re: Learn Ruby The Hard Way --- Problems with completing the exercise to get my computer to run Ruby

Newsgroups comp.lang.ruby
Date 2016-04-06 00:42 -0700
References <8f153753-66be-4aec-ae67-ab3a0c23ca89@googlegroups.com> <m2mvp8te74.fsf@gmail.com> <96e9bddc-4a0d-4717-b01a-48ffe12c7373@googlegroups.com> <m2fuv0tahm.fsf@gmail.com>
Message-ID <1a7e45c2-14b6-453c-ba99-adcd1ee879fc@googlegroups.com> (permalink)
Subject Re: Learn Ruby The Hard Way --- Problems with completing the exercise to get my computer to run Ruby
From Cai Gengyang <gengyangcai@gmail.com>

Show all headers | View raw


Yup ... it works now. 

I am now on exercise 3 --- http://learnrubythehardway.org/book/ex3.html.


So I saved the below text as a "ex3.rb" file in my home directory :

puts "I will now count my chickens:"
puts "Hens #{25 + 30 / 6}"puts "Roosters #{100 - 25 * 3 % 4}"
puts "Now I will count the eggs:"
puts 3 + 2 + 1 - 5 + 4 % 2 - 1 / 4 + 6
puts "Is it true that 3 + 2 &lt; 5 - 7?"
puts 3 + 2 &lt; 5 - 7
puts "What is 3 + 2? #{3 + 2}"puts "What is 5 - 7? #{5 - 7}"
puts "Oh, that's why it's false."
puts "How about some more."
puts "Is it greater? #{5 &gt; -2}"puts "Is it greater or equal? #{5 &gt;= -2}"puts "Is it less or equal? #{5 &lt;= -2}"

Tried to run it in my Terminal by typing :

CaiGengYangs-MacBook-Pro:mystuff CaiGengYang$ cd ~/mystuffCaiGengYangs-MacBook-Pro:mystuff CaiGengYang$ ruby ex3.rb

But I got this error message --- ruby : No such file or directory -- ex3.rb (LoadError)

How to debug this ?









On Tuesday, April 5, 2016 at 10:07:41 PM UTC+8, Sebastian Christ wrote:
> Some tips. I think you can figure this out yourself.
> 
> 1. Your Terminal prompt says you're in your home directory (denoted by
> the ~)
> 2. Where did you say have you saved your file?
> 3. Concentrate while doing the exercises. Perhaps you should repeat
> Exercise 0 step 10?
> 
> Regards,
> Sebastian
> 
> P.S.: Don't append a file extension to your directories. Sure, the Unix
> underneath OSX won't complain, but you're confused enough. 
> 
> -- 
> Sebastian (Rudolfo) Christ
> http://rudolfochrist.github.io
> GPG Fingerprint: 306D 8FD3 DFB6 4E44 5061
>                  CE71 6407 D6F8 2AC5 55DD

Back to comp.lang.ruby | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Learn Ruby The Hard Way --- Problems with completing the exercise to get my computer to run Ruby Cai Gengyang <gengyangcai@gmail.com> - 2016-04-04 03:59 -0700
  Re: Learn Ruby The Hard Way --- Problems with completing the exercise to get my computer to run Ruby Sebastian Christ <rudolfo.christ@gmail.com> - 2016-04-05 14:47 +0200
    Re: Learn Ruby The Hard Way --- Problems with completing the exercise to get my computer to run Ruby Cai Gengyang <gengyangcai@gmail.com> - 2016-04-05 05:59 -0700
      Re: Learn Ruby The Hard Way --- Problems with completing the exercise to get my computer to run Ruby Sebastian Christ <rudolfo.christ@gmail.com> - 2016-04-05 16:07 +0200
        Re: Learn Ruby The Hard Way --- Problems with completing the exercise to get my computer to run Ruby Cai Gengyang <gengyangcai@gmail.com> - 2016-04-06 00:42 -0700
          Re: Learn Ruby The Hard Way --- Problems with completing the exercise to get my computer to run Ruby Sebastian Christ <rudolfo.christ@gmail.com> - 2016-04-06 10:32 +0200
            Re: Learn Ruby The Hard Way --- Problems with completing the exercise to get my computer to run Ruby Cai Gengyang <gengyangcai@gmail.com> - 2016-04-06 05:14 -0700
              Re: Learn Ruby The Hard Way --- Problems with completing the exercise to get my computer to run Ruby Robert Klemme <shortcutter@googlemail.com> - 2016-04-06 18:05 +0200
                Re: Learn Ruby The Hard Way --- Problems with completing the exercise to get my computer to run Ruby Cai Gengyang <gengyangcai@gmail.com> - 2016-04-08 03:29 -0700
                Re: Learn Ruby The Hard Way --- Problems with completing the exercise to get my computer to run Ruby Robert Klemme <shortcutter@googlemail.com> - 2016-04-09 20:24 +0200

csiph-web