Skip to content
This repository

Welcome to the craken wiki!


For some reason, I had to add the following line to craken.rake in each task right after the require erb call to get this plugin to work.

require “#{RAILS_ROOT}/vendor/plugins/craken/lib/craken.rb”

It appears that when the rake tasks are executed the plugin load paths are not being added to $LOAD_PATH, though I’m not sure why this is happening.


In the project I’m testing this in we’re loading the rails environment explicitly when rake runs. Probably not such a good idea to test it there!
I’ll fix it.

- Doug


Can’t install with config.gem:

./config/environment.rb:
config.gem ‘craken’, :source => ‘http://github.com/latimes/craken/tree/master’

gem install craken —source http://github.com/latimes/craken/tree/master
ERROR: While executing gem … (Zlib::GzipFile::Error)
not in gzip format


Fixed! -Doug


Can you provide an example of using craken with multi-stage plugin?
It’s unclear to me exactly how I use this thing after I create ./config/craken/raketab

You mention something about namespace, but provide no example.


$ cap testing craken:install
  * executing `testing'
    triggering start callbacks for `craken:install'
  * executing `multistage:ensure'
  * executing `craken:install'
/usr/lib/ruby/gems/1.8/gems/capistrano-2.3.0/lib/capistrano/configuration/namespaces.rb:188:in `method_missing': undefined local variable or method `env_args' for #<Capistrano::Configuration::Namespaces::Namespace:0xb7775e2c> (NameError)
        from ./vendor/plugins/craken/recipes/craken.rb:6:in `load'
        from /usr/lib/ruby/gems/1.8/gems/capistrano-2.3.0/lib/capistrano/configuration/execution.rb:80:in `instance_eval'
        from /usr/lib/ruby/gems/1.8/gems/capistrano-2.3.0/lib/capistrano/configuration/execution.rb:80:in `execute_task_without_callbacks'

Looks like there’s a bug in the capistrano config, I’ll fix it. (UPDATE: Nate Murray sent me a patch: c51003fa8e453ce6536290dfc3ee00bfe94764d4)


Another issue:

I ran rake craken:install from my dev environment:

./config/craken/raketab:


*/5 * * * * cd #{deploy_path} && rake --silent RAILS_ENV=#{raketab_rails_env} utils:update_stats

Resulting crontab installed is broken:

$ crontab -e



		
  1. directorylist raketab
    */5 * * * * cd /x/home/username/projects/todo/rails/directorylist && /usr/bin/rake —silent RAILS_ENV=development cd #{deploy_path} && rake —silent RAILS_ENV=#{raketab_rails_env} utils:update_stats
  2. directorylist raketab end

Notice the rake command has a “cd …” injected into it erroneously.


Craken installs the cd and rake commands so you only provide the rake tasks in your raketab file:


*/5 * * * * utils:update_stats

Here’s what your crontab will look like after install:



		
  1. directorylist raketab
    */5 * * * * cd /x/home/username/projects/todo/rails/directorylist && /usr/bin/rake —silent RAILS_ENV=development utils:update_stats
  2. directorylist raketab end

The RAILS_ENV mode is set to whatever mode you were in when you ran rake craken:install
I.e if you want to install it in production mode:


$ RAILS_ENV=production rake craken:install

- Doug


Hi, I tried installing craken using ‘script/plugin install git://github.com/latimes/craken.git’ as well as ‘git submodule add git://github.com/latimes/craken.git vendor/plugins/craken’. In both cases, when trying to run rake, I get the following error:


nyon:plugins mnyon$ rake -T 
(in /Users/mnyon/Documents/workspace/crm-core)
rake aborted!
no such file to load -- enumeration
/Users/mnyon/Documents/workspace/crm-core/rakefile:10
(See full trace by running task with --trace)

I have tried adding the lib directory to the load_path in init.rb, but I still get the same error. Thanks.

- scorintha


Fixed!

- Doug


Something went wrong with that request. Please try again.