Single Linked List Implementation in Ruby
Firstly, your code's broken. If you instantiate a list with no initial value, and then append to it, it creates two nodes:

list = LinkedList.new
list.append("foo")
list.size #=&gt; "List size: 2"


Secondly, implement an #each method to iterate through values and include Enumerable. That'll give a ton of methods for free: #find, #count, #to_a, and many others. Something like this should do:

def each
  node = @head
  until node.nil?
    yield node.value
    node = node.next_node
  end
end


Thirdly, return useful values. #size should not return a string. Neither should #head, #node_at_index, or #find. #size should return an int, and the others should return nil. Never ever return easy-to-print strings unless that's explicitly called for. Currently, you can get puzzling stuff like this:

some_list.head #=&gt; "Empty list" (the head's value is the string "Empty list")
some_list.size #=&gt; "List size: 2" (so, no, not empty)


And you can get useless stuff like this:

if some_array.size &lt; some_list.size # ArgumentError: comparison of Fixnum with String failed
  ...


I trust you see the problem here.

Speaking of return values, you seem to have taken some care that your methods don't return a raw Node instance (which is smart, since nodes are internal/private to the linked-list)... but you made @head accessible from anywhere with attr_accessor. So some_list.head = "foo" is perfectly legal, and will break things. Also, #append and #prepend implicitly return Node instances.

Fourth, you might want to keep track of the tail as well as the head. Many of your methods rely on finding the tail one way of another, so why not keep it around? Or at least use your own #tail method for these cases, rather than do it differently each time.

Other stuff:


Check the indices passed to #insert_at and #remove_at and raise an appropriate error if the index is out-of-bounds. Otherwise you'll just get a NoMethodError which doesn't explain much.
Don't put assignments into ternary branches; use the branch to determine the value to assign. I.e. this

element.nil? ? @head = nil : @head = Node.new(element)


should be

@head = element.nil? ? nil : Node.new(element)


of course, in this particular case, @head will be nil by default, do you could just as well do:

@head = Node.new(element) unless element.nil?

Your #to_s would be a lot cleaner if you collected all the values in an array, used map to add parentheses, and join to add the "-&gt;" arrows. If you include Enumerable as described above, your #to_s could just be:

def to_s
  values = map { |value| "(#{value})" }
  values &lt;&lt; "nil"
  values.join(" -&gt; ")
end