rake gems (in /opt/SDK/domains/domain1/autodeploy/jruby_deploy_test) rake aborted! Please install the jdbcmysql adapter: `gem install activerecord-jdbcmysql-adapter` (no such file to load -- java)

hi, RoR.

i'm workin with RoR just 3 days, and i have this trouble:

# rake gems (in /opt/SDK/domains/domain1/autodeploy/jruby_deploy_test) rake aborted! Please install the jdbcmysql adapter: `gem install activerecord- jdbcmysql-adapter` (no such file to load -- java)

maybe i should write PATH to java in my .bashrc? or smth. else? thx

Luthien wrote:

hi, RoR.

i'm workin with RoR just 3 days, and i have this trouble:

# rake gems (in /opt/SDK/domains/domain1/autodeploy/jruby_deploy_test) rake aborted! Please install the jdbcmysql adapter: `gem install activerecord- jdbcmysql-adapter` (no such file to load -- java)

maybe i should write PATH to java in my .bashrc? or smth. else? thx

Did you follow the instructions in the error message?

Best,

of course:

# gem install activerecord-jdbcmysql-adapter Successfully installed activerecord-jdbcmysql-adapter-0.9.1 1 gem installed Installing ri documentation for activerecord-jdbcmysql- adapter-0.9.1... Updating class cache with 1519 classes... Installing RDoc documentation for activerecord-jdbcmysql- adapter-0.9.1...

but error message is still the same.. jruby script/server is working, but i can't migrate my db etc.

Uh, do you have both Ruby and JRuby on this machine?

If so I'd guess you need to do

# jruby -S gem install activerecord-jdbcmysql-adapter

yeap, but it doesn't change anything.. the result is the same

And you are also trying   # jruby -S rake gems ? (And are you really trying to run this all as root? Probably a bad idea.)

Anyway, if `jruby -S rake gems` is failing, show us the output of which jruby which java which gem which rake echo $PATH

luthien@luthien-laptop:~$ jruby -S rake gems /opt/jruby-1.3.1/bin/jruby: line 337: /etc/java//bin/java: No such file or directory /opt/jruby-1.3.1/bin/jruby: line 337: exec: /etc/java//bin/java: cannot execute: No such file or directory luthien@luthien-laptop:~$ which ruby /usr/local/bin/ruby luthien@luthien-laptop:~$ which java /usr/bin/java luthien@luthien-laptop:~$ which gem /usr/local/bin/gem luthien@luthien-laptop:~$ which rake /usr/local/bin/rake luthien@luthien-laptop:~$ echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/ games:/opt/jruby-1.3.1/lib/ruby/gems/1.8/gems/glassfish-0.9.5- universal-java/bin:/opt/jruby-1.3.1/bin/:/opt/jruby-1.3.1/lib/ruby/ gems/1.8/gems/

luthien@luthien-laptop:~$ jruby -S rake gems /opt/jruby-1.3.1/bin/jruby: line 337: /etc/java//bin/java: No such file or directory

luthien@luthien-laptop:~$ which java /usr/bin/java

OK, that's wierd -- what does `java -version` produce?

luthien@luthien-laptop:~$ echo $PATH

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/ games:

I would: delete => /opt/jruby-1.3.1/lib/ruby/gems/1.8/gems/glassfish-0.9.5-universal-java/bin put this first in your path => /opt/jruby-1.3.1/bin delete => /opt/jruby-1.3.1/lib/ruby/gems/1.8/gems

And try again, using the "jruby -S" command format

Ok, that is echo $PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/ X11R6/bin:/opt/jruby-1.3.1/bin/:/opt/SDK/bin/

thx a lot, but appears another problem:

# jruby -S rake gems (in /opt/SDK/domains/domain1/autodeploy/jruby_deploy_test)

I = Installed F = Frozen R = Framework (loaded before rails starts)

despite all gems are installed..

# jruby -S rake gems (in /opt/SDK/domains/domain1/autodeploy/jruby_deploy_test)

I = Installed F = Frozen R = Framework (loaded before rails starts)

despite all gems are installed..

that's not really a problem. "rake gems" reports gems used/frozen by the rails application you are located in (not all gems installed)

my guess: you are trying to call your cruby rake ("rake gems", see my post above) in a jruby rails application which requires activerecord- jdbcmysql-adapter which requires java (gem) which is only available for jruby...

thanks in advance. working correctly, i hope :slight_smile: