Category: linux

Ruby on Rails: How can I specify runner script environment

I am using a shell script to run some runner scripts in my Ruby on Rails app. I need to run it on the production database, but the following: #!/bin/bash /usr/bin/ruby RAILS_ENV=production ../script/runner ../lib/tasks.rb gives an error: /usr/bin/ruby: No such file or directory — RAILS_ENV=production (LoadError) I have tried to force it in config/environment.rb ENV[‘RAILS_ENV’] […]

How to implement a practical fiber scheduler?

I know the very basics about using coroutines as a base and implementing a toy scheduler. But I assume it’s oversimplified view about asynchronous schedulers in whole. There are whole set of holes missing in my thoughts. How to keep the cpu from running a scheduler that’s running idle/waiting? Some fibers just sleep, others wait […]