Joined: 31 Mar 2003
|Posted: Tue Apr 11, 2006 9:43 pm Post subject: Ruby-on-Rails - The ultimate gnome setup.
|Everybody Loves a nice screenshot, so here it is - http://lamer0.com/files/jeditConfigured.png. This is the end result of this guide.
Quick edit - To set GTK+ 2.0 Look and Feel for _ALL_ java applications, download http://www.moniundthomaskuenneth.de/tkplafutility/ And Set GTK+ as your default java look and feel. From here on out you all java applications will look and function like gnome applications.
It seems like everyone is talking about Ruby on Rails now a days. If you watch the screen casts for Ruby on Rails, you will notice the developers use TextMate http://macromates.com/. Textmate has excellent _project_ browsing, completion / abbreviation abilities.
So what is a Linux Gnome user to do? We have eclipse with radrails, however this is a bit 'much' for just working on a small ruby on rails site. Then there is Gedit in Gnome 2.14 which almost fits the bill, however it does not have a project side pane to browse the many files involved in a usual RoR project. Never fear there is a good Textmate alternative - JEdit. So lets get started on configuring JEdit to have the Gnome GTK 2.0 theme compatibility and all of Textmate's features!
First install jedit.
Once it is installed you will see it in our Applications -> Other Menu.
To fix the missing icon issue do the following.
|sudo vi /usr/share/applications/jedit-jedit.desktop |
Then change the Icon=jedit to Icon=/usr/share/icons/hicolor/128x128/apps/jedit.pngs and save. If you check now, you will have a pretty icon.
Now, if you launch jedit and switch the Look and Feel to GTK+, you will notice that it does not inherit you Gnome GTK+ 2.0 theme. Well I got the fix for this as well! We will need to install the Java 1.6 Mustang Release, which supports AA fonts and GTK+ 2.0 Themes.
Go to https://forums.gentoo.org/viewtopic-t-253054-highlight-mustang.html And follow this guide.
Back yet? Good continue reading...
Make sure to re-login to initialize the new JVM environment variable. Now with Java 1.6 installed all your Java applications that support the GTK+ Look and Feel will conform to your Gnome Desktop Theme!
So what do we have now? Jedit that looks and feels like a gnome application! Oh and don't worry Eclipse/NetBeans work fine with Java 1.6.
Lets get started on configuring JEdit to the ultimate RoR environment. Go to http://sourceforge.net/project/showfiles.php?group_id=155104 and download all the files listed. Place the jars in ~/.jedit/jars/ and the ruby.xml file into ~/jedit/modes/ . Start up JEdit and install any dependent plugins that JEdit Ruby requires, such as the sidekick and projectpreview plugins. Once you have all the required and desired plugins installed it is time to configure JEdit.
Below are some sparse guides on how to achieve TextMate functionality.
Ruby-on-Rails/Ruby Documentation Pane.
To get the Ruby documentation Pane in JEdit go to Plugins->Ruby Plugin -> Ruby Documentation. It will present you will a new documentation window. To dock that window as a pane click the little arrow on the top left hand side and set it to dock on the left or right of your main window. Now you should have RoR documentation at your finger tips.
Go to Plugins->Plugin Options->Sidekick->Parsers select ruby as the ruby parser. With that set you should have ruby-on-rails syntax completion.
Textmate fast-open functionality
Install the OpenIt plugin and point it to your project directory. Once you bind it in the Shortcuts options menu, you will able to hot key search to the desired file in your project.
Textmate auto-complete def/end begin/end etc abbreviations
Go to shortcuts->plugin: jedit ruby-> and set the Auto-Indent to your enter key. With that set, next time you type def bleh<enter> it will automatically close it with an end statement in any ruby file you open.
Textmate project view
Go to Plugins->project viewer->show project. Dock it by clicking on the little top left arrow. Import your project and now you have a slick pane to navigate your RoR project.
I think this pretty much covers all of Textmate features and functionality and Guess what? you saved $599(mini cost)+$30(textmate cost) = $629+tax. Got to love open source!
I am sure I have grammar and spelling mistakes. Just follow the Guide loosely and you should be able to get the desired RoR environment.
Everybody Loves a nice screenshot, so here it is - http://lamer0.com/files/jeditConfigured.png
Last edited by lamer0 on Tue Apr 11, 2006 9:45 pm; edited 1 time in total