Giter VIP home page Giter VIP logo

Comments (4)

ged avatar ged commented on August 22, 2024

Original comment by Anonymous.


First off, THANKS for the great work in the pg gem.

Interesting request. Many people hit this problem. In my recent blog post
(http://rails.vandenabeele.com/blog/2011/11/26/installing-ruby-and-rails-with-rvm-on-ubuntu-11-dot-10/)
I point to this problem and I am sure there must be another 100 blog posts
pointing this out.

Is there a structural way for a gem to explicitly mention the dependency
on system libraries (depending on the exact operating system it is
turning on; so it could say:

#!ruby
if dev_lib_missing
  problem_report =
    case OperatingSystem
    when /Ubuntu|Debian/
      "Install the libpq-dev package"
    when /RedHat/
       "Install ...
    when /Darwin/
       "Install ...
    else
      "Install the libraries with the postgresql header files"
    end
  end
...
end

from ruby-pg.

ged avatar ged commented on August 22, 2024

Original comment by Michael Granger (Bitbucket: ged, GitHub: ged).


@jrgifford: While I'd ideally like to provide good diagnostics for everyone who might want to use the library, mentioning prerequisites for every conceivable packaging strategy isn't realistic. I'd argue that if someone is installing a gem on a system that breaks software up into -dev and non-dev variants, they should either use the native packaging system to do it (as it's capable of expressing its own dependencies), or know enough about their own systems that they can responsibly install software outside of it without needing to be told that they're missing headers or whatever.

@Anonymous: There isn't any built-in way to do so that I know of, but one of my goals for the next release is to provide better diagnostics for installation problems. Part of that will be generating a better error message if the libraries/headers for libpq aren't found. While I don't think providing help tailored to every possible installation architecture/platform/OS is realistic, I can at the very least mention that it might be in a "-dev" package.

Thanks for the blog post, too! I can't possibly track down everyone who's having a problem, and people seem reluctant to actually ask the maintainer for help, so some useful advice for people googling "Can't find the 'libpq-fe.h header" or whatever will solve a lot of peoples' problems.

from ruby-pg.

ged avatar ged commented on August 22, 2024

Original comment by Michael Granger (Bitbucket: ged, GitHub: ged).


Removing milestone: 0.13.0 (automated comment)

from ruby-pg.

ged avatar ged commented on August 22, 2024

Original comment by Michael Granger (Bitbucket: ged, GitHub: ged).


Given that this gem now has a binary gem, I'm going to close this. Patches will of course be accepted that make it easier to install or diagnose installation problems on all platforms Ruby runs on.

from ruby-pg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.