`rake` fails: Exec format error

L

Larry Fast

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
 
L

Larry Fast

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?
 
S

Stefano Crocco

Alle venerd=C3=AC 10 agosto 2007, Larry Fast ha scritto:
A more complete version of what I'm doing is...

crntDir =3D 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
 
N

Nobuyoshi Nakada

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


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

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

Larry Fast

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


Nobuyoshi said:
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
 
L

Larry Fast

Larry said:
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" %*
 
N

Nobuyoshi Nakada

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top