Bryan Noll
2007-Sep-05 00:01 UTC
[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 at 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 at 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
Thibaut Barrère
2007-Sep-05 06:09 UTC
[Cruisecontrolrb-users] using jruby and mysql jdbc adapter
> 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
Bryan Noll
2007-Sep-05 15:06 UTC
[Cruisecontrolrb-users] using jruby and mysql jdbc adapter
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 > >
Thibaut Barrère
2007-Sep-05 15:22 UTC
[Cruisecontrolrb-users] using jruby and mysql jdbc adapter
> > 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 ?). -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/cruisecontrolrb-users/attachments/20070905/bb7be051/attachment-0001.html
Bryan Noll
2007-Sep-05 15:36 UTC
[Cruisecontrolrb-users] using jruby and mysql jdbc adapter
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 ?). >
Alexey Verkhovsky
2007-Sep-05 16:35 UTC
[Cruisecontrolrb-users] using jruby and mysql jdbc adapter
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 at gmail.com> Sent by: cruisecontrolrb-users-bounces at rubyforge.org 09/04/2007 06:01 PM To cruisecontrolrb-users at rubyforge.org 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 at 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 at 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 at rubyforge.org http://rubyforge.org/mailman/listinfo/cruisecontrolrb-users -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/cruisecontrolrb-users/attachments/20070905/a2a9e892/attachment.html
Bryan Noll
2007-Sep-05 17:17 UTC
[Cruisecontrolrb-users] using jruby and mysql jdbc adapter
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 at gmail.com>* > Sent by: cruisecontrolrb-users-bounces at rubyforge.org > > 09/04/2007 06:01 PM > > > To > cruisecontrolrb-users at rubyforge.org > 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 at 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 at 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 at rubyforge.org > http://rubyforge.org/mailman/listinfo/cruisecontrolrb-users > > ------------------------------------------------------------------------ > > _______________________________________________ > Cruisecontrolrb-users mailing list > Cruisecontrolrb-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/cruisecontrolrb-users >