apt-get can only manage things it installed, so upgrading might cause breaking changes with programs it doesn’t know about.
This is not to say I don’t recommend keeping ubuntu up-to-date. I certainly do. Why did you not use apt-get to install those programs in the first place? Ruby, git and nginx are all in the default repos. If by “passenger” you mean Phusion Passenger, they have an apt repo too.