Hi everyone.
Backgroundrb is doing some really sweet stuff for my project. Thanks!
I am trying to integrate backgroundrb with cruisecontrol.rb. I started
off by creating a simple Rakefile:::::
desc 'task for starting up backgroundrb'
task :cruise do
template = <<-EOF
:backgroundrb:
:ip: 0.0.0.0
:port: 11006
:development:
:backgroundrb:
:log: foreground
:test:
:backgroundrb:
:log: foreground
:production:
:backgroundrb:
:log: foreground
EOF
backgroundrb_configuration = ERB.new(template).result(binding)
#put backgroundrb_configuration, "#{RAILS_ROOT}/config/backgroundrb.yml"
bfile = File.new("#{RAILS_ROOT}/config/backgroundrb.yml", "w")
bfile.puts backgroundrb_configuration
sh "chmod 755 #{RAILS_ROOT}/config/backgroundrb.yml"
begin
def shutmedown
sh "ruby script/backgroundrb stop"
end
rescue
'got hereer.'
end
sh "ruby script/backgroundrb start"
end
----------------------------------------------
/home/ian/bluffware/backend/vendor/plugins/backgroundrb/lib/backgroundrb/bdrb_config.rb:38:in
`read_config': undefined method `[]' for false:FalseClass (NoMethodError)
from
/home/ian/bluffware/backend/vendor/plugins/backgroundrb/lib/backgroundrb.rb:15:in
`init'
from
/home/ian/bluffware/backend/vendor/plugins/backgroundrb/lib/backgroundrb.rb:175
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require'
from
/usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in
`require'
from
/usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in
`new_constants_in'
from
/usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in
`require'
from
/home/ian/bluffware/backend/vendor/plugins/backgroundrb/init.rb:2:in
`evaluate_init_rb'
... 11 levels...
.......................
I looked at the line in question
(~/vendor/plugins/backgroundrb/lib/backgroundrb/bdrb_config.rb:38)
and added some output to see what is going on lines 28-32:::
def self.read_config(config_file)
#my debugging info..
puts config_file
puts File.exist?(config_file)
puts IO.read(config_file)
puts YAML.load(ERB.new(IO.read(config_file)).result)
config = YAML.load(ERB.new(IO.read(config_file)).result)
environment = RAILS_ENV.to_sym
File.exists says it sees my conf file but IO.read doesn't see anything. This is
strange cause I can repeat this process in irb and everything is there. Also,
the conf file is definitely getting generated cause it's there after the fact.
Does anyone see what I might be overlooking?
_______________________________________________
Backgroundrb-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/backgroundrb-devel