PDA

View Full Version : gedit for ruby on rails



codeking
October 6th, 2007, 05:16 AM
After trying several IDE's such as JEdit, I realized that I was really comfortable with GEdit. The only problem was it didn't highlight ruby syntax in .rhtml files. I found some instructions at http://grigio.org/textmate_gedit_few_steps , and I downloaded x-rhtml.xml and rhtml.lang and moved them to the appropriate places. But it still doesn't highlight the syntax. What am I doing wrong?

Wolki
October 6th, 2007, 02:54 PM
After trying several IDE's such as JEdit, I realized that I was really comfortable with GEdit. The only problem was it didn't highlight ruby syntax in .rhtml files. I found some instructions at http://grigio.org/textmate_gedit_few_steps , and I downloaded x-rhtml.xml and rhtml.lang and moved them to the appropriate places. But it still doesn't highlight the syntax. What am I doing wrong?

Taking a look at that guide from google cache (site refuses connection :-/ ) it looks like the mime cache doesn't get updated. If you right-click->properties a rhtml file in nautilus and it doesn't tell you it's mime type as x-rhtml, try running "sudo update-mime-database /usr/share/mime/".

codeking
October 6th, 2007, 04:25 PM
i did that, it still says the mime type was text/html. I double-checked that x-rhtml.lang was in /usr/share/mime/packages/, and it was. Any ideas?

Wolki
October 6th, 2007, 05:43 PM
Can you set the rhtml highlighting manually in gedit?

codeking
October 7th, 2007, 05:00 PM
I go into preferences and there is rhtml as a highlight mode, and it should be highlighting stuff fine, which it does with HTML, but Ruby is still not highlighted.

codeking
October 7th, 2007, 05:07 PM
I can get it to work if I select the highlighting mode is rhtml manually. Anyway to get it to work automatically?

Also, I don't like the syntax highlighting scheme in gedit. Any way to get it like dreamweavers?

aflax
November 23rd, 2007, 12:05 AM
I was having the same problem. Here is how I fixed it:


gksudo gedit /usr/share/gtksourceview-2.0/language-specs/rhtml.lang

then change the 3rd line to this:


<language _name="rhtml" version="1.0" _section="Markup" mimetypes="text/x-eruby;text/x-rhtml">

sweetperceptions
February 26th, 2008, 06:12 AM
Hi Everyone, I had the same problem, up until I found this: http://snakesgemscoffee.blogspot.com/2007/04/registering-rails-file-extensions-in.html

and it finally worked! :)

firecrow8
March 27th, 2008, 02:07 PM
I've been able to edit my highlighting, I'm not a rails programming but I've posted how the .lang xml in combination with the style selected in gedit come together here:
http://ubuntuforums.org/showthread.php?t=736843

hope that works.