I don’t understand the meaning of $:<< "." in Ruby.
I upgraded Ruby to 1.9.1, but a program was not working. My classmate told me that I am supposed to add $:<< "."
What does $:<< "." do?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
$:is the variable that holds an array of paths that make up your Ruby’s load path<<appends an item to the end of the array.refers to the current directorySo you are adding the current directory to Ruby’s load path
References:
Can be found in the
Execution Environment Variablessection of of this page from The Pragmatic Programmers GuideCan be found in the docs for array at ruby-doc.org.