Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7899675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:46:01+00:00 2026-06-03T08:46:01+00:00

I’ve read up on the documentation on how to do this, but in practice,

  • 0

I’ve read up on the documentation on how to do this, but in practice, I am having problems.
In my app, I have 2 different databases as described below in my database.yml file.

sqlite_test:
    adapter: sqlite3
    database: db/sqlite_test.sqlite3
    table: plots
    pool: 5
    timeout: 5000

development:
  adapter: mysql2
  encoding: utf8
  reconnect: false
  database: test
  pool: 5
  username: myname
  password: mypassword
  host: localhost

My application is a dynamic plotter that will plot the data in a (basic) database without having knowledge of whats in the database, or how its structured. Both of these databases contain different data. The SQLite database I created in a separate Rails app.

The current app I’m using is built around the MYSQL database, which I build externally.
I copied the SQLite database into the /db directory. So in my main model, when I say:

  class Plot < ActiveRecord::Base

  establish_connection :development
  set_table_name "stock_test"
  set_primary_key :id

Everything works out just fine and dandy. However, when I change it to:

 establish_connection :sqlite_test
 set_table_name "plots"

and try to access that database via the Rails console, I get an error saying:

>>ActiveRecord::AdapterNotSpecified: database configuration does not specify adapter

I don’t know why that is, since the database.yml file clearly does specify an adapter?
When I do it by hand in my model though, everything works exactly as it should.

class Plot < ActiveRecord::Base
establish_connection(:adapter => "sqlite3", :database => "db/sqlite_test.sqlite3", :pool => 5 )

Why does it all work when I manually specify whats in the database.yml, but not when I just use the database.yml reference?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T08:46:03+00:00Added an answer on June 3, 2026 at 8:46 am

    I tried to replicate and got it to work. It has to do with naming conventions:
    You’re in development mode and AR will look for the development tag, which in your case does not exist for sqlite.

    Here is my database.yml:

    development:
      adapter: mysql2
      database: se_development
      username: root
      pool: 5
      timeout: 5000
    
    sqlite_development:
      adapter: sqlite3
      database: db/development.sqlite3
      pool: 5
      timeout: 5000
    

    Here is the model:

    class Plot < ActiveRecord::Base
      establish_connection 'sqlite_' + Rails.env
    end
    

    Worked for me. Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
Does anyone know how can I replace this 2 symbol below from the string
I have a reasonable size flat file database of text documents mostly saved in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.