Tag: sqlite3

  • Recreate Database – Ruby on Rails

    Hey everyone, Due to an issue with a few migrations in a dev environment I needed to recreate the database. A quick Google search revealed that it is possible to do this in a single line: #Execute via console rake db:drop db:create

  • sqlite3.h is missing – Ruby on Rails

    Just an error I ran into while running bundle install on a new ubuntu virtual: Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. /usr/bin/ruby1.8 extconf.rb checking for sqlite3.h… no sqlite3.h is missing. Try ‘port install sqlite3 +universal’ or ‘yum install sqlite-devel’ and check your shared library search path (the location where your sqlite3 shared library…

  • PostgreSQL Installation Error – Ruby

    I ran into a bit of problem moving an app to a test Heroku host – I needed to install PostgreSQL. I added the following to my Gemfile: #Gemfile #gem ‘sqlite3’ gem ‘pg’ I then tried to run bundle install: root@chris-VirtualBox:~/site# bundle install However I received the following error: root@chris-VirtualBox:~/site# bundle install Fetching source index…

  • undefined method `to_sym’ for nil:NilClass – Ruby on Rails Migration

    While trying to do a migration today I received the following message: undefined method `to_sym’ for nil:NilClass #After running a trace (rake db:migrate –trace) undefined method `to_sym’ for nil:NilClass /usr/lib/ruby/gems/1.8/gems/activesupport-3.1.1/lib/active_support/whiny_nil.rb:48:in `method_missing’ … This was the migration: class AddDefaultValuesToFeedbacks 0 change_column :stores, :rating, :decimal, :precision => 8, :scale => 2, :default => 0 end end Unfortunately…

  • How to View a Table’s Structure – Sqlite3

    Just a quick post on how to view a table’s structure in SQLite3. Again, not something I’ve broken yet – more something I seem to keep forgetting. Simply start Sqlite: chris@chris-VirtualBox:~/site$ sqlite3 -line db/development.sqlite3 SQLite version 3.7.4 Enter “.help” for instructions Enter SQL statements terminated with a “;” Then enter the following: – substituting orders…

  • View All Tables – Sqlite3

    Not really something that I’ve broken (yet), but definitely something I found useful when starting out with rails – how to view all tables: Start Sqlite3 i.e. chris@chris-VirtualBox:~/site$ sqlite3 -line db/development.sqlite3 SQLite version 3.7.4 Enter “.help” for instructions Enter SQL statements terminated with a “;” Then simply enter the following: sqlite> .tables carts message_recipients products…

Create a website or blog at WordPress.com