braid and fattr problem on ruby 1.9.2 - ruby-on-rails

i have a problems with running braid on ruby 1.9.2. The problem is with fattr gem
$ braid
/opt/local/lib/ruby1.9/gems/1.9.1/gems/fattr-2.1.0/lib/fattr.rb:85:in `block (2 levels) in fattrs': wrong number of arguments (1 for 0) (ArgumentError)
from /opt/local/lib/ruby1.9/gems/1.9.1/gems/fattr-2.1.0/lib/fattr.rb:90:in `instance_eval'
from /opt/local/lib/ruby1.9/gems/1.9.1/gems/fattr-2.1.0/lib/fattr.rb:90:in `call'
from /opt/local/lib/ruby1.9/gems/1.9.1/gems/fattr-2.1.0/lib/fattr.rb:90:in `block (2 levels) in fattrs'
from (eval):3:in `call'
from (eval):3:in `arity!'
from (eval):4:in `arity'
from /opt/local/lib/ruby1.9/gems/1.9.1/gems/main-4.2.0/lib/main/parameter.rb:105:in `sanity_check!'
from /opt/local/lib/ruby1.9/gems/1.9.1/gems/main-4.2.0/lib/main/parameter.rb:101:in `initialize'
from /opt/local/lib/ruby1.9/gems/1.9.1/gems/main-4.2.0/lib/main/parameter.rb:53:in `block in create'
from /opt/local/lib/ruby1.9/gems/1.9.1/gems/main-4.2.0/lib/main/parameter.rb:53:in `instance_eval'
from /opt/local/lib/ruby1.9/gems/1.9.1/gems/main-4.2.0/lib/main/parameter.rb:53:in `create'
from /opt/local/lib/ruby1.9/gems/1.9.1/gems/main-4.2.0/lib/main/program/class_methods.rb:193:in `option'
from /opt/local/lib/ruby1.9/gems/1.9.1/gems/main-4.2.0/lib/main/program/class_methods.rb:92:in `set_default_options!'
from /opt/local/lib/ruby1.9/gems/1.9.1/gems/main-4.2.0/lib/main/program/class_methods.rb:65:in `block in build'
from /opt/local/lib/ruby1.9/gems/1.9.1/gems/main-4.2.0/lib/main/program/class_methods.rb:63:in `module_eval'
from /opt/local/lib/ruby1.9/gems/1.9.1/gems/main-4.2.0/lib/main/program/class_methods.rb:63:in `build'
from /opt/local/lib/ruby1.9/gems/1.9.1/gems/main-4.2.0/lib/main/factories.rb:16:in `run'
from /opt/local/lib/ruby1.9/gems/1.9.1/gems/main-4.2.0/lib/main/factories.rb:25:in `Main'
from /opt/local/lib/ruby1.9/gems/1.9.1/gems/braid-0.6.2/bin/braid:13:in `<top (required)>'
from /opt/local/bin/braid:19:in `load'
from /opt/local/bin/braid:19:in `<main>'
Do you know any solution for this problem?

This is a common problem on the main fattr branch/gem. Someone has patched it though the main branch hasn't pulled the changes yet. Try removing the fattr gem installed with braid and replacing it with this version https://github.com/kitop/fattr.
Update: The main branch has now been updated for 1.9.2.

Related

Getting ExecJS when compiling rassets:precompile against production

So I am running into an odd issue. I cannot precompile assets on Rails 5 against production. I keep getting the same error message, irrespective if I precompile on the server itself or on my local environment.
georg$ RAILS_ENV=production bundle exec rake assets:precompile
rake aborted!
ExecJS::RuntimeError: SyntaxError: Unexpected token: name ($)
get#(execjs):3538:630
(execjs):4058:47
(execjs):1:46
global code#(execjs):1:58
/Users/georg/.rvm/gems/ruby-2.2.4/gems/execjs-2.7.0/lib/execjs/external_runtime.rb:39:in `exec'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/execjs-2.7.0/lib/execjs/external_runtime.rb:21:in `eval'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/execjs-2.7.0/lib/execjs/external_runtime.rb:46:in `call'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/uglifier-3.2.0/lib/uglifier.rb:195:in `run_uglifyjs'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/uglifier-3.2.0/lib/uglifier.rb:157:in `compile'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/sprockets/uglifier_compressor.rb:53:in `call'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/sprockets/uglifier_compressor.rb:28:in `call'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:75:in `call_processor'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:56:in `reverse_each'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:56:in `call_processors'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/sprockets/loader.rb:134:in `load_from_unloaded'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/sprockets/loader.rb:60:in `block in load'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/sprockets/loader.rb:44:in `load'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/sprockets/cached_environment.rb:20:in `block in initialize'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/sprockets/cached_environment.rb:47:in `yield'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/sprockets/cached_environment.rb:47:in `load'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/sprockets/base.rb:66:in `find_asset'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/sprockets/base.rb:73:in `find_all_linked_assets'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/sprockets/manifest.rb:142:in `block in find'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/sprockets/legacy.rb:114:in `block (2 levels) in logical_paths'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:228:in `block in stat_tree'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:212:in `block in stat_directory'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:209:in `each'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:209:in `stat_directory'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:227:in `stat_tree'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:231:in `block in stat_tree'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:212:in `block in stat_directory'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:209:in `each'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:209:in `stat_directory'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:227:in `stat_tree'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:231:in `block in stat_tree'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:212:in `block in stat_directory'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:209:in `each'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:209:in `stat_directory'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:227:in `stat_tree'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:231:in `block in stat_tree'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:212:in `block in stat_directory'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:209:in `each'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:209:in `stat_directory'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:227:in `stat_tree'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/sprockets/legacy.rb:105:in `each'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/sprockets/legacy.rb:105:in `block in logical_paths'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/sprockets/legacy.rb:104:in `each'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/sprockets/legacy.rb:104:in `logical_paths'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/sprockets/manifest.rb:140:in `find'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/sprockets/manifest.rb:185:in `compile'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-rails-3.2.0/lib/sprockets/rails/task.rb:68:in `block (3 levels) in define'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-3.7.1/lib/rake/sprocketstask.rb:147:in `with_logger'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/sprockets-rails-3.2.0/lib/sprockets/rails/task.rb:67:in `block (2 levels) in define'
/Users/georg/.rvm/gems/ruby-2.2.4/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
/Users/georg/.rvm/gems/ruby-2.2.4/bin/ruby_executable_hooks:15:in `eval'
/Users/georg/.rvm/gems/ruby-2.2.4/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
To solve the issue I did the following:
1.) I have a subfolder structure I am referring to under assets/javascript, so I added that to the asset path and I thought that may be the issue - but apparently it isn't. I read the paths in like this:
Dir.glob("#{Rails.root}/app/assets/javascripts/**/").each do |path|
config.assets.paths << path
end
2.) I removed all references from application.js - it is empty and I still get the error.
3.) I removed / added therubyracer
# gem 'therubyracer', platforms: :ruby
4.) I installed and updated the execjs gem independently
5.) Eventually, I was running out of ideas. Given that I get the error when there's nothing to compile.
My environment:
georg$ rails -v
Rails 5.0.5
georg$ ruby -v
ruby 2.2.4p230 (2015-12-16 revision 53155) [x86_64-darwin16]
The compiling was done on OSx and Debian.
Any hints are much appreciated!!
The issue was with a custom js file in the tree. Given that there are plenty of js files included in the applciation.js it is obviously a painful way of trial and error to get to the bottom of the issue given the limited information I got from the trace. It would be interesting to know if there are ways to get more information in return to avoid lengthy inefficient debug sessions.
For the time being, I removed all js, added them one-by-one and run a precompile till I hit the offending code.

rspec error(michael hartl )

This is the error I am getting in using bundle exec rspec spec/requests/static_pages_spec.rb.
I have included gem test-unit.
Please help I am completely new to rails.
/home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-rails-2.13.1/lib/rspec/rails/fixture_support.rb:19:in `block (2 levels) in <module:FixtureSupport>': private method `fixture_path' called for #<RSpec::Core::Configuration:0x005584a641b380> (NoMethodError)
Did you mean? fixture_path=
from /home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-rails-2.13.1/lib/rspec/rails/fixture_support.rb:17:in `class_eval'
from /home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-rails-2.13.1/lib/rspec/rails/fixture_support.rb:17:in `block in <module:FixtureSupport>'
from /home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-4.0.8/lib/active_support/concern.rb:114:in `class_eval'
from /home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-4.0.8/lib/active_support/concern.rb:114:in `append_features'
from /home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:791:in `include'
from /home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:791:in `safe_include'
from /home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:785:in `block in configure_group'
from /home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:783:in `each'
from /home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:783:in `configure_group'
from /home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-2.13.1/lib/rspec/core/world.rb:47:in `configure_group'
from /home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-2.13.1/lib/rspec/core/example_group.rb:290:in `set_it_up'
from /home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-2.13.1/lib/rspec/core/example_group.rb:241:in `subclass'
from /home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-2.13.1/lib/rspec/core/example_group.rb:228:in `describe'
from /home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-2.13.1/lib/rspec/core/dsl.rb:18:in `describe'
from /home/sarfraz/Desktop/Rails Apps/sample_app/spec/requests/static_pages_spec.rb:3:in `<top (required)>'
from /home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:819:in `load'
from /home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:819:in `block in load_spec_files'
from /home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:819:in `each'
from /home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:819:in `load_spec_files'
from /home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-2.13.1/lib/rspec/core/command_line.rb:22:in `run'
from /home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-2.13.1/lib/rspec/core/runner.rb:80:in `run'
from /home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-2.13.1/lib/rspec/core/runner.rb:17:in `block in autorun'
The simplest solution is to upgrade rspec-rails. For example you can use gem 'rspec-rails', '~>2.13' in your Gemfile and do bundle update rspec-rails from a terminal. It setups 2.99.x for you. This version is workable with at least ruby 2.3.4 and provides backward compatibility.

Upgrading to Rails 3.2.2: How to solve the 'undefined method for Syck::DomainType' error related to the Delayed Job gem?

I am running Ruby on Rails 3.2.2 from 3.1.0. I have the issue
undefined method send_register_email\' for #<Syck::DomainType:0x0000012d2346b8>\n/<ABSOLUTE_PATH>/.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/performable_mailer.rb:6:in perform ...
with the DelayedJob gem that many other people have tried to solve: someone made successfully that, others no. I am in the latter category, also if I tried all solutions I've found on the Web.
At this time, in my Gemfile I have:
gem 'rails', '3.2.2'
gem "rake"
...
gem 'delayed_job_active_record'
...
Before upgrading Rails, in my Gemfile I had:
gem 'rails', '~> 3.1.0'
gem "rake"
...
# I also used the following statement by running Rails 3.2.2 but it didn't work.
gem 'delayed_job'
...
In order to send e-mail messages, in my controllers I use code link the following:
::Users::Mailer.delay.send_register_email(#user)
In my APPLICATION_ROOT/app/mailers/users/mailer.rb file I have:
class Users::Mailer < ActionMailer::Base
...
def send_register_email(user)
...
end
end
Before updating to Rails 3.2.2 all was working as well. Now I get the error mentioned above, in the introduction text. How can I try to solve the Delayed Job issue?
I noted that in the database table related to the delayed_job_active_record gem should be a column named 'queue' (see the "Gory Details" section in the official documentation for more information). However, since I was using gem 'delayed_job' it was present in that database table. Can be that the problem?
Another thing I noted is the following (but I think that isn't the problem, for now):
$ rake jobs:work
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/01/04/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /<ABSOLUTE_PATH>/Rakefile:7)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/01/04/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /<ABSOLUTE_PATH>/Rakefile:7)
[Worker(host:<MY_USER>.local pid:76826)] Starting job worker
The following is what is present in the DelayedJob last_error database table column:
{undefined method `send_register_email' for #<Syck::DomainType:0x0000010228a840>
/<ABSOLUTE_PATH>/.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/performable_mailer.rb:6:in `perform'
/<ABSOLUTE_PATH>/.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/backend/base.rb:94:in `block in invoke_job'
/<ABSOLUTE_PATH>/.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/lifecycle.rb:60:in `call'
/<ABSOLUTE_PATH>/.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/lifecycle.rb:60:in `block in initialize'
/<ABSOLUTE_PATH>/.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/lifecycle.rb:65:in `call'
/<ABSOLUTE_PATH>/.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/lifecycle.rb:65:in `execute'
/<ABSOLUTE_PATH>/.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/lifecycle.rb:38:in `run_callbacks'
/<ABSOLUTE_PATH>/.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/backend/base.rb:91:in `invoke_job'
/<ABSOLUTE_PATH>/.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/worker.rb:162:in `block (2 levels) in run'
/<ABSOLUTE_PATH>/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/timeout.rb:58:in `timeout'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/worker.rb:162:in `block in run'
/<ABSOLUTE_PATH>//.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/benchmark.rb:310:in `realtime'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/worker.rb:161:in `run'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/worker.rb:218:in `block in reserve_and_run_one_job'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/lifecycle.rb:60:in `call'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/lifecycle.rb:60:in `block in initialize'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/lifecycle.rb:65:in `call'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/lifecycle.rb:65:in `execute'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/lifecycle.rb:38:in `run_callbacks'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/worker.rb:218:in `reserve_and_run_one_job'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/worker.rb:146:in `block in work_off'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/worker.rb:145:in `times'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/worker.rb:145:in `work_off'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/worker.rb:117:in `block (4 levels) in start'
/<ABSOLUTE_PATH>//.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/benchmark.rb:310:in `realtime'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/worker.rb:116:in `block (3 levels) in start'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/lifecycle.rb:60:in `call'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/lifecycle.rb:60:in `block in initialize'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/lifecycle.rb:65:in `call'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/lifecycle.rb:65:in `execute'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/lifecycle.rb:38:in `run_callbacks'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/worker.rb:113:in `block (2 levels) in start'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/worker.rb:112:in `loop'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/worker.rb:112:in `block in start'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/plugins/clear_locks.rb:7:in `call'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/plugins/clear_locks.rb:7:in `block (2 levels) in <class:ClearLocks>'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/lifecycle.rb:78:in `call'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/lifecycle.rb:78:in `block (2 levels) in add'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/lifecycle.rb:60:in `call'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/lifecycle.rb:60:in `block in initialize'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/lifecycle.rb:78:in `call'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/lifecycle.rb:78:in `block in add'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/lifecycle.rb:65:in `call'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/lifecycle.rb:65:in `execute'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/lifecycle.rb:38:in `run_callbacks'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/worker.rb:111:in `start'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290/gems/delayed_job-3.0.1/lib/delayed/tasks.rb:9:in `block (2 levels) in <top (required)>'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/<ABSOLUTE_PATH>//.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `load'
/<ABSOLUTE_PATH>//.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `<main>'
If you are using bundler try prefixing the script or rake task with "bundle exec" e.g.
bundle exec script/delayed_job -n 2 start
It did the trick for us.
We managed to solve Syck / Psych weirdness in our app by ensuring that setting the YAML parser to Syck was the absolute first thing done when initializing. The reason you can sometimes run into issues is that DelayedJob initializes differently depending on which YAML parser you're using, and if the parser changes during initialization, DelayedJob will probably get it wrong.
Add this to the very top of boot.rb, and see if it helps:
require 'yaml'
YAML::ENGINE.yamler = 'syck'

Error on Rack initialization with JRuby

I am getting this error when starting JBoss with my application built with warbler:
Error: unable to initialize application
org.jruby.rack.RackInitializationException: wrong number of arguments (1 for 0)
Callstack:
gems/gems/actionpack-3.0.9/lib/action_controller/railtie.rb:54:in `Railtie'
gems/gems/activesupport-3.0.9/lib/active_support/ordered_hash.rb:139:in `each'
org/jruby/RubyArray.java:1612:in `each'
gems/gems/activesupport-3.0.9/lib/active_support/ordered_hash.rb:139:in `each'
gems/gems/actionpack-3.0.9/lib/action_controller/railtie.rb:54:in `Railtie'
org/jruby/RubyKernel.java:2062:in `instance_eval'
gems/gems/activesupport-3.0.9/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
gems/gems/activesupport-3.0.9/lib/active_support/lazy_load_hooks.rb:43:in `run_load_hooks'
org/jruby/RubyArray.java:1612:in `each'
gems/gems/activesupport-3.0.9/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
gems/gems/actionpack-3.0.9/lib/action_controller/base.rb:232:in `Base'
gems/gems/actionpack-3.0.9/lib/action_controller/base.rb:169:in `ActionController'
gems/gems/actionpack-3.0.9/lib/action_controller/base.rb:3:in `(root)'
gems/gems/actionpack-3.0.9/lib/action_controller/base.rb:48:in `Railtie'
org/jruby/RubyKernel.java:2079:in `instance_exec'
gems/gems/railties-3.0.9/lib/rails/initializable.rb:25:in `run'
gems/gems/railties-3.0.9/lib/rails/initializable.rb:50:in `run_initializers'
org/jruby/RubyArray.java:1612:in `each'
gems/gems/railties-3.0.9/lib/rails/initializable.rb:49:in `run_initializers'
gems/gems/railties-3.0.9/lib/rails/application.rb:134:in `initialize!'
org/jruby/RubyKernel.java:2093:in `send'
gems/gems/railties-3.0.9/lib/rails/application.rb:77:in `method_missing'
config/environment.rb:5:in `(root)'
org/jruby/RubyKernel.java:1038:in `require'
config/environment.rb:167:in `load_environment'
classpath:/./jruby/rack/rails.rb:172:in `to_app'
classpath:/./jruby/rack/rails.rb:192:in `new'
<web.xml>:1:in `(root)'
org/jruby/RubyKernel.java:2062:in `instance_eval'
classpath:/./vendor/rack-1.3.5/rack/builder.rb:51:in `initialize'
<web.xml>:1:in `(root)'
Any ideas?
We had the same problems with Rails 3.0.11 / JBoss 5 and the latest jruby-rack.
To sort this out we had to use jruby-rack 1.0.10
Please try to put this line into your Gemfile:
gem 'jruby-rack', '1.0.10'
I got this same error when upgrading an app to Rails 3. The problem was related to invoking ActionController::Base.relative_url_root=, which is supposed to emit a deprecation warning, but it was busted in Rails 3.0.10.
My solution was to upgrade to jruby-rack 1.1.4 and rack 1.2.5.

specs failing in Rails 3.1 - NoMethodError: private method 'rand' called for Array

I'm getting a weird error all of a sudden when I run my spec, which is then causing my specs to fail. These specs worked find before - but recently we upgraded from Rails 3.0 -> Rails 3.1. It seems like machinist is having some problems trying to create the data for my tests, but I don't quite get why 'rand' all of a sudden isn't available.
Anything thoughs/tips would be greatly appreciated.
Here is the line in my blueprint:
Invoice.blueprint do
invno { Faker::Base.bothify(["#######", "N######", "C######"].rand) }
order_no { Faker::Base.numerify("N######") }
Here is some information about my environment -
ruby -v:
ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]
rvm and rvm list (to show my gemset):
rvm 1.8.5 by Wayne E. Seguin (wayneeseguin#gmail.com) [https://rvm.beginrescueend.com/]
=> ruby-1.9.2-p290 [ i386 ]
And here is the error that is happening:
NoMethodError: private method `rand' called for ["#######", "N######", "C######"]:Array
/home/tom/work/ruby/litdistco-sales/spec/blueprints.rb:93:in `block (2 levels) in <top (required)>'
/home/tom/work/ruby/litdistco-sales/foreman/ruby/1.9.1/gems/machinist-1.0.6/lib/machinist.rb:77:in `generate_attribute_value'
/home/tom/work/ruby/litdistco-sales/foreman/ruby/1.9.1/gems/machinist-1.0.6/lib/machinist.rb:46:in `method_missing'
/home/tom/work/ruby/litdistco-sales/spec/blueprints.rb:93:in `block in <top (required)>'
/home/tom/work/ruby/litdistco-sales/foreman/ruby/1.9.1/gems/machinist-1.0.6/lib/machinist.rb:20:in `instance_eval'
/home/tom/work/ruby/litdistco-sales/foreman/ruby/1.9.1/gems/machinist-1.0.6/lib/machinist.rb:20:in `run'
/home/tom/work/ruby/litdistco-sales/foreman/ruby/1.9.1/gems/machinist-1.0.6/lib/machinist/active_record.rb:53:in `make'
/home/tom/work/ruby/litdistco-sales/spec/models/invoice_sales_tax_assignment_mixin_spec.rb:7:in `block (3 levels) in <top (required)>'
/home/tom/work/ruby/litdistco-sales/foreman/ruby/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/hooks.rb:35:in `instance_eval'
/home/tom/work/ruby/litdistco-sales/foreman/ruby/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/hooks.rb:35:in `run_in'
/home/tom/work/ruby/litdistco-sales/foreman/ruby/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/hooks.rb:70:in `block in run_all'
/home/tom/work/ruby/litdistco-sales/foreman/ruby/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/hooks.rb:70:in `each'
/home/tom/work/ruby/litdistco-sales/foreman/ruby/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/hooks.rb:70:in `run_all'
/home/tom/work/ruby/litdistco-sales/foreman/ruby/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/hooks.rb:116:in `run_hook'
/home/tom/work/ruby/litdistco-sales/foreman/ruby/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/example_group.rb:221:in `block in eval_before_eachs'
/home/tom/work/ruby/litdistco-sales/foreman/ruby/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/example_group.rb:221:in `each'
/home/tom/work/ruby/litdistco-sales/foreman/ruby/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/example_group.rb:221:in `eval_before_eachs'
/home/tom/work/ruby/litdistco-sales/foreman/ruby/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/example.rb:145:in `run_before_each'
/home/tom/work/ruby/litdistco-sales/foreman/ruby/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/example.rb:47:in `block in run'
/home/tom/work/ruby/litdistco-sales/foreman/ruby/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/example.rb:107:in `with_around_hooks'
/home/tom/work/ruby/litdistco-sales/foreman/ruby/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/example.rb:45:in `run'
/home/tom/work/ruby/litdistco-sales/foreman/ruby/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/example_group.rb:294:in `block in run_examples'
/home/tom/work/ruby/litdistco-sales/foreman/ruby/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/example_group.rb:290:in `map'
/home/tom/work/ruby/litdistco-sales/foreman/ruby/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/example_group.rb:290:in `run_examples'
/home/tom/work/ruby/litdistco-sales/foreman/ruby/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/example_group.rb:262:in `run'
/home/tom/work/ruby/litdistco-sales/foreman/ruby/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/example_group.rb:263:in `block in run'
/home/tom/work/ruby/litdistco-sales/foreman/ruby/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/example_group.rb:263:in `map'
/home/tom/work/ruby/litdistco-sales/foreman/ruby/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/example_group.rb:263:in `run'
/home/tom/work/ruby/litdistco-sales/foreman/ruby/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/command_line.rb:24:in `block (2 levels) in run'
/home/tom/work/ruby/litdistco-sales/foreman/ruby/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/command_line.rb:24:in `map'
/home/tom/work/ruby/litdistco-sales/foreman/ruby/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/command_line.rb:24:in `block in run'
/home/tom/work/ruby/litdistco-sales/foreman/ruby/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/reporter.rb:12:in `report'
/home/tom/work/ruby/litdistco-sales/foreman/ruby/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/command_line.rb:21:in `run'
/home/tom/work/ruby/litdistco-sales/foreman/ruby/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:80:in `run_in_process'
/home/tom/work/ruby/litdistco-sales/foreman/ruby/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:69:in `run'
/home/tom/work/ruby/litdistco-sales/foreman/ruby/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:11:in `block in autorun'
Use "sample" instead of "rand".
Refer to:
http://www.ruby-forum.com/topic/383479

Resources