Results 1 to 9 of 9

Thread: HOWTO: add support for .rhtml, .html.erb, .rjs, .rxml, .builder

  1. #1
    Join Date
    Jun 2007
    Location
    Rijeka, Croatia
    Beans
    30
    Distro
    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 Attached Files
    Last edited by Eric_Jardas; June 10th, 2007 at 09:26 AM. Reason: typo
    Constructive lurker

  2. #2
    Join Date
    Dec 2004
    Beans
    21

    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.

  3. #3
    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??

  4. #4
    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

  5. #5
    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!

  6. #6
    Join Date
    Aug 2008
    Beans
    2

    Re: HOWTO: add support for .rhtml, .html.erb, .rjs, .rxml, .builder

    Thanks for the info.

    Side note: why the **** should I register to get attached files? Is administration of this forums in desperate need of trash accounts?

  7. #7
    Join Date
    May 2008
    Location
    Philadelphia, PA
    Beans
    25
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO: add support for .rhtml, .html.erb, .rjs, .rxml, .builder

    I followed these instructions and was not able to get syntax highlighting for erb files working. I'm using Ubuntu 10.04.

    My ruby syntax highlighting for .rb files works fine.
    Do Less, Do it Well

  8. #8
    Join Date
    May 2008
    Location
    Philadelphia, PA
    Beans
    25
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO: add support for .rhtml, .html.erb, .rjs, .rxml, .builder

    x
    Last edited by selahlynch; February 13th, 2012 at 09:22 PM. Reason: figured it out... want to delete post
    Do Less, Do it Well

  9. #9
    Join Date
    May 2008
    Location
    Philadelphia, PA
    Beans
    25
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO: add support for .rhtml, .html.erb, .rjs, .rxml, .builder

    Now I discovered that everything does indeed work properly. My confusion stemmed from the fact that gedit saves what highlighting syntax you used last time you opened the file. Therefor, any html.erb files that I had opened before following these instructions had saved that they should be open as plain text. All html.erb files that I create from scratch open up with rhtml syntax highlighting. Hooray!
    Last edited by selahlynch; February 13th, 2012 at 09:24 PM. Reason: clairification
    Do Less, Do it Well

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •