PecanProject / bety

Web-interface to the Biofuel Ecophysiological Traits and Yields Database (used by PEcAn and TERRA REF)
https://www.betydb.org
BSD 3-Clause "New" or "Revised" License
16 stars 38 forks source link

Issue installing Ruby gems #329

Closed serbinsh closed 9 years ago

serbinsh commented 9 years ago

I am hitting a snag with the BETYdb Ruby gem installs for the web DB connection interface and the rails backend. In addition I am concerned I am not installing properly. First, here is my install command:

[root@test bety]# /opt/ruby-2.1.0/bin/bundle install --without development:test:javascript_testing:debug
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.

My Ruby is at /opt/ruby-2.1.0 so I was using sudo su then installing, but it warns not to use root?

Also, I hit a snag with the pg 0.17 gem.

Installing pg 0.17.0 with native extensions

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

    /opt/ruby-2.1.0/bin/ruby -r ./siteconf20150626-32919-tyf2hd.rb extconf.rb
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
 --with-pg-config=/path/to/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** 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=/opt/ruby-2.1.0/bin/ruby
    --with-pg
    --without-pg
    --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}/lib

extconf failed, exit code 1

Gem files will remain installed in /opt/ruby-2.1.0/lib/ruby/gems/2.1.0/gems/pg-0.17.0 for inspection.
Results logged to /opt/ruby-2.1.0/lib/ruby/gems/2.1.0/extensions/x86_64-linux/2.1.0/pg-0.17.0/gem_make.out
An error occurred while installing pg (0.17.0), and Bundler cannot continue.
Make sure that `gem install pg -v '0.17.0'` succeeds before bundling.

I tried this but it still didn't work?

/opt/ruby-2.1.0/bin/gem install pg --with-pg_config=/usr/pgsql-9.4/bin/pg_config

ANy others have this issue? Also, how should I be installing the gems? Should I not install in the Ruby dir? Seems strange to not do that? Do I need to change the permissions for that folder?

@dlebauer @robkooper @mdietze

serbinsh commented 9 years ago

Sorry here is the other command:

[root@test bety]# /opt/ruby-2.1.0/bin/gem install pg --with-pg-config=/usr/pgsql-9.4/bin/pg_config
ERROR:  While executing gem ... (OptionParser::InvalidOption)
    invalid option: --with-pg-config=/usr/pgsql-9.4/bin/pg_config
serbinsh commented 9 years ago

Tried adding to path, no luck

[root@test bety]# $PATH
bash: /usr/pgsql-9.4/bin/pg_config:/sbin:/bin:/usr/sbin:/usr/bin:/opt/dell/srvadmin/bin:/opt/dell/srvadmin/sbin: No such file or directory

Still fails???

serbinsh commented 9 years ago

@mdietze @robkooper @dlebauer

Fixed! I had to run this first:

bundle config build.pg --with-pg-config=/usr/pgsql-9.4/bin/pg_config

then I re-ran

bundle install --without development:test:javascript_testing:debug

and it finished fine

Bundle complete! 30 Gemfile dependencies, 55 gems now installed.
Gems in the groups development, test, javascript_testing and debug were not installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
Post-install message from rdoc:
Depending on your version of ruby, you may need to install ruby rdoc/ri data:

<= 1.8.6 : unsupported
 = 1.8.7 : gem install rdoc-data; rdoc-data --install
 = 1.9.1 : gem install rdoc-data; rdoc-data --install
>= 1.9.2 : nothing to do! Yay!
Post-install message from rails3-restful-authentication:
**************************************************

  Thank you for installing rails3-restful-authentication-3.0.1!

  This version ofrestful-authentication only works with
  versions of rails >= 3.0.0.pre.

**************************************************
Post-install message from ruby-graphviz:

Since version 0.9.2, Ruby/GraphViz can use Open3.popen3 (or not)
On Windows, you can install 'win32-open3'

You need to install GraphViz (http://graphviz.org/) to use this Gem.

For more information about Ruby-Graphviz :
* Doc : http://rdoc.info/projects/glejeune/Ruby-Graphviz
* Sources : http://github.com/glejeune/Ruby-Graphviz
* NEW - Mailing List : http://groups.google.com/group/ruby-graphviz

Last (important) changes :
* GraphViz#add_edge is deprecated, use GraphViz#add_edges
* GraphViz#add_node is deprecated, use GraphViz#add_nodes
* GraphViz::Edge#each_attribut is deprecated, use GraphViz::Edge#each_attribute
* GraphViz::GraphML#attributs is deprecated, use GraphViz::GraphML#attributes
* GraphViz::Node#each_attribut is deprecated, use GraphViz::Node#each_attribute

This might be good to add to the instructions / wiki.

serbinsh commented 9 years ago

@robkooper or @dlebauer Can you please add this as a possible note to others who are installing Ruby for BETYdb? I think it would be helpful to have this as a sidenote in case others need to define the location of the psql libs/bins, as I did during install.

I don't have wiki edit privileges, at least not for BETY (i think)

Then we can close

dlebauer commented 9 years ago

@serbinish ... I gave you edit privileges ... (I think)

On Mon, Jun 29, 2015 at 3:44 PM, Shawn P. Serbin notifications@github.com wrote:

@robkooper https://github.com/robkooper or @dlebauer https://github.com/dlebauer Can you please add this as a possible note to others who are installing Ruby for BETYdb? I think it would be helpful to have this as a sidenote in case others need to define the location of the psql libs/bins, as I did during install.

I don't have wiki edit privileges, at least not for BETY (i think)

Then we can close

— Reply to this email directly or view it on GitHub https://github.com/PecanProject/bety/issues/329#issuecomment-116840427.

serbinsh commented 9 years ago

Done