2

Ive been trying out Rubymine for a small rails project and would really like the debugging to work. The project is a rails API and uses Postgres running on my Mac with El Capitan. The problem i have is Rubymine is complaining of 'No Rails found in SDK'

I thought the solution to this was to run bundle install from the Rubymine menu. However that consistently fails at installing pg:

....
Using hashie 3.4.3
Using multi_json 1.11.2
Using multi_xml 0.5.5
Using newrelic_rpm 3.14.2.312    
Installing pg 0.18.4 with native extensions


Gem::Ext::BuildError: ERROR: Failed to build gem native extension.


    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r ./siteconf20160617-92261-aw26bh.rb extconf.rb
checking for pg_config... yes
Using config values from /usr/local/bin/pg_config
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for pg_config_manual.h... yes
checking for PQconnectdb() in -lpq... no
checking for PQconnectdb() in -llibpq... no
checking for PQconnectdb() in -lms/libpq... no
Can't find the PostgreSQL client library (libpq)
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
    --with-pg
    --without-pg
    --enable-windows-cross
    --disable-windows-cross
    --with-pg-config
    --without-pg-config
    --with-pg_config
    --without-pg_config
    --with-pg-dir
    --without-pg-dir
    --with-pg-include
    --without-pg-include=${pg-dir}/include
    --with-pg-lib
    --without-pg-lib=${pg-dir}/
    --with-pqlib
    --without-pqlib
    --with-libpqlib
    --without-libpqlib
    --with-ms/libpqlib
    --without-ms/libpqlib

extconf failed, exit code 1

...
Using faraday 0.9.2
Using hashie-forbidden_attributes 0.1.1
Using httparty 0.13.7
An error occurred while installing pg (0.18.4), and Bundler cannot continue.
Make sure that `gem install pg -v '0.18.4'` succeeds before bundling.

I have tried numerous of the other solutions on stack overflow including: Bundler::GemNotFound: Could not find rake-10.3.2 in any of the sources An error occurred while installing pg (0.17.1), and Bundler cannot continue

and have installed postgres on my machine (i think) using the app and brew.

Any ideas for making this work would be greatly appreciated!

Community
  • 1
  • 1
Ben Easton
  • 195
  • 8
  • If can you post the entire output (preferably formatted as code, see [formatting](http://stackoverflow.com/help/formatting)), you will save a lot of guesswork. – grochmal Jun 16 '16 at 23:48
  • have you tried installing [railsintaller](http://railsinstaller.org/en)? thats what i did and it works well on rubymine – mrvncaragay Jun 16 '16 at 23:50
  • @grochmal good point, i have added the rest of the relevant output, just without the listings of all the other gems installed and such – Ben Easton Jun 17 '16 at 00:17
  • @Marv-C that sounds great but it doesnt support osx el capitan, probably should have mentioned im running that too! – Ben Easton Jun 17 '16 at 00:17
  • All you really need are the `postgres` headers (and libs), you need the `postgresql-dev` package for your OS. – grochmal Jun 17 '16 at 00:20
  • Try sudo apt-get install libpq-dev – vipin Jun 17 '16 at 03:18
  • I have done brew install postrgres and that is all installed fine. gem install pg works fine on a system level its only inside rubymine that it fails. Maybe i dont need to run bundler-install in Rubymine but i cant think of another way to get debugging to work :/ – Ben Easton Jun 17 '16 at 11:42

1 Answers1

0

I don't think the error is RubyMine-related; I think it's system-related.

That is, if you do gem install pg on the command line, I suspect you'll get the same error.

I use rvm and it just works. It installs the necessary system libraries. (That said, others have had difficulties from time to time.)

If you're interested in using rvm, google "install rvm" to get the link for the installation instructions.

That said, you should make sure RubyMine is configured for your project to use the same Ruby you are using on the command line. That way, you will get consistent results in both environments.

Also. just FYI, you can email support@jetbrains.com for RubyMine questions.

Keith Bennett
  • 4,722
  • 1
  • 25
  • 35
  • So thats what i was thinking but surprisingly gem install pg on the command line works just fine. Its only in Rubymine bundler->install that there is an issue will check out rvm thanks! – Ben Easton Jun 17 '16 at 11:39