0

I've installed Ruby on Rails using RailsInstaller and also postgresql in Windows 8. I'm trying to run rails server using files for a pre existing app but I'm getting the error 'Worker mode not supported on JRuby or Windows'.

In my config/puma.rb file i've set workers to 0, then get an error about daemon mode not supported on windows. basically each time i change something i get more errors.

I've fixed up environment variables, gems, etc (like in other posts) such as this Cannot install Puma gem on Ruby on Rails. there any hope of running a pre-existing RoR app built in linux on a windows machine?

When I run rails server for the RoR 'blog' example it works fine, so I know that RoR is definitely working in windows!

This is my -'de-identified' config/puma.rb file. Is it because in windows I have no /var/app folder?? I've played around with directories etc to no avail.

` #!/usr/bin/env puma # start puma with: # RAILS_ENV=production bundle exec puma -C ./config/puma.rb workers 0 theident = 'nameofthing' application_path = '/var/app/'+ theident + '.address.com.au/current' railsenv = 'production' directory application_path environment railsenv daemonize false pidfile "#{application_path}/tmp/pids/puma-#{railsenv}.pid" state_path "#{application_path}/tmp/pids/puma-#{railsenv}.state" stdout_redirect"#{application_path}/log/puma-#{theident}.log" threads 0, 16 bind "unix:///var/run/puma/" + theident + "_app.sock" ` 

I have changed those directories to the current path and now running 'rails server' starts going , but localhost:3000 is a page not working. I am getting errors around SIGUSR1 not working , SIGUSR2 not working ,etc

0

1 Answer 1

1

The "workers" method isn't supported for JRuby nor Windows, so the best solution would be to remove the line from puma.rb causing the error. In my case I removed;

workers Integer(ENV['WEB_CONCURRENCY'] || 2) 

So remaining I have;

threads_count = Integer(ENV['RAILS_MAX_THREADS'] || 5) threads threads_count, threads_count preload_app! rackup DefaultRackup port ENV['PORT'] || 3000 environment ENV['RACK_ENV'] || 'development' on_worker_boot do # Worker specific setup for Rails 4.1+ # See: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot ActiveRecord::Base.establish_connection end 

It might be different for you, but the specific line will start with "workers"

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for the suggestion - in the end I had to remove the puma gem from my gemfile and install node js before getting it to work!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.