2016-07-27 8 views
0

RailsInstaller와 Windows 8의 postgresql을 사용하여 Ruby on Rails를 설치했습니다. 기존 앱의 파일을 사용하여 rails server을 실행하려고했지만 'JRuby 또는 Windows에서 지원되지 않는 작업자 모드'오류가 발생합니다.Windows의 RoR이 Linux의 RoR로 작성된 기존 앱에서 작동하지 않습니다.

내 config/puma.rb 파일에서 worker를 0으로 설정 한 후 Windows에서 지원하지 않는 데몬 모드에 대한 오류가 표시됩니다. 기본적으로 내가 뭔가를 바꿀 때마다 나는 더 많은 오류를 얻는다.

나는이 Cannot install Puma gem on Ruby on Rails.과 같은 환경 변수, 보석 등을 (다른 게시물에서와 같이) Windows 시스템에 Linux에 내장 된 기존 RoR 앱을 실행할 희망이 있습니까?

RoR '블로그'예제의 레일 서버를 실행할 때 제대로 작동하므로 RoR이 확실히 Windows에서 작동한다는 것을 알았습니다!

이것은 내 '식별 된'config/puma.rb 파일입니다. 그것은 Windows에서/var/app 폴더가 없기 때문입니까? 나는 디렉토리 등으로 아무 소용이 주위에 놀았 어.

` 
#!/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" ` 

나는 현재 경로에 해당 디렉토리를 변경하고 지금 실행하려고 시작 '서버가 레일',하지만 로컬 호스트는 한 : 3000 작동하지 않는 페이지입니다. SIGUSR1이 작동하지 않고 SIGUSR2가 작동하지 않는 등의 오류가 발생했습니다.

답변

1

JRuby도 Windows도 "workers"방법이 지원되지 않기 때문에 가장 좋은 해결책은 오류를 일으키는 puma.rb에서 줄을 제거하는 것입니다.. 나의 경우에는 제거했다;

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

이렇게 남아 있습니다.

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 

그것은 당신 다를 수 있습니다 만, 특정 라인이 제안을 "노동자"

+0

감사로 시작합니다 - 결국 내 gemfile에서 퓨마 보석을 제거하기 전에 노드 JS를 설치했다 그것을 얻는 것! – RebRy

관련 문제