sudo gem install pg won't work

后端 未结 2 483
囚心锁ツ
囚心锁ツ 2020-12-31 06:12

I\'m trying to get Rails to work with PostgreSQL. Apparently one thing I need to do along the way is sudo gem install pg. When I do that, I get this:

         


        
相关标签:
2条回答
  • 2020-12-31 06:38

    You need to install your distro ruby-dev (or devel) package otherwise you won~t be able to build any ruby C extensions.

    I'm not on ubuntu, but you package-manager command might be somewhat like this:

    $ sudo apt-get install ruby-dev build-essential
    
    0 讨论(0)
  • 2020-12-31 06:40

    On Ubuntu:

    $ sudo apt-get install postgresql-client libpq5 libpq-dev
    $ sudo gem install pg
    
    0 讨论(0)
提交回复
热议问题