My issue is very similar to that described in issue deploying rails 5 application to AWS using Elastic Beanstalk due to rb-readline
However, setting HOME and/or HOMEPATH via the AWS console has not helped. I get the same error, every time. Here is the relevant logfile:
/var/log/eb-activity.log
++ export PATH=/opt/rubies/ruby-2.3.4/bin:/opt/elasticbeanstalk/lib/ruby/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin
++ PATH=/opt/rubies/ruby-2.3.4/bin:/opt/elasticbeanstalk/lib/ruby/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin
+++ /opt/rubies/ruby-2.3.4/bin/ruby -
++ eval 'export RUBY_ENGINE=ruby;
export RUBY_VERSION=2.3.4;
export GEM_ROOT="/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0";'
+++ export RUBY_ENGINE=ruby
+++ RUBY_ENGINE=ruby
+++ export RUBY_VERSION=2.3.4
+++ RUBY_VERSION=2.3.4
+++ export GEM_ROOT=/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0
+++ GEM_ROOT=/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0
++ (( 0 != 0 ))
+ cd /var/app/ondeck
+ su -s /bin/bash -c 'bundle exec /opt/elasticbeanstalk/support/scripts/check-for-rake-task.rb assets:precompile' webapp
`/home/webapp` is not a directory.
Bundler will use `/tmp/bundler/home/webapp' as your home directory temporarily.
+ '[' false == true ']'
+ su -s /bin/bash -c 'bundle exec rake assets:precompile' webapp
`/home/webapp` is not a directory.
Bundler will use `/tmp/bundler/home/webapp' as your home directory temporarily.
rake aborted!
Bundler::GemRequireError: There was an error while trying to load the gem 'rb-readline'.
Gem Load Error is: HOME environment variable (or HOMEDRIVE and HOMEPATH) must be set and point to a directory
Backtrace for gem load error is:
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/rb-readline-0.5.5/lib/rbreadline.rb:1097:in `<module:RbReadline>'
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/rb-readline-0.5.5/lib/rbreadline.rb:17:in `<top (required)>'
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require'
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `block in require'
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:240:in `load_dependency'
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require'
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/rb-readline-0.5.5/lib/readline.rb:10:in `<module:Readline>'
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/rb-readline-0.5.5/lib/readline.rb:8:in `<top (required)>'
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require'
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `block in require'
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:240:in `load_dependency'
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require'
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/rb-readline-0.5.5/lib/rb-readline.rb:16:in `<top (required)>'
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/runtime.rb:82:in `require'
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/runtime.rb:82:in `block (2 levels) in require'
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/runtime.rb:77:in `each'
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/runtime.rb:77:in `block in require'
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/runtime.rb:66:in `each'
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/runtime.rb:66:in `require'
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler.rb:108:in `require'
/var/app/ondeck/config/application.rb:7:in `<top (required)>'
/var/app/ondeck/Rakefile:5:in `require'
/var/app/ondeck/Rakefile:5:in `<top (required)>'
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/rake-11.1.2/lib/rake/rake_module.rb:28:in `load'
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/rake-11.1.2/lib/rake/rake_module.rb:28:in `load_rakefile'
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/rake-11.1.2/lib/rake/application.rb:689:in `raw_load_rakefile'
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/rake-11.1.2/lib/rake/application.rb:94:in `block in load_rakefile'
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/rake-11.1.2/lib/rake/application.rb:176:in `standard_exception_handling'
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/rake-11.1.2/lib/rake/application.rb:93:in `load_rakefile'
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/rake-11.1.2/lib/rake/application.rb:77:in `block in run'
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/rake-11.1.2/lib/rake/application.rb:176:in `standard_exception_handling'
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/rake-11.1.2/lib/rake/application.rb:75:in `run'
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/rake-11.1.2/bin/rake:33:in `<top (required)>'
/opt/rubies/ruby-2.3.4/bin/rake:22:in `load'
/opt/rubies/ruby-2.3.4/bin/rake:22:in `<top (required)>'
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/cli/exec.rb:74:in `load'
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/cli/exec.rb:74:in `kernel_load'
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/cli/exec.rb:27:in `run'
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/cli.rb:360:in `exec'
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/vendor/thor/lib/thor.rb:369:in `dispatch'
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/cli.rb:20:in `dispatch'
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/vendor/thor/lib/thor/base.rb:444:in `start'
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/cli.rb:10:in `start'
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/exe/bundle:35:in `block in <top (required)>'
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/exe/bundle:27:in `<top (required)>'
/opt/rubies/ruby-2.3.4/bin/bundle:22:in `load'
/opt/rubies/ruby-2.3.4/bin/bundle:22:in `<main>'
Bundler Error Backtrace:
/var/app/ondeck/config/application.rb:7:in `<top (required)>'
/var/app/ondeck/Rakefile:5:in `require'
/var/app/ondeck/Rakefile:5:in `<top (required)>'
/opt/rubies/ruby-2.3.4/bin/bundle:22:in `load'
/opt/rubies/ruby-2.3.4/bin/bundle:22:in `<main>'
HOME environment variable (or HOMEDRIVE and HOMEPATH) must be set and point to a directory
/var/app/ondeck/config/application.rb:7:in `<top (required)>'
/var/app/ondeck/Rakefile:5:in `require'
/var/app/ondeck/Rakefile:5:in `<top (required)>'
/opt/rubies/ruby-2.3.4/bin/bundle:22:in `load'
/opt/rubies/ruby-2.3.4/bin/bundle:22:in `<main>'
(See full trace by running task with --trace) (Executor::NonZeroExitStatus)
[2018-03-08T21:21:50.587Z] INFO [2045] - [Application update 2018-03-02-1047-retry-0307#28/AppDeployStage0/AppDeployPreHook/11_asset_compilation.sh] : Activity failed.
[2018-03-08T21:21:50.587Z] INFO [2045] - [Application update 2018-03-02-1047-retry-0307#28/AppDeployStage0/AppDeployPreHook] : Activity failed.
[2018-03-08T21:21:50.587Z] INFO [2045] - [Application update 2018-03-02-1047-retry-0307#28/AppDeployStage0] : Activity failed.
[2018-03-08T21:21:50.587Z] INFO [2045] - [Application update 2018-03-02-1047-retry-0307#28] : Completed activity. Result:
Application update - Command CMD-AppDeploy failed
[2018-03-08T21:30:11.781Z] INFO [2654] - [CMD-TailLogs] : Starting activity...
[2018-03-08T21:30:11.781Z] INFO [2654] - [CMD-TailLogs/AddonsBefore] : Starting activity...
[2018-03-08T21:30:11.781Z] INFO [2654] - [CMD-TailLogs/AddonsBefore] : Completed activity.
[2018-03-08T21:30:11.781Z] INFO [2654] - [CMD-TailLogs/TailLogs] : Starting activity...
[2018-03-08T21:30:11.781Z] INFO [2654] - [CMD-TailLogs/TailLogs/TailLogs] : Starting activity...
When I log on to the EC2 instance, I can verify that $HOME is set as expected, but I still get the above result. I hypothesize that maybe the problem I'm having is that the app is started in some chrooted configuration and the directories I'm choosing don't exist? Or maybe I need to use "path syntax" with ":" characters?
But trial-and-error is going to take a long, long time here, I'm redownloading via dashboard with every try. So if someone has something more definitive, I'd really appreciate it.
Well, I have solved this. I eliminated the rbreadline gem from my build. This was causing the problem. I had to solve another problem to do this, first I looked at rails console doesn't load due to libreadline
However the solution given,
ln -s /usr/local/opt/readline/lib/libreadline.dylib \
/usr/local/opt/readline/lib/libreadline.6.dylib
did not work. What worked for me was
ln -s /usr/local/opt/readline/lib/libreadline.dylib \
/usr/local/opt/readline/lib/libreadline.6.2.dylib
Related
Error:
/home/geeta/DemoApp/demo_app/spec/acceptance/students_spec.rb:1:in `require': cannot load such file -- acceptance_helper (LoadError)
from /home/geeta/DemoApp/demo_app/spec/acceptance/students_spec.rb:1:in `<top (required)>'
from /home/geeta/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/configuration.rb:1327:in `load'
from /home/geeta/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/configuration.rb:1327:in `block in load_spec_files'
from /home/geeta/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/configuration.rb:1325:in `each'
from /home/geeta/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/configuration.rb:1325:in `load_spec_files'
from /home/geeta/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:102:in `setup'
from /home/geeta/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:88:in `run'
from /home/geeta/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:73:in `run'
from /home/geeta/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:41:in `invoke'
from /home/geeta/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/exe/rspec:4:in `<top (required)>'
from /home/geeta/.rvm/gems/ruby-2.2.1/bin/rspec:23:in `load'
from /home/geeta/.rvm/gems/ruby-2.2.1/bin/rspec:23:in `<main>'
from /home/geeta/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `eval'
from /home/geeta/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `<main>'
Try running command with
bundle exec rspec spec/...
Hello now i am install redmine but when i try migrate my database there is a error :
[DEPRECATION] requiring "RMagick" is deprecated. Use "rmagick" instead
there is stacktrce :
root#server:/opt/redmine/redmine-3.0# bundle exec rake db:migrate
[DEPRECATION] requiring "RMagick" is deprecated. Use "rmagick" instead
rake aborted!
ActiveRecord::AdapterNotSpecified: 'development' database is not configured. Available: ["production"]
/var/lib/gems/2.1.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/connection_specification.rb:248:in `resolve_symbol_connection'
/var/lib/gems/2.1.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/connection_specification.rb:211:in `resolve_connection'
/var/lib/gems/2.1.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/connection_specification.rb:139:in `resolve'
/var/lib/gems/2.1.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/connection_specification.rb:169:in `spec'
/var/lib/gems/2.1.0/gems/activerecord-4.2.1/lib/active_record/connection_handling.rb:50:in `establish_connection'
/var/lib/gems/2.1.0/gems/activerecord-4.2.1/lib/active_record/railtie.rb:120:in `block (2 levels) in <class:Railtie>'
/var/lib/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
/var/lib/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
/var/lib/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
/var/lib/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/lazy_load_hooks.rb:44:in `each'
/var/lib/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
/var/lib/gems/2.1.0/gems/activerecord-4.2.1/lib/active_record/base.rb:316:in `<module:ActiveRecord>'
/var/lib/gems/2.1.0/gems/activerecord-4.2.1/lib/active_record/base.rb:26:in `<top (required)>'
/opt/redmine/redmine-3.0/lib/plugins/acts_as_activity_provider/init.rb:2:in `block in <top (required)>'
/opt/redmine/redmine-3.0/config/initializers/00-core_plugins.rb:12:in `eval'
/opt/redmine/redmine-3.0/config/initializers/00-core_plugins.rb:12:in `block in <top (required)>'
/opt/redmine/redmine-3.0/config/initializers/00-core_plugins.rb:2:in `each'
/opt/redmine/redmine-3.0/config/initializers/00-core_plugins.rb:2:in `<top (required)>'
/var/lib/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `load'
/var/lib/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `block in load'
/var/lib/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_dependency'
/var/lib/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `load'
/var/lib/gems/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:652:in `block in load_config_initializer'
/var/lib/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/notifications.rb:166:in `instrument'
/var/lib/gems/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:651:in `load_config_initializer'
/var/lib/gems/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>'
/var/lib/gems/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:615:in `each'
/var/lib/gems/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:615:in `block in <class:Engine>'
/var/lib/gems/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `instance_exec'
/var/lib/gems/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `run'
/var/lib/gems/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:55:in `block in run_initializers'
/var/lib/gems/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:44:in `each'
/var/lib/gems/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:44:in `tsort_each_child'
/var/lib/gems/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:54:in `run_initializers'
/var/lib/gems/2.1.0/gems/railties-4.2.1/lib/rails/application.rb:352:in `initialize!'
/opt/redmine/redmine-3.0/config/environment.rb:14:in `<top (required)>'
/var/lib/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require'
/var/lib/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `block in require'
/var/lib/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_dependency'
/var/lib/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require'
/var/lib/gems/2.1.0/gems/railties-4.2.1/lib/rails/application.rb:328:in `require_environment!'
/var/lib/gems/2.1.0/gems/railties-4.2.1/lib/rails/application.rb:457:in `block in run_tasks_blocks'
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)
While performing bundler actions like the above, you have to always specify environment, unless it's added to your system or shell's environment vars, like ~/.bashrc on linux or environment variables under windows, so in your command, you should add RAILS_ENV=production, and your command would look like this:
bundle exec rake db:migrate RAILS_ENV=production
I'm using rails 4.2.0
I'm using ruby : ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-linux]
and rbenv : rbenv 0.4.0-129-g7e0e85b
when I'm trying to open rails c in console in production, I have the following error :
~/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/spring-1.3.3/lib/spring/env.rb:69:in `initialize': Permission denied # rb_sysopen - /tmp/spring/71079e88c49df6873d86594ca3ada123.pid (Errno::EACCES)
from ~/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/spring-1.3.3/lib/spring/env.rb:69:in `open'
from ~/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/spring-1.3.3/lib/spring/env.rb:69:in `open'
from ~/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/spring-1.3.3/lib/spring/env.rb:69:in `server_running?'
from ~/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/spring-1.3.3/lib/spring/client/run.rb:25:in `call'
from ~/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/spring-1.3.3/lib/spring/client/command.rb:7:in `call'
from ~/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/spring-1.3.3/lib/spring/client/rails.rb:23:in `call'
from ~/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/spring-1.3.3/lib/spring/client/command.rb:7:in `call'
from ~/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/spring-1.3.3/lib/spring/client.rb:26:in `run'
from ~/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/spring-1.3.3/bin/spring:48:in `<top (required)>'
from ~/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/spring-1.3.3/lib/spring/binstub.rb:11:in `load'
from ~/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/spring-1.3.3/lib/spring/binstub.rb:11:in `<top (required)>'
from ~/.rbenv/versions/2.1.0/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from ~/.rbenv/versions/2.1.0/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /var/www/site/bin/spring:16:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
I have update bundle, but nothing change. What's wrong?
Do you have the spring gem inside your production group?
Spring should be inside test and dev only. eg.
group :development, :test do
gem 'spring'
end
fix by :
sudo chmod -R 1777 /tmp
and reboot spring.
I've setup a rails server with rails 4, unicorn and nginx on Digital Ocean.
Environment - staging
While trying to run command unicorn_rails on Digital Ocean server, I get this error:
I, [2014-07-15T07:35:34.206087 #7147] INFO -- : listening on addr=0.0.0.0:8080 fd=9
I, [2014-07-15T07:35:34.206528 #7147] INFO -- : worker=0 spawning...
I, [2014-07-15T07:35:34.207917 #7147] INFO -- : master process ready
I, [2014-07-15T07:35:34.209513 #7173] INFO -- : worker=0 spawned pid=7173
I, [2014-07-15T07:35:34.210202 #7173] INFO -- : Refreshing Gem list
E, [2014-07-15T07:35:36.425768 #7173] ERROR -- : 'development' database is not configured. Available: ["default", "staging"] (ActiveRecord::AdapterNotSpecified)
/home/deploy/mydoc/shared/bundle/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/connection_specification.rb:257:in `resolve_symbol_connection'
/home/deploy/mydoc/shared/bundle/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/connection_specification.rb:224:in `resolve_connection'
/home/deploy/mydoc/shared/bundle/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/connection_specification.rb:152:in `resolve'
/home/deploy/mydoc/shared/bundle/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/connection_specification.rb:182:in `spec'
/home/deploy/mydoc/shared/bundle/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/connection_handling.rb:50:in `establish_connection'
/home/deploy/mydoc/shared/bundle/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/railtie.rb:129:in `block (2 levels) in <class:Railtie>'
/home/deploy/mydoc/shared/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
/home/deploy/mydoc/shared/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
/home/deploy/mydoc/shared/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/lazy_load_hooks.rb:28:in `block in on_load'
/home/deploy/mydoc/shared/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/lazy_load_hooks.rb:27:in `each'
/home/deploy/mydoc/shared/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/lazy_load_hooks.rb:27:in `on_load'
/home/deploy/mydoc/shared/bundle/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/railtie.rb:118:in `block in <class:Railtie>'
/home/deploy/mydoc/shared/bundle/ruby/2.1.0/gems/railties-4.1.1/lib/rails/initializable.rb:30:in `instance_exec'
/home/deploy/mydoc/shared/bundle/ruby/2.1.0/gems/railties-4.1.1/lib/rails/initializable.rb:30:in `run'
/home/deploy/mydoc/shared/bundle/ruby/2.1.0/gems/railties-4.1.1/lib/rails/initializable.rb:55:in `block in run_initializers'
/home/deploy/.rbenv/versions/2.1.2/lib/ruby/2.1.0/tsort.rb:226:in `block in tsort_each'
/home/deploy/.rbenv/versions/2.1.2/lib/ruby/2.1.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
/home/deploy/.rbenv/versions/2.1.2/lib/ruby/2.1.0/tsort.rb:427:in `each_strongly_connected_component_from'
/home/deploy/.rbenv/versions/2.1.2/lib/ruby/2.1.0/tsort.rb:347:in `block in each_strongly_connected_component'
/home/deploy/.rbenv/versions/2.1.2/lib/ruby/2.1.0/tsort.rb:345:in `each'
/home/deploy/.rbenv/versions/2.1.2/lib/ruby/2.1.0/tsort.rb:345:in `call'
/home/deploy/.rbenv/versions/2.1.2/lib/ruby/2.1.0/tsort.rb:345:in `each_strongly_connected_component'
/home/deploy/.rbenv/versions/2.1.2/lib/ruby/2.1.0/tsort.rb:224:in `tsort_each'
/home/deploy/.rbenv/versions/2.1.2/lib/ruby/2.1.0/tsort.rb:205:in `tsort_each'
/home/deploy/mydoc/shared/bundle/ruby/2.1.0/gems/railties-4.1.1/lib/rails/initializable.rb:54:in `run_initializers'
/home/deploy/mydoc/shared/bundle/ruby/2.1.0/gems/railties-4.1.1/lib/rails/application.rb:288:in `initialize!'
/home/deploy/mydoc/releases/20140715103735/config/environment.rb:5:in `<top (required)>'
/home/deploy/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/home/deploy/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
config.ru:4:in `block in <main>'
/home/deploy/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
/home/deploy/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
config.ru:1:in `new'
config.ru:1:in `<main>'
/home/deploy/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/unicorn-4.8.3/lib/unicorn.rb:48:in `eval'
/home/deploy/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/unicorn-4.8.3/lib/unicorn.rb:48:in `block in builder'
/home/deploy/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/unicorn-4.8.3/bin/unicorn_rails:139:in `call'
/home/deploy/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/unicorn-4.8.3/bin/unicorn_rails:139:in `block in rails_builder'
/home/deploy/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:764:in `call'
/home/deploy/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:764:in `build_app!'
/home/deploy/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:628:in `init_worker_process'
/home/deploy/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:651:in `worker_loop'
/home/deploy/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:525:in `spawn_missing_workers'
/home/deploy/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:140:in `start'
/home/deploy/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/unicorn-4.8.3/bin/unicorn_rails:209:in `<top (required)>'
/home/deploy/.rbenv/versions/2.1.2/bin/unicorn_rails:23:in `load'
/home/deploy/.rbenv/versions/2.1.2/bin/unicorn_rails:23:in `<main>'
Database.yml looks like this on server:
default: &default
adapter: postgresql
encoding: unicode
pool: 5
staging:
<<: *default
database: myapp
host: localhost
username: deploy
password: XXXXXX
template: template0
port: 5432
I think you should be starting it with bundle exec unicorn -E staging.
See How to start rails server in production mode using unicorn and config file?
When I use console for RoR and there is an error I get the list of gems/libs used, for example
SyntaxError: /Users/user/Sites/Jobsite/app/models/subject.rb:11: syntax error, unexpected ']', expecting ')'
where(["name LIKE ?"], "%#{query}%"])
^
from /Users/user/.rvm/gems/ruby-2.0.0-p451/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:443:in `load'
from /Users/user/.rvm/gems/ruby-2.0.0-p451/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:443:in `block in load_file'
from /Users/user/.rvm/gems/ruby-2.0.0-p451/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:633:in `new_constants_in'
from /Users/user/.rvm/gems/ruby-2.0.0-p451/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:442:in `load_file'
from /Users/user/.rvm/gems/ruby-2.0.0-p451/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:342:in `require_or_load'
from /Users/user/.rvm/gems/ruby-2.0.0-p451/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:480:in `load_missing_constant'
from /Users/user/.rvm/gems/ruby-2.0.0-p451/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:180:in `const_missing'
from (irb):1
from /Users/user/.rvm/gems/ruby-2.0.0-p451/gems/railties-4.1.0/lib/rails/commands/console.rb:90:in `start'
from /Users/user/.rvm/gems/ruby-2.0.0-p451/gems/railties-4.1.0/lib/rails/commands/console.rb:9:in `start'
from /Users/user/.rvm/gems/ruby-2.0.0-p451/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:69:in `console'
from /Users/user/.rvm/gems/ruby-2.0.0-p451/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
from /Users/user/.rvm/gems/ruby-2.0.0-p451/gems/railties-4.1.0/lib/rails/commands.rb:17:in `<top (required)>'
from /Users/user/.rvm/gems/ruby-2.0.0-p451/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in `require'
from /Users/user/.rvm/gems/ruby-2.0.0-p451/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in `block in require'
from /Users/user/.rvm/gems/ruby-2.0.0-p451/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:232:in `load_dependency'
from /Users/user/.rvm/gems/ruby-2.0.0-p451/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in `require'
from /Users/user/Sites/Jobsite/bin/rails:8:in `<top (required)>'
from /Users/user/.rvm/gems/ruby-2.0.0-p451/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:241:in `load'
from /Users/user/.rvm/gems/ruby-2.0.0-p451/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:241:in `block in load'
from /Users/user/.rvm/gems/ruby-2.0.0-p451/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:232:in `load_dependency'
from /Users/user/.rvm/gems/ruby-2.0.0-p451/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:241:in `load'
from /Users/user/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/user/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
Do I really need this or can I disable it somehow, because each time I get this, I need to scroll up and I don't see the error message itself so easily.
You could try changing the log level.
You can also turn off the SQL logging by putting this in an initializer:
ActiveRecord::Base.logger = nil
Maybe something like - config/initializers/activerecord_logger.rb
More info here - Disable Rails SQL logging in console
You can change the setting consider_all_requests_local from true to false in config/environments/development.rb so it doesn't show the stacktrace:
Jobsite::Application.configure do
config.consider_all_requests_local = false
end