Installing rails and RVm

newbee here. Hope you can help me with this. rails -v Rails is not currently installed on this system. To get the latest version, simply type: $ sudo gem install railsYou can then rerun your “rails” command. KrisOrqla:~ Kris$ sudo gem install rails Password: Failed to load /Users/Kris/.gemrc because it doesn’t contain valid YAML hash […]

Is everything an object in python like ruby?

A comment on another Stack Overflow question states that Python was just like Ruby, as it relates to “everything’s an object,” and everything in Python was an object, just like Ruby. Is this true? Is everything an object in python like ruby? How are the two different in this respect or are they really the […]

What does <<-CONSTANT do?

return <<-HTML <li> <a href = “some-link”>Link-Title</a> </li> HTML What are <<-HTML on the first line and HTML on the last line for?

Difference between '..' (double-dot) and '…' (triple-dot) in range generation?

I’ve just started learning Ruby and Ruby on Rails and came across validation code that uses ranges: validates_inclusion_of :age, :in => 21..99 validates_exclusion_of :age, :in => 0…21, :message => “Sorry, you must be over 21” At first I thought the difference was in the inclusion of endpoints, but in the API docs I looked into, […]

Where is Ruby's string literal juxtaposition feature officially documented?

I recently realized that if you juxtapose a sequence of Ruby string literals (e.g. ‘a’ “b” ‘c’), it’s equivalent to the concatenation of those string literals. However, I can’t find this language feature documented anywhere. I’ve searched using the terms “juxtaposition” and “concatenation”, but only found reference to it in a couple of StackOverflow responses. […]

No increment operator (++) in Ruby?

Possible Duplicate: Why doesn't Ruby support i++ or i— for fixnum? Why is there no increment operator in Ruby? e.g. i++ ++i Is the ++ operator used for something else? Is there a real reason for this?

Is it possible to get Ruby syntax highlighting in PHPStorm?

I found this but honestly not sure how to install it or whether it applies. Thanks!

Array slicing in Ruby: looking for explanation for illogical behaviour (taken from

I was going through the exercises in Ruby Koans and I was struck by the following Ruby quirk that I found really unexplainable: array = [:peanut, :butter, :and, :jelly] array[0] #=> :peanut #OK! array[0,1] #=> [:peanut] #OK! array[0,2] #=> [:peanut, :butter] #OK! array[0,0] #=> [] #OK! array[2] #=> :and #OK! array[2,2] #=> [:and, :jelly] #OK! […]

Ruby: How to set feedjira configuration options?

In the Feedjira 2.0 announcement blog post, it says that if you want to set the user agent, that should be a configuration option, but it is not clear how to do this. Ideally, I would like to mimic the options previously provided in Feedjira 1.0, including user_agent, if_modified_since, timeout, and ssl_verify_peer. With Feedjira […]

Mixing keyword with regular arguments in Ruby?

Ruby 2.0 supports keyword arguments. I was wondering, what are the ‘rules’ for mixing regular with keyword arguments? Something like this would not work: def some_method(a: ‘first’, b: ‘second’, c) [a, b, c] end but this will: def some_method(c, a: ‘first’, b: ‘second’) [a, b, c] end So why does putting a regular argument before […]

Ruby is the best programming language in the world - Ruby on Rails.