(gedit:1430): Gtk-WARNING **: cannot open display:

gedit is the official text editor of the GNOME desktop environment. Generally, in a server, there is no desktop environment installed or needed. Therefore, gedit can't start and display.

I suggest that you instead use nano.

sudo nano /etc/network/interfaces