I have deployed my webapp on CentOS 7 using bundle --standalone and have configured the app to use the correct gems by using .bundle/config. It works great when I use rails server, but when I set it up to use passenger I get the following error:
[ 2016-02-02 13:27:50.7037 5134/7fb8225b8700 age/Cor/App/Implementation.cpp:304 ]: Could not spawn process for application /var/www/rails-web: An error occurred while starting up the preloader. It exited before signalling successful startup back to Phusion Passenger.
Error ID: 7b0eafb9
Error details saved to: /tmp/passenger-error-YR2EzW.html
Message from application: An error occurred while starting up the preloader. It exited before signalling successful startup back to Phusion Passenger. Please read this article for more information about this problem.<br>
<h2>Raw process output:</h2>
<pre>
/usr/share/rubygems/rubygems/path_support.rb:68:in `path=': undefined method `+' for nil:NilClass (NoMethodError)
from /usr/share/rubygems/rubygems/path_support.rb:30:in `initialize'
from /usr/share/rubygems/rubygems.rb:357:in `new'
from /usr/share/rubygems/rubygems.rb:357:in `paths'
from /usr/share/rubygems/rubygems.rb:379:in `path'
from /usr/share/rubygems/rubygems/specification.rb:794:in `dirs'
from /usr/share/rubygems/rubygems/specification.rb:658:in `each_normal'
from /usr/share/rubygems/rubygems/specification.rb:669:in `_all'
from /usr/share/rubygems/rubygems/specification.rb:822:in `each'
from /usr/share/rubygems/rubygems/specification.rb:864:in `find'
from /usr/share/rubygems/rubygems/specification.rb:864:in `find_inactive_by_path'
from /usr/share/rubygems/rubygems.rb:175:in `try_activate'
from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:132:in `rescue in require'
from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:144:in `require'
from <internal:abrt_prelude>:2:in `<compiled>'
</pre>
The code around path_support.rb:68 involves setting GEM_PATH. What does this error message mean and how can I fix it. Thanks.
This appears passenger looks in /home/<username>/.gem/ruby as a part of its spawn process. If /home/<username> doesn't exist (like with system users that don't have home directories), you get this error.
Here is the bug report.
Related
I have a Windows server 2012 R2 and I downloaded and installed Ruby Hosting Packing from Microsoft Web Platform installer. When I try to run an existing website, I get the following error:
Error
Helicon Zoo module has caught up an error. Please see the details below.
Worker Status
The process was created
Windows error
The pipe has been ended. (ERROR CODE: 109)
Internal module error
message: Application backend read Error. type: ZooException file: App\Jobs\JobBase.cpp line: 531 version: 3.1.98.538
STDERR
[tid-5360004] Couldn't run bundler/setup: cannot load such file -- bundler/setup (String) [tid-5360004] cannot load such file -- rack (LoadError) C:/Zoo/Workers/ruby/lib/app.rb:84:in eval' C:/Ruby19/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:inrequire' (eval):1:in assure_rack' C:/Zoo/Workers/ruby/lib/app.rb:84:ineval' C:/Zoo/Workers/ruby/lib/app.rb:84:in assure_rack' C:/Zoo/Workers/ruby/lib/app.rb:23:inbuild_app' C:/Zoo/Workers/ruby/lib/app.rb:16:in initialize' C:/Zoo/Workers/ruby/lib/worker.rb:4:innew' C:/Zoo/Workers/ruby/lib/worker.rb:4:in initialize' C:/Zoo/Workers/ruby/zoorack.rb:30:innew' C:/Zoo/Workers/ruby/zoorack.rb:30:in <module:Zack>' C:/Zoo/Workers/ruby/zoorack.rb:12:in'
Any idea on how to fix this?
Thanks.
Rails server fails to start in Discourse project either in development or production. Below are the logs when trying to start the server in dev mode. The application was installed and has been working, It's deployed on AWS in production mode and restarting the unicorn loads the application for some time and again the url stops responding with error messages.
Development logs from $rails s
rb t#ip-XXX-XX-XX-XX-app:/var/www/discourse# vi
config/environments/development.r
root#ip-172-31-25-46-app:/var/www/discourse# rails s
=> Booting Puma
=> Rails 5.1.4 application starting in production
=> Run `rails server -h` for more startup options
Exiting
bundler: failed to load command: script/rails (script/rails)
Redis::CommandError: ERR Error running script (call to f_b06356ba4628144e123b652c99605b873107c9be): #user_script:14: #user_script: 14: -MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error.
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/redis-3.3.5/lib/redis/client.rb:121:in `call'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/redis-3.3.5/lib/redis.rb:2399:in `block in _eval'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/redis-3.3.5/lib/redis.rb:58:in `block in synchronize'
/usr/local/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/redis-3.3.5/lib/redis.rb:58:in `synchronize'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/redis-3.3.5/lib/redis.rb:2398:in `_eval'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/redis-3.3.5/lib/redis.rb:2450:in `evalsha'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/message_bus-2.1.1/lib/message_bus/backends/redis.rb:380:in `cached_eval'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/message_bus-2.1.1/lib/message_bus/backends/redis.rb:140:in `publish'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/message_bus-2.1.1/lib/message_bus.rb:248:in `publish'
/var/www/discourse/lib/distributed_cache.rb:72:in `publish'
**Production logs **
/var/www/discourse/lib/demon/base.rb:109:in `ensure_running'
/var/www/discourse/lib/demon/base.rb:34:in `block in ensure_running'
/var/www/discourse/lib/demon/base.rb:33:in `each'
/var/www/discourse/lib/demon/base.rb:33:in `ensure_running'
config/unicorn.conf.rb:145:in `master_sleep'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:284:in `join'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/unicorn-5.1.0/bin/unicorn:126:in `<top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.3.0/bin/unicorn:23:in `load'
/var/www/discourse/vendor/bundle/ruby/2.3.0/bin/unicorn:23:in `<main>'
E, [2018-01-04T08:43:37.949928 #60] ERROR -- : reaped #<Process::Status: pid 5870 exit 1> worker=unknown
Detected dead worker 5870, restarting...
Loading Sidekiq in process id 5883
Failed to report error: MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error. 4 Redis::CommandError (MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error.)
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/redis-3.3.0/lib/redis/client.rb:121:in `call' web-exception
Redis logs
47:M 17 Jan 09:38:01.070 # Can't save in background: fork: Cannot allocate memory
47:M 17 Jan 09:38:07.087 * 10000 changes in 60 seconds. Saving...
The issue has been fixed, Edited this file
/etc/sysctl.conf and added the line at last
vm.overcommit_memory=1
After this restarted sysctl.
$ sudo sysctl -p /etc/sysctl.conf
Redis doesn't need the amount of memory which OS thinks, the status 1 means always overcommit, never check.
More details can be found from Redis Docs.
I have a server with Rails 5.1, Phusion_Passenger and Nginx.
When I start the server with just Phusion_Passenger, all is good:
=============== Phusion Passenger Standalone web server started ===============
PID file: /project/tmp/pids/passenger.3000.pid
Log file: /project/log/passenger.3000.log
Environment: development
Accessible via: http://0.0.0.0:3000/
You can stop Phusion Passenger Standalone by pressing Ctrl-C.
Problems? Check https://www.phusionpassenger.com/library/admin/standalone/troubleshooting/
===============================================================================
[ N 2017-09-26 15:13:06.4195 8753/T5 age/Cor/SecurityUpdateChecker.h:374 ]: Security update check: no update found (next check in 24 hours)
When I try to start and access the same instance with Nginx as the overlay, I get the following error:
App 8129 stdout:
App 8129 stdout:
[ E 2017-09-26 15:06:26.4848 1774/T1l age/Cor/App/Implementation.cpp:304 ]: Could not spawn process for application /project: An error occurred while starting up the preloader.
Error ID: e18b79ab
Error details saved to: /tmp/passenger-error-YkowRo.html
Message from application: Cannot load `Rails.application.database_configuration`:
undefined method `[]' for nil:NilClass (NoMethodError)
(erb):13:in `<main>'
It seems that when you load the rails app with Nginx, it cannot access the "Rails" object.
Passenger does not have a default environment set in the passenger.conf. Added this variable and it fixed the problem.
passenger_app_env development;
I am deploying my app using puma+nginx+capistrano on rails 5 and using this tutorial http://codepany.com/blog/rails-5-puma-capistrano-nginx-jungle-upstart/. I performed all the steps. But when I do:
start puma-manager
I get following error:
start: Rejected send message, 1 matched rules; type="method_call",
sender=":1.1" (uid=500 pid=2737 comm="start puma-manager ")
interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)"
requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")
I am not able to start my app and what is the error here, I am not able to understand. How can I correct this?
I have a problem with the Aptana Studio 3.
It is a fresh installation. I have imported a Ruby on Rails - project that a edited with a texteditor before. I want to use Aptana, for a more comfortable development but the Content Assist fails.
If I try to use the Content Assist it throws the following exception and write it to the Console:
[2013-03-08 16:34:40] An error occurred while processing the invoke block for the command ERb Content Assist in C:\Users\Chris\Aptana Rubles\rails.ruble\commands\content_assist.rb: (NoMethodError) undefined method `getInstance' for Java::ComAptanaIndexCore::IndexManager:Class
org.jruby.exceptions.RaiseException: (NoMethodError) undefined method `getInstance' for Java::ComAptanaIndexCore::IndexManager:Class
at Rails::ContentAssistant.index_manager(C:/Users/Chris/Aptana Rubles/rails.ruble/lib/content_assistant.rb:87)
at Rails::ContentAssistant.gem_indices(C:/Users/Chris/Aptana Rubles/rails.ruble/lib/content_assistant.rb:79)
at org.jruby.RubyProc.call(org/jruby/RubyProc.java:274)
at org.jruby.RubyProc.call(org/jruby/RubyProc.java:229)
at Java::JavaUtil::Collection.each(C:/Users/Chris/AppData/Local/Aptana Studio 3/plugins/org.jruby_1.6.4.1331328108/lib/ruby/site_ruby/shared/builtin/java/java.util.rb:7)
at org.jruby.RubyEnumerable.collect(org/jruby/RubyEnumerable.java:706)
at Rails::ContentAssistant.gem_indices(C:/Users/Chris/Aptana Rubles/rails.ruble/lib/content_assistant.rb:79)
at Rails::ContentAssistant.gem_and_project_indices(C:/Users/Chris/Aptana Rubles/rails.ruble/lib/content_assistant.rb:74)
at Rails::ContentAssistant.assist(C:/Users/Chris/Aptana Rubles/rails.ruble/lib/content_assistant.rb:31)
at #<Class:0x101f95cf6>.define_content_assist(C:\Users\Chris\Aptana Rubles\rails.ruble\commands\content_assist.rb:7)
at org.jruby.RubyProc.call(org/jruby/RubyProc.java:274)
at org.jruby.RubyProc.call(org/jruby/RubyProc.java:233)
The Aptana Log File contains this message:
!ENTRY org.eclipse.ui 4 4 2013-03-08 16:34:40.465
!MESSAGE "Content Assist" did not complete normally. Please see the log for more information.
!ENTRY org.eclipse.ui 4 0 2013-03-08 16:34:40.465
!MESSAGE (Errno::EINVAL) =::
!STACK 0
org.jruby.exceptions.RaiseException: (Errno::EINVAL) =::
at org.jruby.RubyHash.replace(org/jruby/RubyHash.java:1623)
I don't know how to handle this error. Do I have to install anything else to use the Content Assist with Ruby on Rails?
I found a solution at https://jira.appcelerator.org/browse/APSTUD-2718
As a workaround:
1) Commands > Rails Bundle > Edit this Bundle will grab a copy of the
new code
This removed the error messages for me.
I have found this link, that describes my problem as "Unresolved" (reported in 12/Sep/12):
https://jira.appcelerator.org/browse/APSTUD-7406
But this is "Aptana Studio 3.2.2" and I have got Version 3.3.3, I can't believe that this problem isn't solved.
Anybody else using Aptana knowing this problem?