3

I began by installing all these dependencies:

sudo yum install ruby19 ruby19-devel gem rubygems19-devel make gcc postgresql9 postgresql9-devel postgresql9-server

Then I switch to the root user and I run

bundle install

and I get the green success message:

Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

However, when I cd to the dir and run

rails s -p80

it I get all this and it fails to start (I'm still root because bind won't work to port 80 if I'm not root):

/usr/local/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- pg_ext (LoadError)
    from /usr/local/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `block in require'
    from /usr/local/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /usr/local/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
    from /usr/local/share/gems/gems/pg-0.14.0/lib/pg.rb:4:in `<top (required)>'
    from /usr/local/share/gems/gems/bundler-1.2.0/lib/bundler/runtime.rb:68:in `require'
    from /usr/local/share/gems/gems/bundler-1.2.0/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
    from /usr/local/share/gems/gems/bundler-1.2.0/lib/bundler/runtime.rb:66:in `each'
    from /usr/local/share/gems/gems/bundler-1.2.0/lib/bundler/runtime.rb:66:in `block in require'
    from /usr/local/share/gems/gems/bundler-1.2.0/lib/bundler/runtime.rb:55:in `each'
    from /usr/local/share/gems/gems/bundler-1.2.0/lib/bundler/runtime.rb:55:in `require'
    from /usr/local/share/gems/gems/bundler-1.2.0/lib/bundler.rb:128:in `require'
    from /home/user/TransForm/config/application.rb:7:in `<top (required)>'
    from /usr/local/share/gems/gems/railties-3.2.8/lib/rails/commands.rb:53:in `require'
    from /usr/local/share/gems/gems/railties-3.2.8/lib/rails/commands.rb:53:in `block in <top (required)>'
    from /usr/local/share/gems/gems/railties-3.2.8/lib/rails/commands.rb:50:in `tap'
    from /usr/local/share/gems/gems/railties-3.2.8/lib/rails/commands.rb:50:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

Perhaps there is an easy way to just deploy it correctly from the begining instead of messing around with error craps? I need PostgreSQL. This app works everywhere except this AWS EC2 instance, so I know my Gemfile is correct. Any clues would help.

1
  • I've got almost the exact same problem. :( Commented Sep 19, 2012 at 6:11

2 Answers 2

1

open irb & type require "pg" does it work? if not, then check that pg_ext exists in /usr/local/share/gems/gems/pg-0.14.0/lib/ directory. you can install manually postgresql gem manually, using

gem install pg

If this still doesn't work, ensure that you are using latest version of ruby & latest version of rubygems using gem environment command.if its the older version, you can install latest ones using rvm

Sign up to request clarification or add additional context in comments.

Comments

0
        use gem pg 
            than 
             bundle install
             bundle update
               please not use any version of pg 
       I face this error and solved by this

1 Comment

I assume that this is a valid answer. Try to rephrase and reformat it to make it more understandable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.