3
votes

I want to host my rails website on Amazon Elestic Beanstalk. I followed this guide : http://docs.amazonwebservices.com/elasticbeanstalk/latest/dg/create_deploy_Ruby_rails.html.

Now, I have this error : Ruby (Rack) application could not be started

Error message:

Could not find rake-10.0.2 in any of the sources (Bundler::GemNotFound) Exception class:

PhusionPassenger::UnknownError Application root:

/var/app/current

0 /usr/share/ruby/1.9/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/spec_set.rb 90 in `block in materialize'

1 /usr/share/ruby/1.9/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/spec_set.rb 83 in `map!'

2 /usr/share/ruby/1.9/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/spec_set.rb 83 in `materialize'

3 /usr/share/ruby/1.9/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/definition.rb 113 in `specs'

4 /usr/share/ruby/1.9/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/definition.rb 158 in `specs_for'

5 /usr/share/ruby/1.9/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/definition.rb 147 in `requested_specs'

6 /usr/share/ruby/1.9/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/environment.rb 23 in `requested_specs'

7 /usr/share/ruby/1.9/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/runtime.rb 11 in `setup'

8 /usr/share/ruby/1.9/gems/1.9.1/gems/bundler-1.2.1/lib/bundler.rb 116 in `setup'

9 /var/lib/passenger-standalone/3.0.17-x86_64-ruby1.9.3-linux-gcc4.4.6-1002/support/lib/phusion_passenger/utils.rb 326 in `prepare_app_process'

10 /var/lib/passenger-standalone/3.0.17-x86_64-ruby1.9.3-linux-gcc4.4.6-1002/support/lib/phusion_passenger/rack/application_spawner.rb 156 in `block in initialize_server'

11 /var/lib/passenger-standalone/3.0.17-x86_64-ruby1.9.3-linux-gcc4.4.6-1002/support/lib/phusion_passenger/utils.rb 563 in `report_app_init_status'

12 /var/lib/passenger-standalone/3.0.17-x86_64-ruby1.9.3-linux-gcc4.4.6-1002/support/lib/phusion_passenger/rack/application_spawner.rb 154 in `initialize_server'

13 /var/lib/passenger-standalone/3.0.17-x86_64-ruby1.9.3-linux-gcc4.4.6-1002/support/lib/phusion_passenger/abstract_server.rb 204 in `start_synchronously'

14 /var/lib/passenger-standalone/3.0.17-x86_64-ruby1.9.3-linux-gcc4.4.6-1002/support/lib/phusion_passenger/abstract_server.rb 180 in `start'

15 /var/lib/passenger-standalone/3.0.17-x86_64-ruby1.9.3-linux-gcc4.4.6-1002/support/lib/phusion_passenger/rack/application_spawner.rb 129 in `start'

16 /var/lib/passenger-standalone/3.0.17-x86_64-ruby1.9.3-linux-gcc4.4.6-1002/support/lib/phusion_passenger/spawn_manager_orig.rb 253 in `block (2 levels) in spawn_rack_application'

17 /var/lib/passenger-standalone/3.0.17-x86_64-ruby1.9.3-linux-gcc4.4.6-1002/support/lib/phusion_passenger/abstract_server_collection.rb 132 in `lookup_or_add'

18 /var/lib/passenger-standalone/3.0.17-x86_64-ruby1.9.3-linux-gcc4.4.6-1002/support/lib/phusion_passenger/spawn_manager_orig.rb 246 in `block in spawn_rack_application'

19 /var/lib/passenger-standalone/3.0.17-x86_64-ruby1.9.3-linux-gcc4.4.6-1002/support/lib/phusion_passenger/abstract_server_collection.rb 82 in `block in synchronize'

20 prelude> 10:in `synchronize'

21 /var/lib/passenger-standalone/3.0.17-x86_64-ruby1.9.3-linux-gcc4.4.6-1002/support/lib/phusion_passenger/abstract_server_collection.rb 79 in `synchronize'

22 /var/lib/passenger-standalone/3.0.17-x86_64-ruby1.9.3-linux-gcc4.4.6-1002/support/lib/phusion_passenger/spawn_manager_orig.rb 244 in `spawn_rack_application'

23 /var/lib/passenger-standalone/3.0.17-x86_64-ruby1.9.3-linux-gcc4.4.6-1002/support/lib/phusion_passenger/spawn_manager_orig.rb 137 in `spawn_application'

24 /var/lib/passenger-standalone/3.0.17-x86_64-ruby1.9.3-linux-gcc4.4.6-1002/support/lib/phusion_passenger/spawn_manager.rb 16 in `spawn_application_with_env'

25 /var/lib/passenger-standalone/3.0.17-x86_64-ruby1.9.3-linux-gcc4.4.6-1002/support/lib/phusion_passenger/spawn_manager_orig.rb 275 in `handle_spawn_application'

26 /var/lib/passenger-standalone/3.0.17-x86_64-ruby1.9.3-linux-gcc4.4.6-1002/support/lib/phusion_passenger/abstract_server.rb 357 in `server_main_loop'

27 /var/lib/passenger-standalone/3.0.17-x86_64-ruby1.9.3-linux-gcc4.4.6-1002/support/lib/phusion_passenger/abstract_server.rb 206 in `start_synchronously'

28 /var/lib/passenger-standalone/3.0.17-x86_64-ruby1.9.3-linux-gcc4.4.6-1002/support/helper-scripts/passenger-spawn-server 99 in `'

Nothing one the trace in on my source code. I didn't found anything on the Internet. You can find the source code of the application here : https://github.com/GCorbel/comment-my-projects.

1

1 Answers

3
votes

I was experiencing that, and found out that this isn't related with rake itself. That's happening probably because one of your gems isn't getting installed. In my case, it was pg that wasn't getting installed since it needs the pg_config executable.

So, in my case, to fix that, I added the following sections to .ebextensions/default.config:

packages:
  yum:
    git: []
    postgresql-devel: []

# Run rake tasks before an application deployment
container_commands:
  01bundler-pg:
    command: bundle config build.pg --with-pg-config=/usr/bin/pg_config

Even if you don't use pg, check if any of your gems needs development headers or executable files installed.

Reference: https://forums.aws.amazon.com/thread.jspa?messageID=400055