- We design and build extraordinary applications for companies looking to make the next great idea a reality.
- learn more
IntelliJ IDEA and Ruby on Rails
Not exactly Ajax related, but I thought I'd share it since it might prove useful. I've been evaluating a few Rails IDE's for my firms lately, including IntelliJ IDEA 7.0. On Linux, it has been an underwhelming experience. Specifically, there are two problems that get in the way of productive work:
- The IDE calls rails as follows:
/usr/local/bin/ruby -e STDOUT.sync=true;STDERR.sync=true;load($0=ARGV.shift) /usr/bin/rails ProjectName --force, which is a problem ifrailsis a shell script, as it is on many system. - The symbolic link from
vendor/railsto.causes the IDE to go into an infinite recursive scan of the ruby code.
Yuck.
The solution to the first problem is to provide a Ruby wrapper to the rails shell script. First you move /usr/bin/rails to /usr/bin/rails.sh. Then you create a new /usr/bin/rails with the following content:
#!/usr/bin/ruby
exec('/usr/bin/rails.sh', *ARGV);
Now, when the IDE tries to execute Rails with the Ruby runtime, it doesn't barf. So far so good.
The second problem doesn't have such a simple solution. Since the IDE starts scanning the source tree right after Rails gets done generating it, you don't have a chance to fix things before the death spiral begins. So, our hack is to first delete the symbolic link, then exclude it from the source scan, then re-add it when it is safe.
- While the IDE is doing its "...rails/rails/rails/rails/rails..." scan, delete the symbolic link:
cd vendor; rm rails - The scan should finish quickly now. Once it is done, create a simple directory in the vendor directory:
mkdir rails - Now open up the Module Settings dialog and select the
vendor/railsdirectory and exclude it. Click OK.
- Remove the directory and recreate the symbolic link:
rmdir rails; ln -s . rails
And you are done. Double yuck. What a hack.
JetBrains, are you listening? Since many Rails developers use Linux as their desktop platform, maybe you could fix these issues soon? This ain't like IE on the Mac, people actually do use it.
Technorati Tags: ruby, rails, ide, intellij
Topics: IDE, Ruby on Rails
Comments: 1 so far
Leave a comment
About Pathfinder
Recent
- Implementing linked multiselects with jQuery, LiveQuery, and Low Pro: Part 1: Requirements and interaction design
- Many Varied Components, or… Multi Variable Complexity, or… Mainly Vanilla Coding
- Custom Flex 3 Lightweight Preloader with source code
- Mass Assigning Inheritance Column Values for ActiveRecord STI with Rails
- Working effectively as a team of one: Five tips for front-end developers on Agile teams
- Ruby on Rails with Windows - How I made it work
- Project Website Part 5: Morph in 11 steps or so
- Papervision3D 2.0 (Great White) in Flex 3 (Part II & III combined) with source code
- What’s In Your Dock?
- Why Chicago is Rails-town, USA
Archives
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006
- August 2006
- July 2006
- June 2006
- May 2006
- April 2006
- March 2006


Please comment the issue http://www.jetbrains.net/jira/browse/RUBY-385 and describe your environment(rails and ruby versions, plugin version, OS). What version of Rails do you use? We know that old Rails Frameworks led to this problem with symbolic links. But on version 1.2.3 and higher all is ok.
Comment by Roman Chernyatchik, Friday, November 16, 2007 @ 12:48 am