|
This is what I done:
$ ./rubyconsole
bash-4.0$ cd projects/rails_project
bash-4.0$ ruby script/server
=> Booting Mongrel
=> Rails 2.3.2 application starting on http://0.0.0.0:3000
/Tuope/Software/RoR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:76:in `establish_connection’: Please install the postgresql adapter: `gem install activerecord-postgresql-adapter` (no such file to load — pg) (RuntimeError)
from /Tuope/Software/RoR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:60:in `establish_connection’
from /Tuope/Software/RoR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:55:in `establish_connection’
from /Tuope/Software/RoR/ruby/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/initializer.rb:417:in `initialize_database’
from /Tuope/Software/RoR/ruby/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/initializer.rb:141:in `process’
from /Tuope/Software/RoR/ruby/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/initializer.rb:113:in `send’
from /Tuope/Software/RoR/ruby/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/initializer.rb:113:in `run’
from /Tuope/Software/RoR/projects/Majava/config/environment.rb:9
from /Tuope/Software/RoR/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require’
from /Tuope/Software/RoR/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require’
from /Tuope/Software/RoR/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require’
from /Tuope/Software/RoR/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in’
from /Tuope/Software/RoR/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require’
from /Tuope/Software/RoR/ruby/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/commands/server.rb:84
from /Tuope/Software/RoR/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require’
from /Tuope/Software/RoR/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require’
from script/server:3
bash-4.0$
After that I try to install postgres gem
bash-4.0$ gem install postgres
Building native extensions. This could take a while…
ERROR: Error installing postgres:
ERROR: Failed to build gem native extension.
/Tuope/Software/RoR/ruby/bin/ruby extconf.rb
checking for main() in -lpq… no
- 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=/Tuope/Software/RoR/ruby/bin/ruby
—with-pgsql-dir
—without-pgsql-dir
—with-pgsql-include
—without-pgsql-include=${pgsql-dir}/include
—with-pgsql-lib
—without-pgsql-lib=${pgsql-dir}/lib
—with-pqlib
—without-pqlib
Could not find PostgreSQL build environment (libraries & headers): Makefile not created
Gem files will remain installed in /Tuope/Software/RoR/ruby/lib/ruby/gems/1.8/gems/postgres-0.7.9.2008.01.28 for inspection.
Results logged to /Tuope/Software/RoR/ruby/lib/ruby/gems/1.8/gems/postgres-0.7.9.2008.01.28/ext/gem_make.out
I cannot figure out how to give these configuration options to gem. I would imagine I need to tell it that the postgresql directory is in
/Tuope/Software/RoR/postgresql . But gem keeps complaining about invalid options. Like
bash-4.0$ gem install postgres —with-pgsql-dir=/Tuope/Software/RoR/postgresql
ERROR: While executing gem … (OptionParser::InvalidOption)
invalid option: —with-pgsql-dir=/Tuope/Software/RoR/postgresql
|