using jruby and mysql jdbc adapter

View: New views
7 Messages — Rating Filter:   Alert me  

using jruby and mysql jdbc adapter

by Bryan Noll :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm trying to get my project set up in cruisecontrol.rb and am running
into a wall.  I get the project added, force a build from the dashboard,
and immediately receive an error as follows.  (I grabbed the command it
tried to run and ran it manually from the same directory and got the
same output.  Here it is.)

bnoll@southpaw:~/tools/cruisecontrolrb-1.1.0/projects/olex/work$ ruby -e
"require 'rubygems' rescue nil; require 'rake'; load
'/home/bnoll/tools/cruisecontro
lrb-1.1.0/tasks/cc_build.rake'; ARGV << '--nosearch' << 'cc:build';
Rake.application.run"
(in /home/bnoll/tools/cruisecontrolrb-1.1.0/projects/olex/work)
[CruiseControl] Invoking Rake task "db:test:purge"
rake aborted!
database configuration specifies nonexistent jdbc adapter

(See full trace by running task with --trace)


-----

Now, we're using jruby on this project, and the jdbc adapter to talk to
a mysql database.  I'm sure the problem is in one of these two areas.  
Hoping that it would be this easy, I ran the exact same command as
above, except with 'jruby' instead of 'ruby'.  It didn't work either,
but I got a different error message.

bnoll@southpaw:~/tools/cruisecontrolrb-1.1.0/projects/olex/work$ jruby
-e "require 'rubygems' rescue nil; require 'rake'; load
'/home/bnoll/tools/cruisecontro
lrb- 1.1.0/tasks/cc_build.rake'; ARGV << '--nosearch' << 'cc:build';
Rake.application.run"
(in /home/bnoll/tools/cruisecontrolrb-1.1.0/projects/olex/work)
[CruiseControl] Invoking Rake task "db:test:purge"
[CruiseControl] Invoking Rake task "db:migrate"
rake aborted!
NativeException: java.sql.SQLException: No database selected: SELECT
version FROM schema_info

(See full trace by running task with --trace)



Any thoughts on how to proceed?

TIA...

Bryan




_______________________________________________
Cruisecontrolrb-users mailing list
Cruisecontrolrb-users@...
http://rubyforge.org/mailman/listinfo/cruisecontrolrb-users

Re: using jruby and mysql jdbc adapter

by thbar :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Any thoughts on how to proceed?

Just one hint: the message could indicate that the RAILS_ENV you
expect to be passed is  not the right one, which would make the
connection fails because database.yml would not contain the matching
information.

<snip>
WARNING: with Rails projects, it is important that RAILS_ENV does not
default to 'production'. Unless you want your migration scripts and
unit tests to hit your production database, of course.
CruiseControl.reb leaves this variable unchanged when invoking
'cruise' or other custom Rake task, and sets it to 'test' before
invoking the defaults.
</snip>

regards

-- Thibaut
_______________________________________________
Cruisecontrolrb-users mailing list
Cruisecontrolrb-users@...
http://rubyforge.org/mailman/listinfo/cruisecontrolrb-users

Re: using jruby and mysql jdbc adapter

by Bryan Noll :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thibaut...

Thanks, but I don't think this is what's happening.  I say that because
my database.yml has the configuration entries for all three db
environments.  So even if it's not using the one I expect it to (TEST),
it should still be connecting to something, right?

Thibaut Barrère wrote:

>> Any thoughts on how to proceed?
>>    
>
> Just one hint: the message could indicate that the RAILS_ENV you
> expect to be passed is  not the right one, which would make the
> connection fails because database.yml would not contain the matching
> information.
>
> <snip>
> WARNING: with Rails projects, it is important that RAILS_ENV does not
> default to 'production'. Unless you want your migration scripts and
> unit tests to hit your production database, of course.
> CruiseControl.reb leaves this variable unchanged when invoking
> 'cruise' or other custom Rake task, and sets it to 'test' before
> invoking the defaults.
> </snip>
>
> regards
>
> -- Thibaut
>
>  
_______________________________________________
Cruisecontrolrb-users mailing list
Cruisecontrolrb-users@...
http://rubyforge.org/mailman/listinfo/cruisecontrolrb-users

Re: using jruby and mysql jdbc adapter

by thbar :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thibaut...

Thanks, but I don't think this is what's happening.  I say that because
my database.yml has the configuration entries for all three db
environments.  So even if it's not using the one I expect it to (TEST),
it should still be connecting to something, right?

Yeah, that makes sense :) I have another suggestion then (just an idea): you could try to run ruby script/console directly on the CC machine and see what happens (possibly with different environments ?).


_______________________________________________
Cruisecontrolrb-users mailing list
Cruisecontrolrb-users@...
http://rubyforge.org/mailman/listinfo/cruisecontrolrb-users

Re: using jruby and mysql jdbc adapter

by Bryan Noll :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

OK... good thought.

Doing a 'ruby script/console' fails... not surprisingly, because this
project requires jruby.

Doing a 'jruby script/console' succeeds... saying "Loading development
environemtn." and providing a prompt.

Another thing... when I cd into [cruise]/work/ and do a 'rake test', it
works perfectly... but this is because when I do a 'which rake', I get
the one in the [JRUBY-1.0.1-HOME]/bin directory.

I google for this type of issue and find this:
http://www.nabble.com/cc.rb-under-JRuby-t4251955.html

Do the folks in on the dev list read this one?

Thibaut Barrère wrote:

>
>     Thibaut...
>
>     Thanks, but I don't think this is what's happening.  I say that
>     because
>     my database.yml has the configuration entries for all three db
>     environments.  So even if it's not using the one I expect it to
>     (TEST),
>     it should still be connecting to something, right?
>
>
> Yeah, that makes sense :) I have another suggestion then (just an
> idea): you could try to run ruby script/console directly on the CC
> machine and see what happens (possibly with different environments ?).
>
_______________________________________________
Cruisecontrolrb-users mailing list
Cruisecontrolrb-users@...
http://rubyforge.org/mailman/listinfo/cruisecontrolrb-users

Re: using jruby and mysql jdbc adapter

by Alexey Verkhovsky-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi,

Default build behavior is to run a process with "ruby -e"... Which generally means it will run under MRI.
You need to use project.build_command option in cruise_config.rb of your project, and put there something like 'jruby -S rake ...'.

--
Alex



Bryan Noll <bwnoll@...>
Sent by: cruisecontrolrb-users-bounces@...

09/04/2007 06:01 PM

To
cruisecontrolrb-users@...
cc
Subject
[Cruisecontrolrb-users] using jruby and mysql jdbc adapter





I'm trying to get my project set up in cruisecontrol.rb and am running
into a wall.  I get the project added, force a build from the dashboard,
and immediately receive an error as follows.  (I grabbed the command it
tried to run and ran it manually from the same directory and got the
same output.  Here it is.)

bnoll@southpaw:~/tools/cruisecontrolrb-1.1.0/projects/olex/work$ ruby -e
"require 'rubygems' rescue nil; require 'rake'; load
'/home/bnoll/tools/cruisecontro
lrb-1.1.0/tasks/cc_build.rake'; ARGV << '--nosearch' << 'cc:build';
Rake.application.run"
(in /home/bnoll/tools/cruisecontrolrb-1.1.0/projects/olex/work)
[CruiseControl] Invoking Rake task "db:test:purge"
rake aborted!
database configuration specifies nonexistent jdbc adapter

(See full trace by running task with --trace)


-----

Now, we're using jruby on this project, and the jdbc adapter to talk to
a mysql database.  I'm sure the problem is in one of these two areas.  
Hoping that it would be this easy, I ran the exact same command as
above, except with 'jruby' instead of 'ruby'.  It didn't work either,
but I got a different error message.

bnoll@southpaw:~/tools/cruisecontrolrb-1.1.0/projects/olex/work$ jruby
-e "require 'rubygems' rescue nil; require 'rake'; load
'/home/bnoll/tools/cruisecontro
lrb- 1.1.0/tasks/cc_build.rake'; ARGV << '--nosearch' << 'cc:build';
Rake.application.run"
(in /home/bnoll/tools/cruisecontrolrb-1.1.0/projects/olex/work)
[CruiseControl] Invoking Rake task "db:test:purge"
[CruiseControl] Invoking Rake task "db:migrate"
rake aborted!
NativeException: java.sql.SQLException: No database selected: SELECT
version FROM schema_info

(See full trace by running task with --trace)



Any thoughts on how to proceed?

TIA...

Bryan




_______________________________________________
Cruisecontrolrb-users mailing list
Cruisecontrolrb-users@...
http://rubyforge.org/mailman/listinfo/cruisecontrolrb-users


_______________________________________________
Cruisecontrolrb-users mailing list
Cruisecontrolrb-users@...
http://rubyforge.org/mailman/listinfo/cruisecontrolrb-users

Re: using jruby and mysql jdbc adapter

by Bryan Noll :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks Alexey!

That did it.

Alexey Verkhovsky wrote:

>
> Hi,
>
> Default build behavior is to run a process with "ruby -e"... Which
> generally means it will run under MRI.
> You need to use project.build_command option in cruise_config.rb of
> your project, and put there something like 'jruby -S rake ...'.
>
> --
> Alex
>
>
>
> *Bryan Noll <bwnoll@...>*
> Sent by: cruisecontrolrb-users-bounces@...
>
> 09/04/2007 06:01 PM
>
>
> To
> cruisecontrolrb-users@...
> cc
>
> Subject
> [Cruisecontrolrb-users] using jruby and mysql jdbc adapter
>
>
>
>
>
>
>
>
>
> I'm trying to get my project set up in cruisecontrol.rb and am running
> into a wall.  I get the project added, force a build from the dashboard,
> and immediately receive an error as follows.  (I grabbed the command it
> tried to run and ran it manually from the same directory and got the
> same output.  Here it is.)
>
> bnoll@southpaw:~/tools/cruisecontrolrb-1.1.0/projects/olex/work$ ruby -e
> "require 'rubygems' rescue nil; require 'rake'; load
> '/home/bnoll/tools/cruisecontro
> lrb-1.1.0/tasks/cc_build.rake'; ARGV << '--nosearch' << 'cc:build';
> Rake.application.run"
> (in /home/bnoll/tools/cruisecontrolrb-1.1.0/projects/olex/work)
> [CruiseControl] Invoking Rake task "db:test:purge"
> rake aborted!
> database configuration specifies nonexistent jdbc adapter
>
> (See full trace by running task with --trace)
>
>
> -----
>
> Now, we're using jruby on this project, and the jdbc adapter to talk to
> a mysql database.  I'm sure the problem is in one of these two areas.  
> Hoping that it would be this easy, I ran the exact same command as
> above, except with 'jruby' instead of 'ruby'.  It didn't work either,
> but I got a different error message.
>
> bnoll@southpaw:~/tools/cruisecontrolrb-1.1.0/projects/olex/work$ jruby
> -e "require 'rubygems' rescue nil; require 'rake'; load
> '/home/bnoll/tools/cruisecontro
> lrb- 1.1.0/tasks/cc_build.rake'; ARGV << '--nosearch' << 'cc:build';
> Rake.application.run"
> (in /home/bnoll/tools/cruisecontrolrb-1.1.0/projects/olex/work)
> [CruiseControl] Invoking Rake task "db:test:purge"
> [CruiseControl] Invoking Rake task "db:migrate"
> rake aborted!
> NativeException: java.sql.SQLException: No database selected: SELECT
> version FROM schema_info
>
> (See full trace by running task with --trace)
>
>
>
> Any thoughts on how to proceed?
>
> TIA...
>
> Bryan
>
>
>
>
> _______________________________________________
> Cruisecontrolrb-users mailing list
> Cruisecontrolrb-users@...
> http://rubyforge.org/mailman/listinfo/cruisecontrolrb-users
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Cruisecontrolrb-users mailing list
> Cruisecontrolrb-users@...
> http://rubyforge.org/mailman/listinfo/cruisecontrolrb-users
>  
_______________________________________________
Cruisecontrolrb-users mailing list
Cruisecontrolrb-users@...
http://rubyforge.org/mailman/listinfo/cruisecontrolrb-users