Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tail: bar.log: No such file or directory and #30

Open
JeanOsorio opened this issue Nov 3, 2014 · 1 comment
Open

tail: bar.log: No such file or directory and #30

JeanOsorio opened this issue Nov 3, 2014 · 1 comment

Comments

@JeanOsorio
Copy link

I'm usign foreverb to run two daemon:

generate_roster_kids.rb

#!/usr/bin/ruby
require 'rubygems' unless defined?(Gem)
require 'forever'
require 'redis'

Forever.run do
  REDIS = Redis.new()

  log  "bar.log" # Default: File.expand_path(dir, '/log/[file_name].log')


  every 2.seconds do


    REDIS.SUNIONSTORE :busy, REDIS.keys('Busy:*') rescue REDIS.SUNIONSTORE :busy, nil
    REDIS.EXPIRE :busy, 3

    REDIS.SUNIONSTORE :online, REDIS.keys('Online:*') rescue REDIS.SUNIONSTORE :online, nil
    REDIS.EXPIRE :online, 3
  end

end

booking_release.rb

#!/usr/bin/ruby
require 'rubygems' unless defined?(Gem)
require 'forever'
require File.expand_path("../../../config/environment", __FILE__)

Forever.run do
  every 2.seconds do
    @booking = Booking.where(booking_available: false, :created_at.lt => DateTime.now.to_datetime.in_time_zone("Madrid") - 10.minutes).to_a
    @booking.each do |book|
      if book.Ds_Response.nil?
        book.booking_available = true
        book.save!
        puts "update #{book.id}"
      end
    end
    puts "#{@booking.count}"
  end
end

Those file are in my blabloo/script/user folder, as you can see the generate_roster_kids log on a file "bar.log", I have the log file on blabloo/script/log/bar.log but when I try to use the command foreverb tail generate_roster_kids or foreverb tail booking_release I always get:

tail: bar.log: No such file or directory

Also, a week ago I have a third daemon with the name of "classes_notification.rb" and now when I try to run foreverb start --all I get the following:

Do you want really start /Users/jeanosorio/repos/blabloo/script/user/generate_roster_kids.rb? Do you want really start /Users/jeanosorio/repos/blabloo/script/user/classes_notification.rb? Do you want really start /Users/jeanosorio/repos/blabloo/script/user/booking_release.rb?

but the classes_notification file does not exist. What I'm doing wrong???, how can I stop foreverb to ask me for the classes_notification daemon and what happen with the log file.

Thanks in advance for your help.

@DAddYE
Copy link
Owner

DAddYE commented Nov 3, 2014

can you post the classes_notification.rb ?

Also, require File.expand_path("../../../config/environment", __FILE__) is this rails? Is one of recent versions that uses bundler? If so:

#!/usr/bin/ruby
require File.expand_path("../../../config/environment", __FILE__)

Then just add forever to the Gemfile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants