Uninitialized constant Less::Engine - ruby-on-rails

I'm trying to get Less up and running on my system and I'm running into an error.
Steps taken so far
gem install less
rails plugin install git://github.com/cloudhead/more.git
# restart everything
# moved styles.css to app/stylesheets/styles.less
rake more:generate
Hopefully, running the last line will create styles.css in public/stylesheets from the .less source. But, I get the error:
Generating css from less files in app/stylesheets.
rake aborted!
uninitialized constant Less::Engine
From /Users/sanj/Documents/sanj/applyco/app/stylesheets/my_formtastic_changes.less
/Users/sanj/.rvm/gems/ruby-1.9.2-p0/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:206:in `const_missing_from_s3_library'
/Users/sanj/Documents/sanj/applyco/vendor/plugins/more/lib/less/more.rb:122:in `block in compile'
/Users/sanj/Documents/sanj/applyco/vendor/plugins/more/lib/less/more.rb:122:in `open'
/Users/sanj/Documents/sanj/applyco/vendor/plugins/more/lib/less/more.rb:122:in `compile'
/Users/sanj/Documents/sanj/applyco/vendor/plugins/more/lib/less/more.rb:62:in `generate'
/Users/sanj/Documents/sanj/applyco/vendor/plugins/more/lib/less/more.rb:77:in `block in generate_all'
/Users/sanj/Documents/sanj/applyco/vendor/plugins/more/lib/less/more.rb:76:in `each'
/Users/sanj/Documents/sanj/applyco/vendor/plugins/more/lib/less/more.rb:76:in `generate_all'
/Users/sanj/Documents/sanj/applyco/vendor/plugins/more/lib/tasks/more_tasks.rake:5:in `block (2 levels) in <top (required)>'
/Users/sanj/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/Users/sanj/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:636:in `block in execute'
/Users/sanj/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/Users/sanj/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/Users/sanj/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:597:in `block in invoke_with_call_chain'
/Users/sanj/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/sanj/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/Users/sanj/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/Users/sanj/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/Users/sanj/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2029:in `block (2 levels) in top_level'
/Users/sanj/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/Users/sanj/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2029:in `block in top_level'
/Users/sanj/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/Users/sanj/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/Users/sanj/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2001:in `block in run'
/Users/sanj/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/Users/sanj/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/Users/sanj/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/bin/rake:31:in `<top (required)>'
/Users/sanj/.rvm/gems/ruby-1.9.2-p0/bin/rake:19:in `load'
/Users/sanj/.rvm/gems/ruby-1.9.2-p0/bin/rake:19:in `<main>'
What's going on?
Setup:
Ruby 1.9.2, Rails 3.0
Mac OS X
Less 2.0.5

Well it looks this line in more is causing the error when it calls engine = File.open(file){|f| Less::Engine.new(f) } and looking at the source code for Less project in the old code they do define the Less::Engine however they have moved the gem over to a new version which has included some changes to the source and does not define Less::Engine.
I would recommend you follow the instructions on the official less website to get up and running. It seems like the more plugin is no longer supported.

Related

env file for rails app not in right place? not being seen by rake

so first time working with rails i work with django
I tried deploying the local server and it failed because of a key error known as s3_bucket_name because I didn't have the ENV file which contained the variables
so then i got the ENV file and placed it in the root of the application.
then I tried to launch the app with no go.
Then I ran the command rake.
Which it complained:
C:\Users\chris\Documents\suitsandtables>rake
rake aborted!
Gem::LoadError: You have already activated rake 12.1.0, but your Gemfile requires rake 12.0.0. Prepending `bundle exec` to your command may solve this.
so then I ran what it suggested with --trace
and I got the same returned. What am I doing wrong?
C:\Users\chris\Documents\suitsandtables>bundle exec rake --trace
** Invoke default (first_time)
** Invoke test (first_time)
** Execute test
rake aborted!
KeyError: key not found: "S3_BUCKET_NAME"
C:/Users/chris/Documents/suitsandtables/config/initializers/s3.rb:4:in `fetch'
C:/Users/chris/Documents/suitsandtables/config/initializers/s3.rb:4:in `<top (required)>'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:286:in `load'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:286:in `block in load'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:258:in `load_dependency'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:286:in `load'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.2/lib/rails/engine.rb:655:in `block in load_config_initializer'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/notifications.rb:168:in `instrument'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.2/lib/rails/engine.rb:654:in `load_config_initializer'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.2/lib/rails/engine.rb:612:in `block (2 levels) in <class:Engine>'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.2/lib/rails/engine.rb:611:in `each'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.2/lib/rails/engine.rb:611:in `block in <class:Engine>'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.2/lib/rails/initializable.rb:30:in `instance_exec'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.2/lib/rails/initializable.rb:30:in `run'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.2/lib/rails/initializable.rb:59:in `block in run_initializers'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:421:in `block in each_strongly_connected_component_from'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.2/lib/rails/initializable.rb:48:in `each'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.2/lib/rails/initializable.rb:48:in `tsort_each_child'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:415:in `call'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:415:in `each_strongly_connected_component_from'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:347:in `each'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:347:in `call'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.2/lib/rails/initializable.rb:58:in `run_initializers'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.2/lib/rails/application.rb:353:in `initialize!'
C:/Users/chris/Documents/suitsandtables/config/environment.rb:5:in `<top (required)>'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `require'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `block in require'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:258:in `load_dependency'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `require'
C:/Users/chris/Documents/suitsandtables/test/test_helper.rb:1:in `<top (required)>'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `require'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `block in require'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:258:in `load_dependency'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `require'
C:/Users/chris/Documents/suitsandtables/test/controllers/menus_controller_test.rb:1:in `<top (required)>'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `require'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `block in require'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:258:in `load_dependency'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `require'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.2/lib/rails/test_unit/test_requirer.rb:14:in `block in require_files'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.2/lib/rails/test_unit/test_requirer.rb:13:in `each'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.2/lib/rails/test_unit/test_requirer.rb:13:in `require_files'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.2/lib/rails/test_unit/minitest_plugin.rb:67:in `rake_run'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.2/lib/rails/test_unit/testing.rake:14:in `block in <top (required)>'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `block in execute'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `each'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `execute'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:194:in `block in invoke_with_call_chain'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:187:in `invoke_with_call_chain'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:216:in `block in invoke_prerequisites'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:214:in `each'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:214:in `invoke_prerequisites'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:193:in `block in invoke_with_call_chain'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:187:in `invoke_with_call_chain'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:180:in `invoke'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:152:in `invoke_task'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `block (2 levels) in top_level'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `each'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `block in top_level'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:117:in `run_with_threads'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:102:in `top_level'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:80:in `block in run'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:178:in `standard_exception_handling'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:77:in `run'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
C:/RailsInstaller/Ruby2.3.3/bin/rake:22:in `load'
C:/RailsInstaller/Ruby2.3.3/bin/rake:22:in `<main>'
Tasks: TOP => default => test
the contents of the env file is as follows with sensitive info removed
S3_BUCKET_NAME=sat-paperclip-prod-heroku
AWS_ACCESS_KEY_ID= removed
AWS_SECRET_ACCESS_KEY= removed
AWS_REGION=us-east-1
GOOGLE_API_KEY= removed
can i get some help please
The error is caused by using Hash#fetch in config/initializers/s3.rb. That's a good thing. Don't change that. Your app requires that ENV value to work correctly, so it breaks if it's not set. (Everything within config/initializers/ runs on startup. This s3.rb file is not part of Rails core and was added by the app's author.)
Make sure your Gemfile has dotenv-rails specified. If it doesn't, add it (see https://github.com/bkeepers/dotenv) and type bundle in the terminal from your Rails root directory. (Note that dotenv-rails is also not part of Rails core.)
The root of your Rails app is the directory containing containing the files Gemfile, Gemfile.lock, etc. and the directories app/, bin/, config/, db/, lib/, etc. (i.e. C:/Users/chris/Documents/suitsandtables/). You can confirm by jumping into the Rails console (rails c or bundle exec rails c in the terminal) and typing Rails.root.
The env file should be named .env (thus the name of gem: dotenv) and should be located in your Rails root directory.
You can test your .env file through rails c by typing:
# in the rails console
ENV # your whole environment in a Hash
ENV["S3_BUCKET_NAME"] # your bucket name
Test all the environment values you're looking for. CaSe MaTtErS.
If you have any Rails servers or tasks running, restart them to pick up these changes.
The expected result of typing bundle exec rake is to run the tests. If you want to run the app itself, use rails s or bundle exec rails s.
p.s. Don't git add/commit your .env. It contains secrets. Make sure it is gitignored.

rake aborted! undefined method `sorcery' || rvm rails db:seed error

rake aborted! undefined method `sorcery' for #<Rails::Application::Configuration:0x93a9554>
really don't know what is wrong here. I installed https://github.com/NoamB/sorcery as per the instructions.
Then I decided it wasn't exactly what I wanted. Done a lot of faffing about but eventually just decided to revert to an earlier pre sorcery commit.
Trouble is now I get the above message every time I try to seed or migrate a db.
I have tried emptying the rvm gemset, uninstalling the sorcery gem, have looked in the seeds.rb and schema.rb as well as the Gemfile and I am definitely using the pre 'sorcery' version of my app.
I even tried dropping the db. rake db:create worked but back to the same error with rake db:seed.
It's my first time using rails so not entirely sure what's going on and 'undefined method' returns so many hits I can't find a clear debug path.
trace
/home/kzu/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/railtie/configuration.rb:85:in method_missing'
/home/kzu/Development/hub-blog/config/initializers/sorcery.rb:5:in'
/home/kzu/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in load'
/home/kzu/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:inblock in load'
/home/kzu/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in load_dependency'
/home/kzu/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:inload'
/home/kzu/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/engine.rb:588:in block (2 levels) in <class:Engine>'
/home/kzu/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/engine.rb:587:ineach'
/home/kzu/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/engine.rb:587:in block in <class:Engine>'
/home/kzu/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/initializable.rb:30:ininstance_exec'
/home/kzu/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/initializable.rb:30:in run'
/home/kzu/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/initializable.rb:55:inblock in run_initializers'
/home/kzu/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/initializable.rb:54:in each'
/home/kzu/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/initializable.rb:54:inrun_initializers'
/home/kzu/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/application.rb:136:in initialize!'
/home/kzu/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:inmethod_missing'
/home/kzu/Development/hub-blog/config/environment.rb:5:in <top (required)>'
/home/kzu/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/application.rb:103:inrequire'
/home/kzu/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/application.rb:103:in require_environment!'
/home/kzu/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.13/lib/rails/application.rb:297:inblock (2 levels) in initialize_tasks'
/home/kzu/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:246:in call'
/home/kzu/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:246:inblock in execute'
/home/kzu/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:241:in each'
/home/kzu/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:241:inexecute'
/home/kzu/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:184:in block in invoke_with_call_chain'
/home/kzu/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:177:ininvoke_with_call_chain'
/home/kzu/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:205:in block in invoke_prerequisites'
/home/kzu/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:203:ineach'
/home/kzu/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:203:in invoke_prerequisites'
/home/kzu/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:183:inblock in invoke_with_call_chain'
/home/kzu/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:177:in invoke_with_call_chain'
/home/kzu/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:170:ininvoke'
/home/kzu/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/railties/databases.rake:346:in block (2 levels) in <top (required)>'
/home/kzu/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:246:incall'
/home/kzu/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:246:in block in execute'
/home/kzu/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:241:ineach'
/home/kzu/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:241:in execute'
/home/kzu/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:184:inblock in invoke_with_call_chain'
/home/kzu/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:177:in invoke_with_call_chain'
/home/kzu/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:170:ininvoke'
/home/kzu/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:143:in invoke_task'
/home/kzu/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:101:inblock (2 levels) in top_level'
/home/kzu/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:101:in each'
/home/kzu/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:101:inblock in top_level'
/home/kzu/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:110:in run_with_threads'
/home/kzu/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:95:intop_level'
/home/kzu/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:73:in block in run'
/home/kzu/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:160:instandard_exception_handling'
/home/kzu/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:70:in run'
/home/kzu/.rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:ineval'
/home/kzu/.rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `'
Tasks: TOP => db:abort_if_pending_migrations => environment
It seems that you still have a sorcery.rb file in your app folder, in config/initializer can you please check that ?

"rake aborted! undefined method `[]=' for nil:NilClass" message when running rake in cron job

I am a ROR noob who has inherited a project (Ruby version 1.9.3p0, Rails version 3.0.6, rake version 0.9.2) which performs a rake as part of a cronjob. This has been outputting "rake aborted! undefined method `[]=' for nil:NilClass" into its log file. When I perform a trace I get the following output:
rake aborted!
undefined method `[]=' for nil:NilClass
/var/www/nostos-source-illiad/lib/nostos-source-illiad/record.rb:48:in `block in charge!'
(eval):22:in `form_with'
/var/www/nostos-source-illiad/lib/nostos-source-illiad/record.rb:47:in `charge!'
/var/www/nostos/app/models/transaction.rb:65:in `block (2 levels) in sync!'
/var/www/nostos/app/models/transaction.rb:58:in `each'
/var/www/nostos/app/models/transaction.rb:58:in `block in sync!'
/var/www/nostos/app/models/transaction.rb:57:in `each'
/var/www/nostos/app/models/transaction.rb:57:in `sync!'
/var/www/nostos/lib/tasks/nostos.rake:17:in `block (2 levels) in <top (required)>'
/home/deployer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/home/deployer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:205:in `block in execute'
/home/deployer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/home/deployer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/home/deployer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/home/deployer/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/home/deployer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/home/deployer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/home/deployer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/home/deployer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:90:in `block (2 levels) in top_level'
/home/deployer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/home/deployer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:90:in `block in top_level'
/home/deployer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/home/deployer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/home/deployer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:62:in `block in run'
/home/deployer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/home/deployer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/home/deployer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rake-0.9.2/bin/rake:32:in `<top (required)>'
/home/deployer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/bin/rake:19:in `load'
/home/deployer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/bin/rake:19:in `<main>'
Tasks: TOP => nostos:cron
I am having trouble determining what exactly is causing this issue and was looking for some advice/direction. I do not think this is caused by the same issue reported here but I am not definite. Any help would be appreciated. Thanks!
EDIT:
Code for nostos:rakecan be found here.
Code for transaction.rb can be found here.
Upon further review, this issue appears to have been due to an invalid set of credentials being passed in. Resolving this removed the above messages. Thanks for looking into this!

uninitialized constant Spree::User::DestroyWithOrdersError

I am a new to working with Spree and basically did the following:
git cloned the git hub repo and created a new project. I then looked in the core folder and took all the files I needed. The reason why I did this is purely because I wish to customise Spree and make some changes. I did a bundle install and tried doing a bundle exec rake db:reset and ran into an error that I have been trying to solve. I have looked in the following file
--> /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/spree_auth 1.1.0/app/controllers/spree/admin/admin_users_controller_decorator.rb which looks like the following: Pastie. I also found the following github issue github issue that Ryan Biggs commented on. I tried this but had no luck.
What is it that I have done wrong here.
uninitialized constant Spree::User::DestroyWithOrdersError
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/spree_auth-1.1.0/app/controllers/spree/admin/admin_users_controller_decorator.rb:3:in
block in <top (required)>'
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/spree_auth-1.1.0/app/controllers/spree/admin/admin_users_controller_decorator.rb:2:in
class_eval'
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/spree_auth-1.1.0/app/controllers/spree/admin/admin_users_controller_decorator.rb:2:in
<top (required)>'
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/spree_auth-1.1.0/lib/spree/auth/engine.rb:13:in
block in activate'
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/spree_auth-1.1.0/lib/spree/auth/engine.rb:12:in
glob'
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/spree_auth-1.1.0/lib/spree/auth/engine.rb:12:in
activate'
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:451:in
_run__1016855746__prepare__693579178__callbacks'
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:405:in
__run_callback'
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:385:in
_run_prepare_callbacks'
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:81:in
run_callbacks'
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.2.3/lib/action_dispatch/middleware/reloader.rb:74:in
prepare!'
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.2.3/lib/action_dispatch/middleware/reloader.rb:48:in
prepare!'
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/application/finisher.rb:47:in block in <module:Finisher>'
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/initializable.rb:30:in
instance_exec'
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/initializable.rb:30:in
run'
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/initializable.rb:55:in
block in run_initializers'
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/initializable.rb:54:in
each'
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/initializable.rb:54:in
run_initializers'
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/application.rb:136:in
initialize!'
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/railtie/configurable.rb:30:inmethod_missing' /home/dj/Desktop/my_store/config/environment.rb:5:in
<top (required)>'
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/application.rb:103:in
require_environment!'
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/application.rb:292:in
block (2 levels) in initialize_tasks'
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:205:in
call'
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:205:in
block in execute'
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:200:in
each'
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:200:in
execute'
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:158:in
block in invoke_with_call_chain'
/home/dj/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in
mon_synchronize'
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:151:in
invoke_with_call_chain'
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:176:in
block in invoke_prerequisites'
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:174:in
each'
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:174:in
invoke_prerequisites'
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:157:in
block in invoke_with_call_chain'
/home/dj/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in
mon_synchronize'
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:151:in
invoke_with_call_chain'
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:144:in
invoke'
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:116:in
invoke_task'
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:94:in
block (2 levels) in top_level'
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:94:in
each'
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:94:in
block in top_level'
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:133:in
standard_exception_handling'
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:88:in
top_level'
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:66:in
block in run'
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:133:in
standard_exception_handling'
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:63:in
run'
/home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/bin/rake:33:in
<top (required)>' /home/dj/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in
load' /home/dj/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `'
Tasks: TOP => db:reset => environment
Djj,
The recommended method for installing Spree is:
$ gem install rails -v 3.2.3
$ gem install spree
$ rails new my_store
$ spree install my_store
You don't want to copy files directly into your app. http://guides.spreecommerce.com/customization.html has some good resources on customizing your site.
http://speakerdeck.com/u/jsqu99/p/spreeconf-2012-introducing-spree-10 has a good explanation of how a Spree app should be structured.

YAML DB won't run due to evaluating nil.each

So this problem is occurring for me on both RHEL5 and OSX Lion. Both environments are running 1.9.2-p290 ruby installed with RVM.
When I run the following command I get the following problem:
[master][~/Sites/boss-mocha] bundle exec rake db:data:load --trace
** Invoke db:data:load (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:data:load
rake aborted!
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.each
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/yaml_db-0.2.1/lib/serialization_helper.rb:85:in `load_records'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/yaml_db-0.2.1/lib/serialization_helper.rb:74:in `load_table'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/yaml_db-0.2.1/lib/yaml_db.rb:63:in `block (2 levels) in load_documents'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/yaml_db-0.2.1/lib/yaml_db.rb:61:in `each'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/yaml_db-0.2.1/lib/yaml_db.rb:61:in `block in load_documents'
/Users/pma/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych/deprecated.rb:30:in `each'
/Users/pma/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych/deprecated.rb:30:in `load_documents'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/yaml_db-0.2.1/lib/yaml_db.rb:60:in `load_documents'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/yaml_db-0.2.1/lib/serialization_helper.rb:57:in `block in load'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.10/lib/active_record/connection_adapters/abstract/database_statements.rb:139:in `transaction'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/yaml_db-0.2.1/lib/serialization_helper.rb:56:in `load'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/yaml_db-0.2.1/lib/serialization_helper.rb:31:in `load'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/yaml_db-0.2.1/lib/tasks/yaml_db_tasks.rake:35:in `block (3 levels) in <top (required)>'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/task.rb:205:in `block in execute'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/pma/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:90:in `block (2 levels) in top_level'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:90:in `block in top_level'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:62:in `block in run'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/bin/rake:32:in `<top (required)>'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `load'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `<main>'
Tasks: TOP => db:data:load
The YAML being produced by rake db:data:dump appears mal-formed, with spurious "---"s between the "records" list and the actual records.
Removing the inappropriate "---" allows the data to load. I haven't created a pull request for the fix yet, but after tracking it down I noticed someone else reported it as an issue on github:
https://github.com/ludicast/yaml_db/issues/17
In addition, changing the YAML engine as in the link below produces correct output, eliminating the need for editing the file manually (or fixing yaml_db).
rails error, couldn't parse YAML

Resources