# JRuby rake not working!

**URL:** <https://www.ruby-forum.com/t/jruby-rake-not-working/182992>\
**Category:** Ruby\
**Created:** [February 5, 2010, 6:21pm UTC](https://www.ruby-forum.com/t/jruby-rake-not-working/182992 "2010-02-05T18:21:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tutiplain](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/77aa72/32.png) [@tutiplain](https://www.ruby-forum.com/u/tutiplain)\
**Post date:** [February 5, 2010, 6:21pm UTC](https://www.ruby-forum.com/t/jruby-rake-not-working/182992/1 "2010-02-05T18:21:00Z")

</div>

Hello all,

I am trying out Rails using JRuby. I set up a Rails app using  
netbeans, and installed all the necessary gems, including  
activerecord-jdbc-adapter, and rake. However, whenever I try to run a  
migration using "rake db:migrate, I get a message saying:

Error opening script file: C:/jruby/projects/RecetaDB/rake (The system  
cannot fi  
nd the file specified)

It is obvious that rake is not in that folder, although the rake file  
is, but how can I fix it? Note that I also use ruby one click instaler  
on this same machine. Could it be an environment variable problem?

---

<div class="post-metadata">

**Author:** ![tutiplain](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/77aa72/32.png) [@tutiplain](https://www.ruby-forum.com/u/tutiplain)\
**Post date:** [February 5, 2010, 7:02pm UTC](https://www.ruby-forum.com/t/jruby-rake-not-working/182992/2 "2010-02-05T19:02:22Z")

</div>

On Fri, Feb 5, 2010 at 11:21 AM, tuti plain [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> It is obvious that rake is not in that folder, although the rake file  
> is, but how can I fix it? Note that I also use ruby one click instaler  
> on this same machine. Could it be an environment variable problem?

Could be a number of things, PATH environment variable, bug in JRuby  
launcher scripts, etc. What about “jruby -S rake”? Maybe you’re  
picking up a different rake than you expected.

/Nick

---

<div class="post-metadata">

**Author:** ![tutiplain](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/77aa72/32.png) [@tutiplain](https://www.ruby-forum.com/u/tutiplain)\
**Post date:** [February 5, 2010, 8:48pm UTC](https://www.ruby-forum.com/t/jruby-rake-not-working/182992/3 "2010-02-05T20:48:28Z")

</div>

Hi,

I was solve to do the migration by explicitly specifying the path of  
rake:

jruby c:\jruby\bin\rake db:migrate

I had to install the jdbc adapter gem after that, but it worked.

---

<div class="post-metadata">

**Author:** ![tutiplain](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/77aa72/32.png) [@tutiplain](https://www.ruby-forum.com/u/tutiplain)\
**Post date:** [March 5, 2010, 4:54pm UTC](https://www.ruby-forum.com/t/jruby-rake-not-working/182992/4 "2010-03-05T16:54:51Z")

</div>

On Fri, Feb 5, 2010 at 1:48 PM, tuti plain [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Hi,
> 
> Â I was solve to do the migration by explicitly specifying the path of  
> rake:
> 
> jruby c:\jruby\bin\rake db:migrate

I concur with Nick…something’s strange about your PATH

What do you get if you type

dir C:\jruby\bin\*.bat

??

Is there a rake.bat there?

What version of JRuby?

- Charlie
