From: David Vlad on 11 Mar 2010 14:54 Hello Im new to ruby and programming and I saw a guy do this on a tutorial video: "Hello".each_char do |x| puts x end The result was that it printed one letter in the string at a time until it had printed the whole word "Hello" in a vertical line. My problem is that this wont work when I try it and I've done exactly like he did it. The only thing I can think of is that maybe I have another version of ruby than he has, but perhaps anyone of you knows the answer? -- Posted via http://www.ruby-forum.com/.
From: Brandon Jones on 11 Mar 2010 14:57 what version of ruby are you running? It works for me on 1.9.1 on windows. Try this: > "Hello".each_byte { |x| puts x.chr } -- Posted via http://www.ruby-forum.com/.
From: David Vlad on 11 Mar 2010 15:03 Brandon Jones wrote: > what version of ruby are you running? It works for me on 1.9.1 on > windows. Try this: > >> "Hello".each_byte { |x| puts x.chr } Thanks, the example you made works (alto I didnt fully understand it). Im about 95% sure that I am running ruby 1.8.6 since I just used the one-click installer that's on ruby-lang.org. Why dont they have a one-click installer for the latest version of ruby? XD -- Posted via http://www.ruby-forum.com/.
From: Brandon Jones on 11 Mar 2010 15:18 David Vlad wrote: > Thanks, the example you made works (alto I didnt fully understand it). I think the 1.8x version of Ruby's string implementation is in another module: jcode. I believe you can run your original code, you just have to require 'jcode'. > Im about 95% sure that I am running ruby 1.8.6 since I just used the > one-click installer that's on ruby-lang.org. Why dont they have a > one-click installer for the latest version of ruby? XD I don't know why they haven't packaged a more up-to-date one-click installer. They do have the 1.9.1 version pre-built for windows. I'm running it and it works great. -- Posted via http://www.ruby-forum.com/.
From: Aldric Giacomoni on 11 Mar 2010 15:39 Brandon Jones wrote: > > I don't know why they haven't packaged a more up-to-date one-click > installer. They do have the 1.9.1 version pre-built for windows. I'm > running it and it works great. Because it's a lot of work :) -- Posted via http://www.ruby-forum.com/.
|
Next
|
Last
Pages: 1 2 Prev: Can't install gems with native extensions Next: result of assignment is not the return value |