Error deploying Rails 5 app with Sinatra 2.0.0beta2 to Amazon Linux AMI - sinatra

I'm running into an exception with Sinatra 2.0.0 beta 2 with Rails 5 deploying to the Amazon Linux AMI v 2.1.6. I've posted the issue in the Sinatra Github repro but it's been suggested I post it here.
Edit: I ran into this using Elastic Beanstalk but as #neal reports, this also happens with Capistrano deploying to EC2.
Steps to reproduce the issue follow:
Make a new Rails 5 application in a clean directory
$ gem install rails
$ rails --version
(confirm Rails 5.0.0.1)
$ rails new test-app
Add this line to the gemfile:
gem 'sinatra', '2.0.0.beta2'
Create a new Elastic Beanstalk Web environment of type “64bit Amazon Linux 2016.03 v2.1.6 running Ruby 2.3 (Puma)”, Web server. Use all defaults except change the instance size to t2.small (anything smaller doesn’t have enough memory to deploy)
Add two new environment variables to the Elastic Beanstalk environment using the Web console
SECRET_KEY_BASE = (set a value for this)
RAILS_ENV = production
Deploy the application to this new environment, for example with the eb command line tools.
Deploy it again
Tail the logs through the Elastic Beanstalk console
RESULT:
-------------------------------------
/var/log/puma/puma.log
-------------------------------------
=== puma startup: 2016-08-26 02:39:12 +0000 ===
=== puma startup: 2016-08-26 02:39:12 +0000 ===
[15926] - Worker 0 (pid: 15929) booted, phase: 0
[15926] - Gracefully shutting down workers...
/opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/sinatra-2.0.0.beta2/lib/sinatra/main.rb:11:in `expand_path': No such file or directory - getcwd (Errno::ENOENT)
from /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/sinatra-2.0.0.beta2/lib/sinatra/main.rb:11:in `block in <class:Application>'
from (eval):1:in `run?'
from /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/sinatra-2.0.0.beta2/lib/sinatra/main.rb:26:in `block in <module:Sinatra>'
from /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/puma-3.6.0/lib/puma/cluster.rb:120:in `fork'
from /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/puma-3.6.0/lib/puma/cluster.rb:120:in `block in spawn_workers'
from /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/puma-3.6.0/lib/puma/cluster.rb:116:in `times'
from /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/puma-3.6.0/lib/puma/cluster.rb:116:in `spawn_workers'
from /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/puma-3.6.0/lib/puma/cluster.rb:426:in `run'
from /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/puma-3.6.0/lib/puma/launcher.rb:172:in `run'
from /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/puma-3.6.0/lib/puma/cli.rb:74:in `run'
from /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/puma-3.6.0/bin/puma:10:in `<top (required)>'
from /opt/rubies/ruby-2.3.1/bin/puma:23:in `load'
from /opt/rubies/ruby-2.3.1/bin/puma:23:in `<top (required)>'
from /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.1/lib/bundler/cli/exec.rb:63:in `load'
from /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.1/lib/bundler/cli/exec.rb:63:in `kernel_load'
from /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.1/lib/bundler/cli/exec.rb:24:in `run'
from /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.1/lib/bundler/cli.rb:304:in `exec'
from /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.1/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
from /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.1/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
from /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.1/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
from /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.1/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
from /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.1/lib/bundler/cli.rb:11:in `start'
from /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.1/exe/bundle:27:in `block in <top (required)>'
from /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.1/lib/bundler/friendly_errors.rb:98:in `with_friendly_errors'
from /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.1/exe/bundle:19:in `<top (required)>'
from /opt/rubies/ruby-2.3.1/bin/bundle:23:in `load'
from /opt/rubies/ruby-2.3.1/bin/bundle:23:in `<main>'
[15926] === puma shutdown: 2016-08-26 02:41:17 +0000 ===
[15926] - Goodbye!
=== puma startup: 2016-08-26 02:41:20 +0000 ===
=== puma startup: 2016-08-26 02:41:20 +0000 ===
[16296] - Worker 0 (pid: 16299) booted, phase: 0

This isn't just an elastic bean stalk issue, I can confirm it also happens when deploying a rails 5 app using capistrano / EC2 Ubuntu / nginx

Related

Installing and Running Postgres

So, I'm running Windows 11 on a Surface Pro 6. Hopefully that gives some background for the issue for any veterans in the constant battle of installing software on Windows.
The core of the issue is that my computer does not understand that PostgreSQL is installed on my machine, b also does, but also refuses to use it.
If you're interested here is the very long stack trace telling you that it doesn't understand postgres is running. This is, by the way, after restarting the server; it does say it is running. I've also ensured that it's an environment variable.
root#DESKTOP-5NH2GGL:/mnt/c/Users/jason/COSI 166/brandeis_class_hub# service postgresql status
12/main (port 5432): online
root#DESKTOP-5NH2GGL:/mnt/c/Users/jason/COSI 166/brandeis_class_hub# rails test
/root/.rbenv/versions/3.1.2/bin/ruby: warning: shebang line ending with \r may cause problems
/root/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4/lib/active_record/connection_adapters/postgresql_adapter.rb:87:in `rescue in new_client': FATAL: role "root" does not exist (ActiveRecord::ConnectionNotEstablished)
from /root/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4/lib/active_record/connection_adapters/postgresql_adapter.rb:77:in `new_client'
from /root/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `postgresql_connection'
from /root/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:656:in `public_send'
from /root/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:656:in `new_connection'
from /root/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:700:in `checkout_new_connection'
from /root/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:679:in `try_to_checkout_new_connection'
from /root/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:640:in `acquire_connection'
from /root/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:341:in `checkout'
from /root/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:181:in `connection'
from /root/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4/lib/active_record/connection_adapters/abstract/connection_handler.rb:211:in `retrieve_connection'
from /root/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4/lib/active_record/connection_handling.rb:313:in `retrieve_connection'
from /root/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4/lib/active_record/connection_handling.rb:280:in `connection'
from /root/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4/lib/active_record/internal_metadata.rb:17:in `enabled?'
from /root/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4/lib/active_record/tasks/database_tasks.rb:399:in `schema_up_to_date?'
from /root/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4/lib/active_record/migration.rb:635:in `block in load_schema_if_pending!'
from /root/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4/lib/active_record/migration.rb:634:in `all?'
from /root/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4/lib/active_record/migration.rb:634:in `load_schema_if_pending!'
from /root/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4/lib/active_record/migration.rb:655:in `block in maintain_test_schema!'
from /root/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4/lib/active_record/migration.rb:909:in `suppress_messages'
from /root/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4/lib/active_record/migration.rb:660:in `method_missing'
from /root/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4/lib/active_record/migration.rb:655:in `maintain_test_schema!'
from /root/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/test_help.rb:17:in `<main>'
from /root/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from /root/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from /root/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/zeitwerk-2.6.0/lib/zeitwerk/kernel.rb:35:in `require'
from /mnt/c/Users/jason/COSI 166/brandeis_class_hub/test/test_helper.rb:3:in `<main>'
from /root/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from /root/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from /mnt/c/Users/jason/COSI 166/brandeis_class_hub/test/channels/application_cable/connection_test.rb:1:in `<main>'
from /root/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from /root/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from /root/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/test_unit/runner.rb:47:in `block in load_tests'
from /root/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/test_unit/runner.rb:47:in `each'
from /root/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/test_unit/runner.rb:47:in `load_tests'
from /root/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/test_unit/runner.rb:40:in `run'
from /root/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/commands/test/test_command.rb:33:in `perform'
from /root/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
from /root/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
from /root/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
from /root/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/command/base.rb:87:in `perform'
from /root/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/command.rb:48:in `invoke'
from /root/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/commands.rb:18:in `<main>'
from /root/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from /root/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from bin/rails:4:in `<main>'
I have been pitched that maybe I need to make a user profile, but I'm not quite sure how to go about that. If there's something that I'm missing, I'm more than happy to figure it out.
In the code I presented above, I attempted to run rails test. Since it doesn't understand Postgres is on my computer and running, it fails.

Postgres Deadlock on CircleCI

Recently, I've upped my single build concurrency on CircleCI to 11 instances. Intermittently, I get
PG::TRDeadlockDetected
errors in some of the build instances. I don't know enough about the CircleCI architecture to be able to troubleshoot this. Does anyone have insight on this?
PG::TRDeadlockDetected: ERROR: deadlock detected
DETAIL: Process 11634 waits for AccessExclusiveLock on relation 19091 of database 18000; blocked by process 11840.
Process 11840 waits for AccessShareLock on relation 18632 of database 18000; blocked by process 11634.
HINT: See server log for query details.
: TRUNCATE TABLE "addresses", "users", "hits" RESTART IDENTITY CASCADE; (ActiveRecord::StatementInvalid)
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.10/lib/active_record/connection_adapters/postgresql/database_statements.rb:128:in `exec'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.10/lib/active_record/connection_adapters/postgresql/database_statements.rb:128:in `block in execute'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.10/lib/active_record/connection_adapters/abstract_adapter.rb:442:in `block in log'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.10/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.10/lib/active_record/connection_adapters/abstract_adapter.rb:437:in `log'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.10/lib/active_record/connection_adapters/postgresql/database_statements.rb:127:in `execute'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/database_cleaner-1.2.0/lib/database_cleaner/active_record/truncation.rb:148:in `truncate_tables'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/database_cleaner-1.2.0/lib/database_cleaner/active_record/truncation.rb:202:in `block in clean'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.10/lib/active_record/connection_adapters/postgresql/referential_integrity.rb:17:in `disable_referential_integrity'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/database_cleaner-1.2.0/lib/database_cleaner/active_record/truncation.rb:198:in `clean'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/database_cleaner-1.2.0/lib/database_cleaner/base.rb:86:in `clean'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/database_cleaner-1.2.0/lib/database_cleaner/configuration.rb:79:in `block in clean'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/database_cleaner-1.2.0/lib/database_cleaner/configuration.rb:79:in `each'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/database_cleaner-1.2.0/lib/database_cleaner/configuration.rb:79:in `clean'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-rails-1.4.0/lib/cucumber/rails/hooks/database_cleaner.rb:9:in `After'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/core_ext/instance_exec.rb:36:in `cucumber_instance_exec'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/rb_support/rb_hook.rb:14:in `invoke'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/language_support/language_methods.rb:114:in `invoke'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/language_support/language_methods.rb:108:in `block in execute_after'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/language_support/language_methods.rb:107:in `reverse_each'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/language_support/language_methods.rb:107:in `execute_after'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/language_support/language_methods.rb:19:in `after'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/runtime/support_code.rb:112:in `block in fire_hook'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/runtime/support_code.rb:111:in `each'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/runtime/support_code.rb:111:in `fire_hook'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/runtime.rb:112:in `after'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/runtime.rb:99:in `before_and_after'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/runtime.rb:81:in `block in with_hooks'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/runtime/support_code.rb:120:in `call'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/runtime/support_code.rb:120:in `block (3 levels) in around'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/language_support/language_methods.rb:9:in `block in around'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/language_support/language_methods.rb:94:in `call'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/language_support/language_methods.rb:94:in `block (3 levels) in execute_around'
/home/ubuntu/icn/features/support/env.rb:84:in `call'
/home/ubuntu/icn/features/support/env.rb:84:in `block in <top (required)>'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/core_ext/instance_exec.rb:48:in `instance_exec'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/core_ext/instance_exec.rb:48:in `block in cucumber_instance_exec'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/core_ext/instance_exec.rb:69:in `cucumber_run_with_backtrace_filtering'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/core_ext/instance_exec.rb:36:in `cucumber_instance_exec'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/rb_support/rb_hook.rb:14:in `invoke'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/language_support/language_methods.rb:114:in `invoke'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/language_support/language_methods.rb:93:in `block (2 levels) in execute_around'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/language_support/language_methods.rb:97:in `call'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/language_support/language_methods.rb:97:in `execute_around'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/language_support/language_methods.rb:8:in `around'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/runtime/support_code.rb:119:in `block (2 levels) in around'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/runtime/support_code.rb:123:in `call'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/runtime/support_code.rb:123:in `around'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/runtime.rb:93:in `around'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/runtime.rb:80:in `with_hooks'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/ast/tree_walker.rb:13:in `execute'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/ast/scenario.rb:32:in `block in accept'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/ast/scenario.rb:79:in `with_visitor'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/ast/scenario.rb:31:in `accept'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/ast/tree_walker.rb:58:in `block in visit_feature_element'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/ast/tree_walker.rb:170:in `broadcast'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/ast/tree_walker.rb:57:in `visit_feature_element'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/ast/feature.rb:38:in `block in accept'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/ast/feature.rb:37:in `each'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/ast/feature.rb:37:in `accept'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/ast/tree_walker.rb:27:in `block in visit_feature'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/ast/tree_walker.rb:170:in `broadcast'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/ast/tree_walker.rb:26:in `visit_feature'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/ast/features.rb:28:in `block in accept'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/ast/features.rb:17:in `each'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/ast/features.rb:17:in `each'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/ast/features.rb:27:in `accept'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/ast/tree_walker.rb:21:in `block in visit_features'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/ast/tree_walker.rb:170:in `broadcast'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/ast/tree_walker.rb:20:in `visit_features'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/runtime.rb:48:in `run!'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/lib/cucumber/cli/main.rb:47:in `execute!'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/gems/cucumber-1.3.8/bin/cucumber:13:in `<top (required)>'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/bin/cucumber:23:in `load'
/home/ubuntu/icn/vendor/bundle/ruby/2.0.0/bin/cucumber:23:in `<main>'
When running a build in parallel, CircleCI uses isolated containers, each with their own database instance, so the problem won't be from the parallel executions interacting with each other.
It is possible, however, that the splitting of your tests across the machines is exposing unexpected behavior or issues with unclean setup or teardown between tests.
It's obviously harder when it's intermittent, but you can rerun the build with ssh enabled and then connect to the container when you get an error and inspect all the logs. That should give you a better idea of where the deadlock is occurring.
Also, CircleCI has direct support in app or at sayhi#circleci.com if you need help debugging.

Ruby rails s error

I'm getting this massive error when I try to run rails s, I've just re installed ruby as well as PostgreSQL. Thanks for help. This was right after I ran rails s also, i've made a other post on similar issues if that helpes at all in any way possible Rails Forem installation assistance i'm still really new with Ruby just to keep that in mind. thanks again.
ERROR:
=> Booting WEBrick
=> Rails 3.2.11 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/connection_adapters/postgresql_adapter.rb:1208:in `initialize': could not connect to server: No such file or directory (PG::Error)
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/connection_adapters/postgresql_adapter.rb:1208:in `new'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/connection_adapters/postgresql_adapter.rb:1208:in `connect'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/connection_adapters/postgresql_adapter.rb:326:in `initialize'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/connection_adapters/postgresql_adapter.rb:28:in `new'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/connection_adapters/postgresql_adapter.rb:28:in `postgresql_connection'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:315:in `new_connection'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:325:in `checkout_new_connection'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:247:in `block (2 levels) in checkout'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `loop'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `block in checkout'
from /usr/local/rvm/rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:239:in `checkout'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:102:in `block in connection'
from /usr/local/rvm/rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:101:in `connection'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:410:in `retrieve_connection'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_specification.rb:171:in `retrieve_connection'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_specification.rb:145:in `connection'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/model_schema.rb:308:in `clear_cache!'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/railtie.rb:97:in `block (2 levels) in <class:Railtie>'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:418:in `_run__1442159158261981509__prepare__1376751637034186401__callbacks'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:405:in `__run_callback'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:385:in `_run_prepare_callbacks'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:81:in `run_callbacks'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/actionpack-3.2.11/lib/action_dispa
tch/middleware/reloader.rb:74:in `prepare!'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/actionpack-3.2.11/lib/action_dispatch/middleware/reloader.rb:48:in `prepare!'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.11/lib/rails/application/finisher.rb:47:in `block in <module:Finisher>'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.11/lib/rails/initializable.rb:30:in `instance_exec'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.11/lib/rails/initializable.rb:30:in `run'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.11/lib/rails/initializable.rb:55:in `block in run_initializers'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.11/lib/rails/initializable.rb:54:in `each'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.11/lib/rails/initializable.rb:54:in `run_initializers'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.11/lib/rails/application.rb:136:in `initialize!'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.11/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /home/forem/config/environment.rb:5:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `block in require'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:236:in `load_dependency'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'
from /home/forem/config.ru:3:in `block in <main>'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/rack-1.4.4/lib/rack/builder.rb:51:in `instance_eval'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/rack-1.4.4/lib/rack/builder.rb:51:in `initialize'
from /home/forem/config.ru:in `new'
from /home/forem/config.ru:in `<main>'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/rack-1.4.4/lib/rack/builder.rb:40:in `eval'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/rack-1.4.4/lib/rack/builder.rb:40:in `parse_file'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/rack-1.4.4/lib/rack/server.rb:200:in `app'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.11/lib/rails/commands/server.rb:46:in `app'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/rack-1.4.4/lib/rack/server.rb:304:in `wrapped_app'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/rack-1.4.4/lib/rack/server.rb:254:in `start'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.11/lib/rails/commands/server.rb:70:in `start'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.11/lib/rails/commands.rb:55:in `block in <top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.11/lib/rails/commands.rb:50:in `tap'
from /usr/local/rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.11/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
This is cause your postgresql connection is failing. Make sure your config/database.rb is set correctly.
If you think it is then next look at your port settings. "/tmp/.s.PGSQL.5432"?
Is your postgres service running?
service postgresql start

cannot load such file -- sqlite3/sqlite3_native after deploying rails app to a new Debian server

I've started our deployment process to a production server based on Debian Squeeze.
We've been developing this Rails application in a MacOS.
Rails is version 3.2.8
Ruby is version 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin12.2.0]
We have installed rvm since the beggining and the application works flawlessly in my computer.
In order to understand what would be required and then make a script with Capistrano, I started with:
Installed successfully Ruby.
Installed successfully Rails.
Installed SQLite3. (I won't use it in production)
Installed successfully RVM.
Copied the whole app directory and ran bundle install inside it.
Then, ran rake about just to make sure that everything is ok getting the following error:
rake aborted!
cannot load such file -- sqlite3/sqlite3_native
/root/rails_app/depot/vendor/bundle/ruby/1.9.1/gems/sqlite3-1.3.6/lib/sqlite3.rb:6:in `require'
/root/rails_app/depot/vendor/bundle/ruby/1.9.1/gems/sqlite3-1.3.6/lib/sqlite3.rb:6:in `rescue in <top (required)>'
/root/rails_app/depot/vendor/bundle/ruby/1.9.1/gems/sqlite3-1.3.6/lib/sqlite3.rb:2:in `<top (required)>'
/usr/local/rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.2/lib/bundler/runtime.rb:68:in `require'
/usr/local/rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.2/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
/usr/local/rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.2/lib/bundler/runtime.rb:66:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.2/lib/bundler/runtime.rb:66:in `block in require'
/usr/local/rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.2/lib/bundler/runtime.rb:55:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.2/lib/bundler/runtime.rb:55:in `require'
/usr/local/rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.2/lib/bundler.rb:128:in `require'
/root/rails_app/depot/config/application.rb:7:in `<top (required)>'
/root/rails_app/depot/Rakefile:5:in `require'
/root/rails_app/depot/Rakefile:5:in `<top (required)>'
/root/rails_app/depot/vendor/bundle/ruby/1.9.1/gems/rake- 0.9.2.2/lib/rake/rake_module.rb:25:in `load'
/root/rails_app/depot/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/rake_module.rb:25:in `load_rakefile'
/root/rails_app/depot/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:501:in `raw_load_rakefile'
/root/rails_app/depot/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:82:in `block in load_rakefile'
/root/rails_app/depot/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/root/rails_app/depot/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:81:in `load_rakefile'
/root/rails_app/depot/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:65:in `block in run'
/root/rails_app/depot/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/root/rails_app/depot/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/root/rails_app/depot/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/usr/local/rvm/gems/ruby-1.9.3-p327/bin/rake:19:in `load'
/usr/local/rvm/gems/ruby-1.9.3-p327/bin/rake:19:in `<main>'
/usr/local/rvm/gems/ruby-1.9.3-p327/bin/ruby_noexec_wrapper:14:in `eval'
/usr/local/rvm/gems/ruby-1.9.3-p327/bin/ruby_noexec_wrapper:14:in `<main>'
Every other command like, rails server or rails console shows the same error.

Rails 3.2 + pg gem : load path issue

I have two rails applications, "old" one and new one, created with
$ rails new blog -d postgresql
when i try to start the server, it works on "old" application without problems:
$ rails s -p 2000
=> Booting WEBrick
=> Rails 3.2.8 application starting in development on http://0.0.0.0:2000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2012-09-17 16:28:48] INFO WEBrick 1.3.1
[2012-09-17 16:28:48] INFO ruby 1.9.3 (2012-04-20) [x86_64-linux]
[2012-09-17 16:28:48] INFO WEBrick::HTTPServer#start: pid=9377 port=2000
but it fails for "new" application :/
$ rails s -p 2000
/usr/local/share/gems/gems/pg-0.14.1/lib/pg.rb:4:in `require': cannot load such file -- pg_ext (LoadError)
from /usr/local/share/gems/gems/pg-0.14.1/lib/pg.rb:4:in `<top (required)>'
from /usr/local/share/gems/gems/bundler-1.1.5/lib/bundler/runtime.rb:68:in `require'
from /usr/local/share/gems/gems/bundler-1.1.5/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /usr/local/share/gems/gems/bundler-1.1.5/lib/bundler/runtime.rb:66:in `each'
from /usr/local/share/gems/gems/bundler-1.1.5/lib/bundler/runtime.rb:66:in `block in require'
from /usr/local/share/gems/gems/bundler-1.1.5/lib/bundler/runtime.rb:55:in `each'
from /usr/local/share/gems/gems/bundler-1.1.5/lib/bundler/runtime.rb:55:in `require'
from /usr/local/share/gems/gems/bundler-1.1.5/lib/bundler.rb:119:in `require'
from /home/alex/tmp/RoR/blog/config/application.rb:7:in `<top (required)>'
from /usr/local/share/gems/gems/railties-3.2.8/lib/rails/commands.rb:53:in `require'
from /usr/local/share/gems/gems/railties-3.2.8/lib/rails/commands.rb:53:in `block in <top (required)>'
from /usr/local/share/gems/gems/railties-3.2.8/lib/rails/commands.rb:50:in `tap'
from /usr/local/share/gems/gems/railties-3.2.8/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
it's possible to fix if i copy or symlink pg_ext.so to module path:
# ln -s /usr/local/share/gems/gems/pg-0.14.1/ext/pg_ext.so /usr/local/share/gems/gems/pg-0.14.1/lib
or i can directly add requirement to boot.rb:
require 'rubygems'
require 'pg'
But it's not acceptable solution and i'm wondering why it works for first application and why it doesn't work for new one ? I've spent all day comparing config files but had no success.
I had the same problem after upgrading to Fedora 18.
pg_ext is built when running gem update.
A pre-requisite for that is that postgresql-devel is installed.