1

I am having problem after i installed pg gem for postgreSQL using this:

subst X: "C:\Program Files (x86)\PostgreSQL\9.4"
gem install pg -- --with-pg-dir=X:
subst X: /D

after that when i try 'rails s' command i get this

    $ rails s
    c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/pg- 0.18.2/lib/pg.rb:14:in `
require': cannot load such file -- 2.1/pg_ext (LoadError)
        from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/pg-0.18.2/lib/
pg.rb:14:in `rescue in <top (required)>'
        from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/pg-0.18.2/lib/
pg.rb:3:in `<top (required)>'
        from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.10.5
/lib/bundler/runtime.rb:76:in `require'
        from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.10.5
/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
        from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.10.5
/lib/bundler/runtime.rb:72:in `each'
        from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.10.5
/lib/bundler/runtime.rb:72:in `block in require'
        from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.10.5
/lib/bundler/runtime.rb:61:in `each'
        from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.10.5
/lib/bundler/runtime.rb:61:in `require'
        from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.10.5
/lib/bundler.rb:134:in `require'
        from c:/Sites/myblog/config/application.rb:7:in `<top (required)>'
        from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.8
/lib/rails/commands/commands_tasks.rb:79:in `require'
        from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.8
/lib/rails/commands/commands_tasks.rb:79:in `block in server'
        from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.8
/lib/rails/commands/commands_tasks.rb:76:in `tap'
        from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.8
/lib/rails/commands/commands_tasks.rb:76:in `server'
        from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.8
/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
        from c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.8
/lib/rails/commands.rb:17:in `<top (required)>'
        from bin/rails:4:in `require'
        from bin/rails:4:in `<main>'

Imran@IMRAN-PC /c/Sites/myblog
$

plus i have also commented gem 'sqlite3' and added gem 'pg' in gemfile.

Any help would be appreciated

vee
  • 38,255
  • 7
  • 74
  • 78
Imran Aslam
  • 208
  • 2
  • 15

1 Answers1

0

Try to uninstall "pg" gem:

gem uninstall pg

Then run bundle (assuming Gemfile contains "pg" gem):

bundle
RAJ
  • 9,697
  • 1
  • 33
  • 63