Hi, Should I be able to use the Webrick postamble instead of using .campingrc, to tell Camping I want to use mysql? It doesn''t seem to be working for me. It does work however, when I''m using FastCGI (establish_connection :adapter => ''mysql''). James
This may be obvious, but are you also adding on the extra parameters Mysql needs, like :username, :password, :database? -- Eric On 1/22/07, James Earl <jamesd.earl at gmail.com> wrote:> Hi, > > Should I be able to use the Webrick postamble instead of using > .campingrc, to tell Camping I want to use mysql? It doesn''t seem to > be working for me. It does work however, when I''m using FastCGI > (establish_connection :adapter => ''mysql''). > > James > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >
No prob, I am adding the extra parameters. I test it by just deleting/recreating the .campingrc file and reloading my app. When .campingrc isn''t there, Camping will create the .camping.db and give me an error since it doesn''t contain any of my tables. All the while I have this as my postamble: if __FILE__ == $0 MyApp::Models::Base.establish_connection :adapter => ''mysql'', :database => ''mydb'', :username => ''myuser'', :password => ''mypw'', :host => ''myhost'' end I''ve also tried the complete webrick postamble example from the camping wiki with no change. As soon as I add my .campingrc back, it uses the mysql adapter without a problem. James On 1/22/07, Eric Mill <kprojection at gmail.com> wrote:> This may be obvious, but are you also adding on the extra parameters > Mysql needs, like :username, :password, :database? > > -- Eric > > On 1/22/07, James Earl <jamesd.earl at gmail.com> wrote: > > Hi, > > > > Should I be able to use the Webrick postamble instead of using > > .campingrc, to tell Camping I want to use mysql? It doesn''t seem to > > be working for me. It does work however, when I''m using FastCGI > > (establish_connection :adapter => ''mysql''). > > > > James > > _______________________________________________ > > Camping-list mailing list > > Camping-list at rubyforge.org > > http://rubyforge.org/mailman/listinfo/camping-list > > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >
On Mon, Jan 22, 2007 at 03:42:55PM -0700, James Earl wrote:> No prob, I am adding the extra parameters. I test it by just > deleting/recreating the .campingrc file and reloading my app. When > .campingrc isn''t there, Camping will create the .camping.db and give > me an error since it doesn''t contain any of my tables. All the while > I have this as my postamble: > > if __FILE__ == $0 > MyApp::Models::Base.establish_connection :adapter => ''mysql'', > :database => ''mydb'', :username => ''myuser'', :password => ''mypw'', :host > => ''myhost'' > endTo use MySQL, the .campingrc would be: database: adapter: mysql database: mydb username: myuser password: mypw host: myhost Use a postamble[1] if you want your application to work without reading .campingrc. Rather than `camping myapp.rb`, use `ruby myapp.rb`. So then __FILE__ == $0. _why [1] http://code.whytheluckystiff.net/camping/wiki/PostAmbles
On 1/22/07, why the lucky stiff <why at whytheluckystiff.net> wrote:> To use MySQL, the .campingrc would be: > > database: > adapter: mysql > database: mydb > username: myuser > password: mypw > host: myhost > > Use a postamble[1] if you want your application to work without reading > .campingrc. Rather than `camping myapp.rb`, use `ruby myapp.rb`. > So then __FILE__ == $0.Thanks, everything is a lot clearer now.