Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Other Community Discussions > Tutorials & Tips
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Tutorials & Tips
The place to find Ubuntu related Tips & Tricks.

 
Thread Tools Display Modes
Old June 9th, 2007   #1
Eric_Jardas
5 Cups of Ubuntu
 
Eric_Jardas's Avatar
 
Join Date: Jun 2007
Location: Rijeka, Croatia
Beans: 30
Ubuntu 7.04 Feisty Fawn
Post HOWTO: add support for .rhtml, .html.erb, .rjs, .rxml, .builder

After you installed Ruby on Rails its time to add support for it's extensions.

1. First we need to add new extensions to file mime.types located in /etc folder.

1.1 Lets do that. We have to add new extensions at the end of mime.types file. We'll do that with the following command:
Code:
echo -e "text/x-ruby-source                    rhtml html.erb \ntext/x-eruby                    rjs \napplication/xml                    rxml builder"  | sudo tee -a /etc/mime.types
1.2 Now we have to update mime-types so our new extensions get loaded with:
Code:
sudo update-mime-database /usr/share/mime
2. Now it's time to download files.tar.gz from attachment

2.1 Unpack it with command:
Code:
 tar -xzvf files.tar.gz
2.2 Now we have to copy .xml file to /usr/share/mime/package:
Code:
sudo cp x-rhtml.xml /usr/share/mime/packages
2.3 And .lang files to /usr/share/gtksourceview-1.0/language-specs:
Code:
sudo cp *.lang /usr/share/gtksourceview-1.0/language-specs
And we are done ! Now editors like gedit can recognize rails extensions and you have syntax coloring for them !

Enjoy !
Attached Files
File Type: gz files.tar.gz (3.3 KB, 218 views)
__________________
Constructive lurker

Last edited by Eric_Jardas; June 10th, 2007 at 04:26 AM.. Reason: typo
Eric_Jardas is offline   Reply With Quote
Old August 7th, 2007   #2
dishkuvek
5 Cups of Ubuntu
 
dishkuvek's Avatar
 
Join Date: Dec 2004
Beans: 22
Re: HOWTO: add support for .rhtml, .html.erb, .rjs, .rxml, .builder

Do you know how you might get this working in gutsy? Since in gutsy there is now gtksourceview1.0 and gtksourceview2.0, I tried putting these files in both, and I still can't get the source to highlight in gedit.
dishkuvek is offline   Reply With Quote
Old October 20th, 2007   #3
Brian Pattison
First Cup of Ubuntu
 
Join Date: Sep 2007
Beans: 2
Re: HOWTO: add support for .rhtml, .html.erb, .rjs, .rxml, .builder

I can't get rhtml to be recognized in gutsy either. Can anyone please help??
Brian Pattison is offline   Reply With Quote
Old October 20th, 2007   #4
Brian Pattison
First Cup of Ubuntu
 
Join Date: Sep 2007
Beans: 2
Re: HOWTO: add support for .rhtml, .html.erb, .rjs, .rxml, .builder

Finally got syntax highlighting for rhtml, rjs, ect in gedit on Gutsy working!!

Hope this helps others:
Ubuntu 7.10, rails, gedit and gtksourceview 2.0
Brian Pattison is offline   Reply With Quote
Old October 23rd, 2007   #5
polypus
First Cup of Ubuntu
 
Join Date: Dec 2006
Beans: 11
blogged it

i have some more info for ubuntu rails gedit heads here:

http://crepuscular-homunculus.blogsp...g-else-on.html

thanks for the info!
polypus is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:43 PM.


vBulletin ©2000 - 2010, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. bilberry