Juan P Reyes
Juan P Reyes

Reputation: 87

Configure a remote sqlite3 database on rails

I programmed an application using rails and I can deploy it on a single machine. It uses a sqlite3 database that is created in the local machine.

Now I need to put that db on another machine, but I have no idea how. I installed a rails environment on the other machine and sqlite3. I configured the database.yml file this way:

development:
  adapter: sqlite3
  database: db/development.sqlite3
  host: 172.**.**.**
  pool: 5
  timeout: 10000
  username: username
  password: password

However nothing happens. Do I need to configure something on the other machine? Am I missing something? Sorry if I seem ignorant, is the first time I do something like this.

Upvotes: 1

Views: 787

Answers (1)

Martin
Martin

Reputation: 7714

Out of the box, no, you cannot, and it's actually discouraged in SQLite own manual:

If you have many client programs accessing a common database over a network, you should consider using a client/server database engine instead of SQLite.

You can take a look at various solutions built around SQLite to solve this problem here.

However, a much better solution would be to switch to another RDBMS such as MySQL or Postgresql. It should not impact your app much (as ActiveRecord does a nice job of isolating you of the DB specific instruction).

Upvotes: 3

Related Questions