# Errno::ENOEXEC

**URL:** <https://rubytalk.org/t/errno-enoexec/58820>\
**Category:** ruby-talk\
**Created:** [8 June 2010 18:50 UTC](https://rubytalk.org/t/errno-enoexec/58820 "2010-06-08T18:50:24Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Santhosh\_Kattissery](https://avatars.discourse-cdn.com/v4/letter/s/b4bc9f/32.png) [@Santhosh\_Kattissery](https://rubytalk.org/u/Santhosh_Kattissery)\
**Post date:** [8 June 2010 18:50 UTC](https://rubytalk.org/t/errno-enoexec/58820/1 "2010-06-08T18:50:24Z")

</div>

I have the following line in my code:  
puts `bundle install`

This gives me the following error:  
C:/../\<abc\>.rb:11:in ``': Exec format error - bundle install  
(Errno::ENOEXEC)

Im using a windows machine. What could be wrong?  
Have anyone faced this issue?

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![Alex\_Stahl](https://avatars.discourse-cdn.com/v4/letter/a/b77776/32.png) [@Alex\_Stahl](https://rubytalk.org/u/Alex_Stahl)\
**Post date:** [8 June 2010 19:40 UTC](https://rubytalk.org/t/errno-enoexec/58820/2 "2010-06-08T19:40:36Z")

</div>

Any reason you're using `backtics` around your string? If you're just  
trying to print to console, use 'single' or "double" quotes. If you're  
trying to execute an external command, then that command needs to be  
installed.

Try it like this to just print to console:

> puts 'bundle install' #using single quotes

When I use backtics on my linux machine, this lists the contents of the  
current working directory:

> puts `ls` #using backtics indicates system command

Hope this helps,  
Alex

> **···**
>
> On Tue, 2010-06-08 at 13:50 -0500, Santhosh Kattissery wrote:
> 
> > I have the following line in my code:  
> > puts `bundle install`
> > 
> > This gives me the following error:  
> > C:/../\<abc\>.rb:11:in ``': Exec format error - bundle install  
> > (Errno::ENOEXEC)
> > 
> > Im using a windows machine. What could be wrong?  
> > Have anyone faced this issue?

---

<div class="post-metadata">

**Author:** ![Alex\_S](https://avatars.discourse-cdn.com/v4/letter/a/57b2e6/32.png) [@Alex\_S](https://rubytalk.org/u/Alex_S)\
**Post date:** [8 June 2010 19:42 UTC](https://rubytalk.org/t/errno-enoexec/58820/3 "2010-06-08T19:42:13Z")

</div>

(Apologies if this is a dupe... I sent a reply email to the ML but  
didn't see it go through).

Any reason you're using `backtics` around your string? If you're just  
trying to print to console, use 'single' or "double" quotes. If you're  
trying to execute an external command, then that command needs to be  
installed.

Try it like this to just print to console:

> puts 'bundle install' #using single quotes

When I use backtics on my linux machine, this lists the contents of the  
current working directory:

> puts `ls` #using backtics indicates system command to execute

Hope this helps,  
Alex

Santhosh Kattissery wrote:

> **···**
>
> > I have the following line in my code:  
> > puts `bundle install`
> > 
> > This gives me the following error:  
> > C:/../\<abc\>.rb:11:in ``': Exec format error - bundle install  
> > (Errno::ENOEXEC)
> > 
> > Im using a windows machine. What could be wrong?  
> > Have anyone faced this issue?
> 
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![Santhosh\_Kattissery](https://avatars.discourse-cdn.com/v4/letter/s/b4bc9f/32.png) [@Santhosh\_Kattissery](https://rubytalk.org/u/Santhosh_Kattissery)\
**Post date:** [8 June 2010 19:53 UTC](https://rubytalk.org/t/errno-enoexec/58820/4 "2010-06-08T19:53:11Z")

</div>

Thanks for you reply.  
And yes, I am trying to execute a command.  
puts `ls`, works for me.  
install bundle works for me from command line.  
But I want to execute it from ruby code.

I did not understand "then that command needs to be installed"

Alex S. wrote:

> **···**
>
> > (Apologies if this is a dupe... I sent a reply email to the ML but  
> > didn't see it go through).
> > 
> > Any reason you're using `backtics` around your string? If you're just  
> > trying to print to console, use 'single' or "double" quotes. If you're  
> > trying to execute an external command, then that command needs to be  
> > installed.
> > 
> > Try it like this to just print to console:
> > 
> > > puts 'bundle install' #using single quotes
> > 
> > When I use backtics on my linux machine, this lists the contents of the  
> > current working directory:
> > 
> > > puts `ls` #using backtics indicates system command to execute
> > 
> > Hope this helps,  
> > Alex
> > 
> > Santhosh Kattissery wrote:
> > 
> > > I have the following line in my code:  
> > > puts `bundle install`
> > > 
> > > This gives me the following error:  
> > > C:/../\<abc\>.rb:11:in ``': Exec format error - bundle install  
> > > (Errno::ENOEXEC)
> > > 
> > > Im using a windows machine. What could be wrong?  
> > > Have anyone faced this issue?
> 
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![Alex\_Stahl](https://avatars.discourse-cdn.com/v4/letter/a/b77776/32.png) [@Alex\_Stahl](https://rubytalk.org/u/Alex_Stahl)\
**Post date:** [8 June 2010 20:14 UTC](https://rubytalk.org/t/errno-enoexec/58820/5 "2010-06-08T20:14:24Z")

</div>

Do you have the path to the executable listed in your $PATH environment  
variable?

> **···**
>
> On Tue, 2010-06-08 at 14:53 -0500, Santhosh Kattissery wrote:
> 
> > Thanks for you reply.  
> > And yes, I am trying to execute a command.  
> > puts `ls`, works for me.  
> > install bundle works for me from command line.  
> > But I want to execute it from ruby code.
> > 
> > I did not understand "then that command needs to be installed"
> > 
> > Alex S. wrote:  
> > \> (Apologies if this is a dupe... I sent a reply email to the ML but  
> > \> didn't see it go through).  
> > \>  
> > \> Any reason you're using `backtics` around your string? If you're just  
> > \> trying to print to console, use 'single' or "double" quotes. If you're  
> > \> trying to execute an external command, then that command needs to be  
> > \> installed.  
> > \>  
> > \> Try it like this to just print to console:  
> > \>  
> > \>\>puts 'bundle install' #using single quotes  
> > \>  
> > \> When I use backtics on my linux machine, this lists the contents of the  
> > \> current working directory:  
> > \>  
> > \>\>puts `ls` #using backtics indicates system command to execute  
> > \>  
> > \> Hope this helps,  
> > \> Alex  
> > \>  
> > \>  
> > \> Santhosh Kattissery wrote:  
> > \>\> I have the following line in my code:  
> > \>\> puts `bundle install`  
> > \>\>  
> > \>\> This gives me the following error:  
> > \>\> C:/../\<abc\>.rb:11:in ``': Exec format error - bundle install  
> > \>\> (Errno::ENOEXEC)  
> > \>\>  
> > \>\> Im using a windows machine. What could be wrong?  
> > \>\> Have anyone faced this issue?

---

<div class="post-metadata">

**Author:** ![Gordon\_Thiesfeld](https://avatars.discourse-cdn.com/v4/letter/g/e47774/32.png) [@Gordon\_Thiesfeld](https://rubytalk.org/u/Gordon_Thiesfeld)\
**Post date:** [30 June 2010 18:14 UTC](https://rubytalk.org/t/errno-enoexec/58820/6 "2010-06-30T18:14:47Z")

</div>

Which version of ruby are you using? You may need to run something like:

puts `bundle.bat install`

HTH

Gordon

> **···**
>
> On Tue, Jun 8, 2010 at 2:53 PM, Santhosh Kattissery \<santhosh214@gmail.com\> wrote:
> 
> > Thanks for you reply.  
> > And yes, I am trying to execute a command.  
> > puts `ls`, works for me.  
> > install bundle works for me from command line.  
> > But I want to execute it from ruby code.

---

<div class="post-metadata">

**Author:** ![Gourav\_Tiwari](https://avatars.discourse-cdn.com/v4/letter/g/5f9b8f/32.png) [@Gourav\_Tiwari](https://rubytalk.org/u/Gourav_Tiwari)\
**Post date:** [30 June 2010 18:00 UTC](https://rubytalk.org/t/errno-enoexec/58820/7 "2010-06-30T18:00:47Z")

</div>

Hi Alex

I am facing similar issue and I do have $PATH variable setup in the  
windows.  
Basically, it happens, when I run cucumber features on culerity gem.  
Error is:

(:🙂 failed steps (:🙂

Exec format error -  
C:/Ruby/lib/ruby/gems/1.8/gems/culerity-0.2.10/lib/../bin/run\_celerity\_server.rb  
(Errno::ENOEXEC)

The only line in run\_celerity\_server.rb I could see is:  
#!/usr/bin/env jruby  
require File.dirname(\_\_FILE\_\_) \<\< '/../lib/culerity/celerity\_server'  
Culerity::CelerityServer.new(STDIN, STDOUT)

Thanks in advance.  
-Gourav  
Alex Stahl wrote:

> **···**
>
> > Do you have the path to the executable listed in your $PATH environment  
> > variable?
> 
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![Gourav\_Tiwari](https://avatars.discourse-cdn.com/v4/letter/g/5f9b8f/32.png) [@Gourav\_Tiwari](https://rubytalk.org/u/Gourav_Tiwari)\
**Post date:** [30 June 2010 18:23 UTC](https://rubytalk.org/t/errno-enoexec/58820/8 "2010-06-30T18:23:43Z")

</div>

Thanks for the reply Gordon

I will give it a try, by the way, I am using ruby 1.8.6 and jruby 1.5.1

Gordon Thiesfeld wrote:

> **···**
>
> > On Tue, Jun 8, 2010 at 2:53 PM, Santhosh Kattissery \> \<santhosh214@gmail.com\> wrote:
> > 
> > > Thanks for you reply.  
> > > And yes, I am trying to execute a command.  
> > > puts `ls`, works for me.  
> > > install bundle works for me from command line.  
> > > But I want to execute it from ruby code.
> > 
> > Which version of ruby are you using? You may need to run something  
> > like:
> > 
> > puts `bundle.bat install`
> > 
> > HTH
> > 
> > Gordon
> 
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![Gourav\_Tiwari](https://avatars.discourse-cdn.com/v4/letter/g/5f9b8f/32.png) [@Gourav\_Tiwari](https://rubytalk.org/u/Gourav_Tiwari)\
**Post date:** [30 June 2010 18:42 UTC](https://rubytalk.org/t/errno-enoexec/58820/9 "2010-06-30T18:42:08Z")

</div>

It didn't work, any idea what may be going wrong here?

-Gourav

Gourav Tiwari wrote:

> **···**
>
> > Thanks for the reply Gordon
> > 
> > I will give it a try, by the way, I am using ruby 1.8.6 and jruby 1.5.1
> > 
> > Gordon Thiesfeld wrote:
> > 
> > > On Tue, Jun 8, 2010 at 2:53 PM, Santhosh Kattissery \>\> \<santhosh214@gmail.com\> wrote:
> > > 
> > > > Thanks for you reply.  
> > > > And yes, I am trying to execute a command.  
> > > > puts `ls`, works for me.  
> > > > install bundle works for me from command line.  
> > > > But I want to execute it from ruby code.
> > > 
> > > Which version of ruby are you using? You may need to run something  
> > > like:
> > > 
> > > puts `bundle.bat install`
> > > 
> > > HTH
> > > 
> > > Gordon
> 
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![Gordon\_Thiesfeld](https://avatars.discourse-cdn.com/v4/letter/g/e47774/32.png) [@Gordon\_Thiesfeld](https://rubytalk.org/u/Gordon_Thiesfeld)\
**Post date:** [30 June 2010 18:44 UTC](https://rubytalk.org/t/errno-enoexec/58820/10 "2010-06-30T18:44:06Z")

</div>

Running ruby scripts are a bit different. You may want to try adding  
'ruby ' to the begining

C:\Users\gthiesfeld\Work\repo\>pik 1.8.6

C:\Users\gthiesfeld\Work\repo\pik\>ruby -v  
ruby 1.8.6 (2010-02-04 patchlevel 398) [i386-mingw32]

C:\Users\gthiesfeld\Work\repo\>irb  
irb(main):001:0\> `test.rb`  
Errno::ENOEXEC: Exec format error - test.rb  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from (irb):1:in ``'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from (irb):1  
irb(main):002:0\> `ruby test.rb`  
=\> "Hello world!\n4\n"  
irb(main):003:0\> exit

C:\Users\gthiesfeld\Work\repo\>pik jruby

C:\Users\gthiesfeld\Work\repo\>ruby -v  
'ruby' is not recognized as an internal or external command,  
operable program or batch file.

C:\Users\gthiesfeld\Work\repo\pik\>jruby -v  
jruby 1.5.1 (ruby 1.8.7 patchlevel 249) (2010-06-06 f3a3480) (Java  
HotSpot(TM) Client VM 1.6.0\_20) [x86-java]

C:\Users\gthiesfeld\Work\repo\>jirb  
irb(main):001:0\> `ruby test.rb`  
=\> "Hello world!\n4\n"  
irb(main):002:0\> exit

> **···**
>
> On Wed, Jun 30, 2010 at 1:23 PM, Gourav Tiwari \<gouravtiwari21@gmail.com\> wrote:
> 
> > Thanks for the reply Gordon
> > 
> > I will give it a try, by the way, I am using ruby 1.8.6 and jruby 1.5.1
