2012-08-22 2 views
1

내 컴퓨터에 두 개의 앱이 있습니다.
각 앱 (서버)은 자체 gemset을 가지고 있으며 다른 루비 버전에서 작동합니다.rvm이 달린 다른 루비에 대해 하나의 신

나는 자신의 보석 세트에 설치된 신이있는 앱을 관리 할 것입니다.

내 신 설정 파일 config.god은 다음과 같습니다

God.watch do |w| 
    current_path = "/home/vagrant/server-1" 
    w.name = "server 1" 
    w.start = "ruby #{current_path}/simple-server.rb" 
    w.keepalive 
end 

God.watch do |w| 
    current_path = "/home/vagrant/server-2" 
    w.name = "server 2" 
    w.start = "ruby #{current_path}/simple-server.rb" 
    w.keepalive 
end 

내 서버는 단순히 파일 (/home/vagrant/server-2/simple-server.rb)에 루비 버전을 작성 :

require "date" 

loop do 
    # simple console output 
    puts "Hello on #{RUBY_VERSION}, #{RUBY_PATCHLEVEL}, #{RUBY_PLATFORM}, #{RUBY_RELEASE_DATE}" 

    # Specify the name of the log file 
    log_file = File.join File.expand_path(File.dirname(__FILE__)), "testfile.txt" 

    # Write the log into the file 
    File.open(log_file, 'a') do |f| 
     date = DateTime.now 
     date = date.strftime("%H:%M:%S") 

     f.puts "#{date} on #{RUBY_VERSION}, #{RUBY_PATCHLEVEL}, #{RUBY_PLATFORM}, #{RUBY_RELEASE_DATE}" 
    end 

    sleep 2 
end 

내가 god -c config.god 하나님을 실행합니다.

문제는 내 응용 프로그램이 .rvmrc에 지정된 루비 버전으로 실행되고 있지 않다는 것입니다.

나는 또한 시도 :

  • ~/.rvm/bin/wrapped_god -d config.god -D
  • rvmsudo ~/.rvm/bin/wrapped_god -d config.god -D
  • rvmsudo god -d config.god -D

이 경우에 대한 해결책이 있습니까?

편집 2012년 8월 27일 다음과 같이 내 신 설정을 변경 한

:

w.start="~/.rvm/bin/rvm in #{current_path} do ruby simple-server.rb" 

그리고 그것은했다.

+0

당신은 의미'god' RVM에 싸여 경우에도 필요한 루비 버전을 사용하지 않는 이유는 무엇입니까? –

답변

1

시도 :

start="~/.rvm/bin/rvm in #{current_path} do ruby simple-server.rb" 
+0

아니요, 작동하지 않습니다. 이게 어떻게 작동할까요? 커맨드 라인에서 호출 할 때'인식 할 수없는 커맨드 라인 인수 : in '(참조 :'rvm usage ')' – czerasz

+0

이것은 이전 rvm을 사용하고 있다는 것을 의미합니다 :'rvm get stable'을 수정하면 작동합니다. – mpapis

+0

불행히도 작동하지 않습니다. – czerasz

관련 문제