[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

`rake` fails: Exec format error

Larry Fast

8/9/2007 11:37:00 PM

I'm trying to start rake running for a sub-component of our system.
However Ruby doesn't like `rake` and produces the following error...

> ruby -e "`rake`" (it gives the same error inside my .rb files)

-e:1:in ``': Exec format error - rake (Errno::ENOEXEC)

I worked around it by creating a .rb file that contains:
Rake::Task['taskname'].invoke

Is there a better way or a standard practice for invoking an external
Rake process from inside Ruby?

Thanks,
Larry
--
Posted via http://www.ruby-....

7 Answers

Larry Fast

8/10/2007 1:40:00 AM

0

A more complete version of what I'm doing is...

crntDir = Dir.pwd
Dir.chdir("other_directory_path")
%x{ruby -e "require 'Rakefile'; Rake::Task['some_task'].invoke "}
Dir.chdir(crntDir)

Is there a more elegant ruby-ism that accomplishes this?
--
Posted via http://www.ruby-....

Stefano Crocco

8/10/2007 6:51:00 AM

0

Alle venerdì 10 agosto 2007, Larry Fast ha scritto:
> A more complete version of what I'm doing is...
>
> crntDir = Dir.pwd
> Dir.chdir("other_directory_path")
> %x{ruby -e "require 'Rakefile'; Rake::Task['some_task'].invoke "}
> Dir.chdir(crntDir)
>
> Is there a more elegant ruby-ism that accomplishes this?

If you want to execute a rakefile, I think you can do:

%x{rake ...}

Stefano

Nobuyoshi Nakada

8/10/2007 7:28:00 AM

0

Hi,

At Fri, 10 Aug 2007 08:37:15 +0900,
Larry Fast wrote in [ruby-talk:264040]:
> I'm trying to start rake running for a sub-component of our system.
> However Ruby doesn't like `rake` and produces the following error...
>
> > ruby -e "`rake`" (it gives the same error inside my .rb files)
>
> -e:1:in ``': Exec format error - rake (Errno::ENOEXEC)

It depends on what's your platform and how you've installed
rake.

--
Nobu Nakada

Larry Fast

8/10/2007 3:25:00 PM

0

> If you want to execute a rakefile, I think you can do:
>%x{rake ...}
ruby -e '%x{rake}' produces the same error message


Nobuyoshi Nakada wrote:
> It depends on what's your platform and how you've installed
> rake.

We're running Windows XP. ruby -v says:
ruby 1.8.5 (2006-12-25 patchlevel 12) [i386-mswin32]
I don't know much more than that. I'm guessing we used the one-click
installation.

Larry

--
Posted via http://www.ruby-....

Larry Fast

8/10/2007 3:28:00 PM

0

Larry Fast wrote:
> I'm guessing we used the one-click installation.

There are 3 rake files in my ruby installation directory:
rake - near the top it reads # This file was generated by RubyGems.
rake.bat - very similar to rake
rake.cmd - one line: @ruby "C:/ruby/bin/rake" %*


--
Posted via http://www.ruby-....

Nobuyoshi Nakada

8/10/2007 6:33:00 PM

0

Hi,

At Sat, 11 Aug 2007 00:28:16 +0900,
Larry Fast wrote in [ruby-talk:264105]:
> There are 3 rake files in my ruby installation directory:
> rake - near the top it reads # This file was generated by RubyGems.
> rake.bat - very similar to rake
> rake.cmd - one line: @ruby "C:/ruby/bin/rake" %*

`rake.cmd` would work.

--
Nobu Nakada

Larry Fast

8/10/2007 7:47:00 PM

0

Nobuyoshi Nakada wrote:

> `rake.cmd` would work.

Just tried it and yes, `rake.cmd` works.
Thank you,
Larry
--
Posted via http://www.ruby-....