Reputation: 1449
I have a basic Rails app running with postgresql. Locally it's happy as a clam. I've run eb init, eb start, and eb status which returns the url, status ready, and health green. Locally, my changes are showing up on my rails app (nothing intense, just a root somewhere that isn't the beanstalk welcome screen). When I git aws.push it pushes to the correct environment name, happily pressed and compresses objects, ends with "remote to" + long string + "HEAD -> master (forced update)".
I wait until git "eb status" is green again (it says updating initially, so it's clearly going to the right place) and then go to the url specified...and the beanstalk greeting remains.
(No longer relevant; seems this solution only applies for earlier versions of rails; keeping it for comment clarity) This person (Amazon Web Services Beanstalk, git aws.push appears to push, but doesn't change anything) had a similar issue, but when I type "git rm public/index.html" I get "fatal: pathspec 'public/index.html' did not match any files".
I'm using Rails 4.0.1. Any ideas?
Edit:
I think the problem may be related to not using a RDS; when I used one, this issue did not exist. But on this app I'm trying to run a local Postgresql similar to how I'd do it on Heroku...
Edit:
My route file
App::Application.routes.draw do
resources :users
root "users#show"
end
Edit:
Looking at the EC2, in the recent activity it states
Instance: i-9ebf03b0 Module: AWSEBAutoScalingGroup ConfigSet: null] Command failed on instance.
Return code: 1 Output: Error occurred during build: Command hooks failed.
Looking in the logs I see this:
Installing pg (0.17.1)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9 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
Researching and trying a variety of things given the above; just wanted to keep helpful, inquiring people updated :)
Upvotes: 1
Views: 941
Reputation: 621
You're probably going to want to add that to a config so that it scales:
$ cat .ebextensions/postgres.config
packages:
yum:
postgresql-devel: []
Upvotes: 2
Reputation: 1449
Solved!
If I go to the EC2 instance handling the Rails App and type the following it fixes the problem.
sudo yum install postgresql postgresql-server postgresql-devel postgresql-contrib postgresql-docs postgresql-libs
In retrospect I wish I had entered the above one by one to see WHICH exactly was fixing the problem, but there it is all the same.
Upvotes: 0