Install SQLite3 in Ubuntu

  1. Install Sqlite3
    sudo apt-get install sqlite3 libsqlite3-dev
    sudo gem install sqlite3-ruby
  2. To create a data base, we only need to create a empty file.
    touch database_name_dev.db
    touch database_name_test.db
    touch database_name_prod.db
  3. Configure Ruby on Rails Modificar el archivo config/database.yml:
      adapter: sqlite3
      database: db/database_name_dev.db
      adapter: sqlite3
      database: db/database_name_test.db
      adapter: sqlite3
      database: db/database_name_prod.db
About these ads

23 comments so far

  1. Nuno Caldeira on

    very usefull.. thank you

  2. Chris on

    Just what I needed, thanks!

  3. pat on

    thanks! just used this, complete success!

  4. kishore on

    Thank you it solved my problem too..

  5. XhtmlWeaver on

    Very neat instruction for sqllite3 for ubuntu/debian. Great!

  6. chamira on

    thanks you for this, i needed to install libsqlite3-dev for the Ruby gem sqlite3-ruby to install correctly.

  7. Dextersmart on

    This was exactly what I needed. Thanks for the solution.

  8. Dheeraj.k on

    krishna@ubuntu:~$ sudo gem install sqlite3-ruby
    sudo: gem: command not found

    • Lolcat on

      (note i use ruby 1.8 therefore I use rubygems1.8)
      Firstly did you install ruby gems ?
      sudo apt-get install rubygems1.8
      Now lets find gems!
      sudo dpkg -L rubygems1.8 | grep /usr/bin
      … so we see its called gem1.8 and *not* gems , which explains command not found.
      Lets make a link from /usr/bin/gem1.8 to /usr/bin/gems
      sudo ln -s /usr/bin/gem1.8 /usr/bin/gems

      now finally run gems -v to check it is working.

  9. RyanonRails on

    Some people might needs to run apt-get install libsqlite3-ruby to get all of the dependencies.

  10. SeanW on

    Thanks RyanonRails!

    Your advice (+ the one to apt-get ruby-dev in order to install gems properly) saved my day. Later this week trying to install on Windows7.

  11. someone on

    Amazing, Thanks! xD

  12. UnderTech09 on

    ;need some help here…
    how to install in ubuntu?
    when i run my mysql with the server game, i got an error
    * error while loading shared libraries: cannot open share object file: no such file or directory.

    anyone can help up with this problem?
    thanks in advance..

  13. Upender on

    very thanks..

  14. shirish herwade on

    very useful

  15. Asma on

    sudo: gem: command not found :(

    • Pedro on

      Yo need to install ruby gems, but only if you are planning to use ruby or ruby on rails

  16. Robbie Done on

    worked a treat :D

    • Pedro on

      Great, nice to see that 5 years later is still useful.

  17. on

    I’ll right away take hold of your rss feed as I can’t to find your email
    subscription link or newsletter service. Do you’ve any? Please allow me realize so that I may just subscribe. Thanks.

  18. Mark on

    Not so far I have found new cool tool to work with SQLite on ubuntu – Valentina Studio. Its free edition can do things more than many commercial tools!!
    I very recommend check it.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

%d bloggers like this: