I understand that if I translate a book from English to French, my French translation is a derivative work. But, if I translate something such as Ruby on Rails from Ruby to Java is it a derivative work?
Yes. Even were translation not specifically listed as one of the processes that creates a derivative work by statute, it would still fall under the general categorization of a derivative work.
First, is it a new work? Something cannot be a derivative work if it's not a new work. The answer is clearly yes, your translation process certainly includes at least the minimal creative input required to create a new work.
Second, is this new work a derivative work of the original? And I think the answer would almost certainly be yes. The test here is whether the new work contains sufficient protectable expression from the original work. However, the answer would be no if you do not take enough copyrightable material from the original work. It doesn't take much.
Your work is a derivative work because anyone who copies or distributes your work is copying or distributing the protectable expression from the original work that is also in your work.
Generally, it is a derivative work.
You may be able to avoid copyright issues if you do the following: Employ two teams.
First team creates specifications based on the original work for the new translated code. Then a lawyer can review the specifications to remove anything that could be considered copyrighted. Then an entirely different team, which does not share any members with the first, writes the code in the new language. In this manner, the new work becomes an independent creation, not subject to copyright.
Take a look at: http://en.wikipedia.org/wiki/Clean_room_design