Can't run a single script (YAML error)
maioral opened this issue · comments
Leandro Maioral commented
Everytime i try to run the script i get the following error:
$ ./foreverb_test.rb
/Users/Leandro/.rvm/gems/ruby-1.9.2-p180/gems/foreverb-0.2.6/lib/forever/base.rb:219:in `write_config!': undefined method `load_file' for YAML:Module (NoMethodError)
from /Users/Leandro/.rvm/gems/ruby-1.9.2-p180/gems/foreverb-0.2.6/lib/forever/base.rb:17:in `initialize'
from /Users/Leandro/.rvm/gems/ruby-1.9.2-p180/gems/foreverb-0.2.6/lib/forever.rb:20:in `new'
from /Users/Leandro/.rvm/gems/ruby-1.9.2-p180/gems/foreverb-0.2.6/lib/forever.rb:20:in `run'
from ./foreverb_test.rb:4:in `<main>'
Here is the script code:
#!/usr/bin/env ruby
require 'forever'
Forever.run do
sleep 5
end
Davide D'Agostino commented
mmm pretty strange, you should solve this adding require 'yaml'
before all.
Leandro Maioral commented
@DAddYE thanks, but now i have a different error:
/Users/Leandro/.rvm/gems/ruby-1.9.2-p180/gems/foreverb-0.2.6/lib/forever/base.rb:220:in `write_config!': undefined method `delete_if' for false:FalseClass (NoMethodError)
from /Users/Leandro/.rvm/gems/ruby-1.9.2-p180/gems/foreverb-0.2.6/lib/forever/base.rb:17:in `initialize'
from /Users/Leandro/.rvm/gems/ruby-1.9.2-p180/gems/foreverb-0.2.6/lib/forever.rb:20:in `new'
from /Users/Leandro/.rvm/gems/ruby-1.9.2-p180/gems/foreverb-0.2.6/lib/forever.rb:20:in `run'
from foreverb_test.rb:4:in `<main>'
Davide D'Agostino commented
Problem solved?
If not try to remove ~/.foreverb
and start your app.
Leandro Maioral commented
@DAddYE, now it worked. Even without requiring yaml. Thank you! You know why this happen?
Davide D'Agostino commented
Maybe you have got a corrupted yml file?