Guest User

Untitled

a guest
Jun 13th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. root@bertfordseo:/home/rlankford/ruby/keyword# rvm use 1.8.7
  2. Using /usr/local/rvm/gems/ruby-1.8.7-p334
  3. root@bertfordseo:/home/rlankford/ruby/keyword# ruby -v
  4. ruby 1.8.7 (2011-02-18 patchlevel 334) [i686-linux]
  5. root@bertfordseo:/home/rlankford/ruby/keyword# irb
  6. ruby-1.8.7-p334 :001 > string = "test
  7. ruby-1.8.7-p334 :002"> test
  8. ruby-1.8.7-p334 :003"> test"
  9. => "test\ntest\ntest"
  10. ruby-1.8.7-p334 :004 > string.split('\n')
  11. => ["test\ntest\ntest"]
  12. ruby-1.8.7-p334 :005 > string.each {|i| puts i}
  13. test
  14. test
  15. test
  16. => "test\ntest\ntest"
  17. ruby-1.8.7-p334 :006 > exit
  18. root@bertfordseo:/home/rlankford/ruby/keyword# rvm use 1.9.2
  19. Using /usr/local/rvm/gems/ruby-1.9.2-p180
  20. root@bertfordseo:/home/rlankford/ruby/keyword# ruby -v
  21. ruby 1.9.2p180 (2011-02-18 revision 30909) [i686-linux]
  22. root@bertfordseo:/home/rlankford/ruby/keyword# irb
  23. ruby-1.9.2-p180 :001 > string = "test
  24. ruby-1.9.2-p180 :002"> test
  25. ruby-1.9.2-p180 :003"> test"
  26. => "test\ntest\ntest"
  27. ruby-1.9.2-p180 :004 > string.split('\n')
  28. => ["test\ntest\ntest"]
  29. ruby-1.9.2-p180 :005 > string.each {|i| puts i}
  30. NoMethodError: undefined method `each' for "test\ntest\ntest":String
  31. from (irb):5
  32. from /usr/local/rvm/rubies/ruby-1.9.2-p180/bin/irb:16:in `<main>'
  33. ruby-1.9.2-p180 :006 >
Add Comment
Please, Sign In to add comment