Hi,
I'm using rake in a (mostly) non-ruby project, and so started looking into TextMate's support for running rake tasks.
I discovered that my project automatically has a scope of attr.project.rake, and so I set the Ruby bundle's "Run Rake Task" command to include this scope. However when I execute the command I don't see a full list of the available tasks, I just see the following two:
- (default task) - aborted!
The project requires JRuby (as it uses JDBC), and so I then tried setting TM_RUBY to use the correct ruby (normally I want textmate to use the system ruby regardless, as using jruby really slows down bundle commands and such). Now I get this error:
/Users/adsharp/.rvm/rubies/jruby-1.6.7.2/lib/ruby/1.8/erb.rb:715 warning: SAFE levels are not supported in JRuby NotImplementedError: Process::Status#exited? not implemented (root) at /Users/adsharp/Library/Application Support/TextMate/Managed/Bundles/Ruby.tmbundle/Support/RakeMate/rake_mate.rb:42
Here I'm well beyond my level of expertise. Is there anything I can do here to enable use of the "Run Rake Task" command in my JRuby/Rake project?
Cheers,
Adam
On Aug 28, 2012, at 2:19 AM, Adam Sharp adsharp@me.com wrote:
[…] Here I'm well beyond my level of expertise. Is there anything I can do here to enable use of the "Run Rake Task" command in my JRuby/Rake project?
I haven’t used the rake support myself, but looking at the source you should set TM_RAKE (rather than TM_RUBY).
Is anyone using the rake stuff? If so, does it do anything special other than just run ‘rake’? Because if it doesn’t do something special, it would likely be worth moving this to use Executor to bring it in line with the other runners.
On 02/09/2012, at 8:51 AM, Allan Odgaard mailinglist@textmate.org wrote:
I haven’t used the rake support myself, but looking at the source you should set TM_RAKE (rather than TM_RUBY).
I set TM_RAKE, and unset TM_RUBY, and the runner complained that it couldn't find jruby. So I set TM_RUBY back to the correct RVM executable. I still get the same error however, but just noticed that the SAFE levels message was just a warning, the real problem was a NotImplementedError:
NotImplementedError: Process::Status#exited? not implemented (root) at /Users/adsharp/Library/Application Support/TextMate/Managed/Bundles/Ruby.tmbundle/Support/RakeMate/rake_mate.rb:42
Found this pull request: https://github.com/jruby/jruby/pull/245, so updated my project to use jruby-1.7.0.preview2, which seemed to resolve that error.
Now the problem is that rake_mate.rb requires $TM_SUPPORT/lib/ui.rb, which requires $TM_SUPPORT/lib/osx/plist, which is a C extension and therefore is disabled in JRuby.
So it's looking like a non-starter for now...
Adam