Vincent Dansereau Vincent Dansereau - 3 years ago 206
Ruby Question

Error using method edges.each |edge|

I typed this from a tutorial in Sketchup Ruby API.

centerpoint =,0,0)
vector = 0,0,1
model = Sketchup.active_model
entities = model.active_entities
eges = entities.add_circle( centerpoint, vector, 10)
vertices = []
edges.each do |edge|
vertices << edge.start
vertices << edge.end
vertices.each do |vert|

I get this error message.

Error: #<SyntaxError: <main>: syntax error, unexpected end-of-input
edges.each do |edge|

I would like to know why.

Answer Source

unexpected end-of-input generally means, you are missing an end somewhere. You need to write one more end in your code. Look at the block that you start at the end.

vertices.each do |vert|

Put an end underneath here.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download