Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install sqlite or postgresql on windows 8 for a ruby on rails setup?

I've been trying to install a database as part of my ruby on rails setup. I'm running a 64 bit windows 8, a x64 based machine. My ruby version is 2.1.3p242, rails version is 4.0.0, sqlite3 version is 3.8.6 and postgresql version is 9.3 I first tried to install sqlite3 by following the steps given in this SO answer but I get this error

`require': Could not load 'active_record/connection_adapters/sqlite3_adapter'. Make sure that the adapter in config/database.yml is valid.

My database.yml has 'sqlite3' as the value for the adapter key for all three environments.
Next I try to installed postgresql which was installed properly. I fired up the pgadmin3 GUI and started the database server. But when I start the rails server. I get the following error

C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/pg-0.17.1-x64-mingw32/lib/pg.rb:10:in `re
quire': cannot load such file -- 2.1/pg_ext (LoadError)

Thanks.

like image 539
Akshay Takkar Avatar asked Feb 18 '26 16:02

Akshay Takkar


1 Answers

You need to use the pre release of pg.

  1. Install

    gem install pg -v 0.18.0.pre20141117110243 --pre
    
  2. Add to your Gem file

    gem 'pg', '~> 0.18.0.pre20141117110243'
    
  3. Update with Bundle

    bundle update
    
like image 66
Rots Avatar answered Feb 20 '26 13:02

Rots



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!