learn-ruby-the-hard-way

What is “Syntax Error, unexpected tCONSTANT” error in Ruby?

一曲冷凌霜 提交于 2019-12-06 17:12:16
问题 I am currently on Lesson 9 in "Learn Ruby the hard way". I have typed the the line number 6 exactly as the way its being instructed but still I am getting error while executing. It says: Syntax error, unexpected tCONSTANT, expecting $end puts " Here ^ are the days : ", days 回答1: You have forgotten to close a string on a previous line. Here's the problem reproduced: paul@paulbookpro ~ ⸩ ruby days = "abc puts "Here are the days" -:2: syntax error, unexpected tCONSTANT, expecting $end puts "Here

What is “Syntax Error, unexpected tCONSTANT” error in Ruby?

血红的双手。 提交于 2019-12-04 22:48:30
I am currently on Lesson 9 in "Learn Ruby the hard way". I have typed the the line number 6 exactly as the way its being instructed but still I am getting error while executing. It says: Syntax error, unexpected tCONSTANT, expecting $end puts " Here ^ are the days : ", days You have forgotten to close a string on a previous line. Here's the problem reproduced: paul@paulbookpro ~ ⸩ ruby days = "abc puts "Here are the days" -:2: syntax error, unexpected tCONSTANT, expecting $end puts "Here are the days" ^ It's treating the double-quote before the word "Here" as the closing quote of the string on

Require command not working within bash irb on Snow Leopard

♀尐吖头ヾ 提交于 2019-12-01 03:50:42
I am working on Zed Shaw's Learn Ruby the Hard Way Exercise 25 http://ruby.learncodethehardway.org/ex25.html When I navigate to the directory that holds the ruby file ex25.rb and launch IRB, I get these errors: Larson-2:~ larson$ cd Ruby Larson-2:Ruby larson$ ls ex25.rb Larson-2:Ruby larson$ irb ruby-1.9.2-p290 :001 > require 'ex25' LoadError: no such file to load -- ex25 from /Users/larson/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' from /Users/larson/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in

Require command not working within bash irb on Snow Leopard

点点圈 提交于 2019-12-01 00:30:41
问题 I am working on Zed Shaw's Learn Ruby the Hard Way Exercise 25 http://ruby.learncodethehardway.org/ex25.html When I navigate to the directory that holds the ruby file ex25.rb and launch IRB, I get these errors: Larson-2:~ larson$ cd Ruby Larson-2:Ruby larson$ ls ex25.rb Larson-2:Ruby larson$ irb ruby-1.9.2-p290 :001 > require 'ex25' LoadError: no such file to load -- ex25 from /Users/larson/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' from