database setup for ocra complied rails app -
i'm trying package rails (3.2) app run on windows machine , i'm using ocra 'compile' app exe. after repeatedly banging head on desk i've managed app compile , run, have 1 problem remaining; database app packaged inside .exe while app runs , functions (new records can created , retrieved) temporary, when exe stopped changes database lost.
so guess need have database external app external exe. haven't managed make work. i've tried changing database path in database.yml several different values nothing i've tried works. examples i've seen connecting external database show connection being remote host , not local file.
want database file in same folder exe.
the compiled app runs in production mode, ocra command used build exe;
ocra myapp\script\rails myapp --add-all-core --gemfile myapp\gemfile --no-dep-run --gem-full --chdir-first -- server -e production
the database.yml after creating app
production: adapter: sqlite3 database: db/production.sqlite3 pool: 5 timeout: 5000
i've tried setting database:
production.sqlite
, ../production.sqlite
, placing database file in same folder compiled exe before running hasn't worked.
i've unfamiliar setting different databases i'm sure i'm missing key point here! appreciated, thanks!
i found answer in google-groups discussion orca related question, happened include database.yml config needed.
to have database external ocra compiled exe, such database file resides in same directory .exe, set database:
parameter in database.yml this;
<%= file.expand_path('../production.sqlite3', env["ocra_executable"]) %>
my compiled app runs in production mode how part of database.yml looks;
production: adapter: sqlite3 database: <%= file.expand_path('../production.sqlite3', env["ocra_executable"]) %> pool: 5 timeout: 5000
this works now, can run app.exe make new entry in db , terminate app.exe. when run app.exe again changes data still there.
Comments
Post a Comment