create a lineRender in C#

my guess:

LineRenderer  lineRenderer = (LineRenderer) gameObject.AddComponent("LineRenderer");

if(lineRenderer== null) {
 Debug.Log("null lineRenderer");
}
lineRenderer.SetVertexCount(2);
lineRenderer.SetColors(c1, c2);   
lineRenderer.SetPosition(0, start); 
lineRenderer.SetPosition(1, end); 
lineRenderer.SetWidth(width, width); 
Debug.Log("rendered line");

fails when i try to add many lines :

Can't add component 'LineRenderer' to Ground because such a component is already added to the game object!

how can i have many lines?

Use multiple Game Objects, each with a Line Renderer attached.

Also, there's a much better way of coding that line:

LineRenderer lineRenderer = gameObject.AddComponent<LineRenderer>();

The most important part is getting rid of the string. I don't know why the documentation lists that version first; the GetComponent page is better.