ruby on rails integration with postgres db - ruby-on-rails

I am new to ruby on rails and I am trying to develop some demo application. I am trying to use postgres as database server. I am trying to setup database from rails using rake db:setup command. I am getting following exception. I researched using google but I could not figure out the problem with my little knowledge. Could you please help me out with fixing this issue.
Ruby version 2.2.2 and rails version 4.2.1
Following is the exception:
$ bin/rake db:setup
/home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:303:in `block in visit_Psych_Nodes_Alias': Cannot load `Rails.application.database_configuration`:
Unknown alias: default (Psych::BadAlias)
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:303:in `fetch'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:303:in `visit_Psych_Nodes_Alias'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/visitor.rb:15:in `visit'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/visitor.rb:5:in `accept'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:31:in `accept'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:321:in `block in revive_hash'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:319:in `each'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:319:in `each_slice'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:319:in `revive_hash'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:161:in `visit_Psych_Nodes_Mapping'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/visitor.rb:15:in `visit'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/visitor.rb:5:in `accept'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:31:in `accept'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:321:in `block in revive_hash'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:319:in `each'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:319:in `each_slice'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:319:in `revive_hash'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:161:in `visit_Psych_Nodes_Mapping'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/visitor.rb:15:in `visit'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/visitor.rb:5:in `accept'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:31:in `accept'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:295:in `visit_Psych_Nodes_Document'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/visitor.rb:15:in `visit'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/visitor.rb:5:in `accept'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:31:in `accept'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/nodes/node.rb:37:in `to_ruby'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych.rb:246:in `load'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/application/configuration.rb:104:in `database_configuration'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activerecord-4.2.1/lib/active_record/railtie.rb:117:in `block (2 levels) in <class:Railtie>'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/lazy_load_hooks.rb:44:in `each'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activerecord-4.2.1/lib/active_record/base.rb:316:in `<module:ActiveRecord>'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activerecord-4.2.1/lib/active_record/base.rb:26:in `<top (required)>'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/lib/spring/application.rb:319:in `active_record_configured?'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/lib/spring/application.rb:251:in `disconnect_database'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/lib/spring/application.rb:97:in `preload'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/lib/spring/application.rb:143:in `serve'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/lib/spring/application.rb:131:in `block in run'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/lib/spring/application.rb:125:in `loop'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/lib/spring/application.rb:125:in `run'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/lib/spring/application/boot.rb:18:in `<top (required)>'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from -e:1:in `<main>'

Related

Exclude from array doesn't work as expected

I'm trying to use ransack gem with acts_as_taggable. I have a simple Job model that configured acts_as_taggable in a default way and has tag_list property.
When I run:
Job.ransack("tags_name_in"=>["eum", "sint"]).result.to_sql
It generates SQL as expected (which is good):
"SELECT \"jobs\".* FROM \"jobs\" LEFT OUTER JOIN \"taggings\" ON \"taggings\".\"taggable_id\" = \"jobs\".\"id\" AND \"taggings\".\"context\" = 'tags' AND \"taggings\".\"taggable_type\" = 'Job' LEFT OUTER JOIN \"tags\" ON \"tags\".\"id\" = \"taggings\".\"tag_id\" WHERE \"tags\".\"name\" IN ('eum', 'sint')"
But when I'm trying to exclude by using:
Job.ransack("tags_name_not_in"=>["eum", "sint"]).result.to_sql
It throws exaptation:
NoMethodError: undefined method `left' for #<ActiveRecord::Relation::QueryAttribute:0x007f851ea6bcd8>
from /Users/sashar/.rvm/gems/ruby-2.2.5/gems/ransack-1.8.2/lib/ransack/adapters/active_record/context.rb:190:in `block in build_correlated_subquery'
from /Users/sashar/.rvm/gems/ruby-2.2.5/gems/ransack-1.8.2/lib/ransack/adapters/active_record/context.rb:189:in `each'
from /Users/sashar/.rvm/gems/ruby-2.2.5/gems/ransack-1.8.2/lib/ransack/adapters/active_record/context.rb:189:in `build_correlated_subquery'
from /Users/sashar/.rvm/gems/ruby-2.2.5/gems/ransack-1.8.2/lib/ransack/adapters/active_record/ransack/nodes/condition.rb:9:in `block in arel_predicate'
from /Users/sashar/.rvm/gems/ruby-2.2.5/gems/ransack-1.8.2/lib/ransack/adapters/active_record/ransack/nodes/condition.rb:6:in `map'
from /Users/sashar/.rvm/gems/ruby-2.2.5/gems/ransack-1.8.2/lib/ransack/adapters/active_record/ransack/nodes/condition.rb:6:in `arel_predicate'
from /Users/sashar/.rvm/gems/ruby-2.2.5/gems/ransack-1.8.2/lib/ransack/visitor.rb:17:in `visit_Ransack_Nodes_Condition'
from /Users/sashar/.rvm/gems/ruby-2.2.5/gems/ransack-1.8.2/lib/ransack/visitor.rb:52:in `visit'
from /Users/sashar/.rvm/gems/ruby-2.2.5/gems/ransack-1.8.2/lib/ransack/visitor.rb:5:in `accept'
from /Users/sashar/.rvm/gems/ruby-2.2.5/gems/ransack-1.8.2/lib/ransack/adapters/active_record/ransack/visitor.rb:4:in `block in visit_and'
from /Users/sashar/.rvm/gems/ruby-2.2.5/gems/ransack-1.8.2/lib/ransack/adapters/active_record/ransack/visitor.rb:4:in `map'
from /Users/sashar/.rvm/gems/ruby-2.2.5/gems/ransack-1.8.2/lib/ransack/adapters/active_record/ransack/visitor.rb:4:in `visit_and'
from /Users/sashar/.rvm/gems/ruby-2.2.5/gems/ransack-1.8.2/lib/ransack/visitor.rb:24:in `visit_Ransack_Nodes_Grouping'
from /Users/sashar/.rvm/gems/ruby-2.2.5/gems/ransack-1.8.2/lib/ransack/visitor.rb:52:in `visit'
from /Users/sashar/.rvm/gems/ruby-2.2.5/gems/ransack-1.8.2/lib/ransack/visitor.rb:5:in `accept'
from /Users/sashar/.rvm/gems/ruby-2.2.5/gems/ransack-1.8.2/lib/ransack/adapters/active_record/context.rb:37:in `evaluate'
... 12 levels...
from /Users/sashar/.rvm/gems/ruby-2.2.5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:287:in `load'
from /Users/sashar/.rvm/gems/ruby-2.2.5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:287:in `block in load'
from /Users/sashar/.rvm/gems/ruby-2.2.5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:259:in `load_dependency'
from /Users/sashar/.rvm/gems/ruby-2.2.5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:287:in `load'
from /Users/sashar/.rvm/gems/ruby-2.2.5/gems/spring-2.0.1/lib/spring/commands/rails.rb:6:in `call'
from /Users/sashar/.rvm/gems/ruby-2.2.5/gems/spring-2.0.1/lib/spring/command_wrapper.rb:38:in `call'
from /Users/sashar/.rvm/gems/ruby-2.2.5/gems/spring-2.0.1/lib/spring/application.rb:191:in `block in serve'
from /Users/sashar/.rvm/gems/ruby-2.2.5/gems/spring-2.0.1/lib/spring/application.rb:161:in `fork'
from /Users/sashar/.rvm/gems/ruby-2.2.5/gems/spring-2.0.1/lib/spring/application.rb:161:in `serve'
from /Users/sashar/.rvm/gems/ruby-2.2.5/gems/spring-2.0.1/lib/spring/application.rb:131:in `block in run'
from /Users/sashar/.rvm/gems/ruby-2.2.5/gems/spring-2.0.1/lib/spring/application.rb:125:in `loop'
from /Users/sashar/.rvm/gems/ruby-2.2.5/gems/spring-2.0.1/lib/spring/application.rb:125:in `run'
from /Users/sashar/.rvm/gems/ruby-2.2.5/gems/spring-2.0.1/lib/spring/application/boot.rb:19:in `<top (required)>'
from /Users/sashar/.rvm/rubies/ruby-2.2.5/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/sashar/.rvm/rubies/ruby-2.2.5/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from -e:1:in `<main>'
Any ideas?

rails 5 - could could not generate rspec:install

I am trying to build restful api using rails
I am following the blog link tutorial to work out
https://scotch.io/tutorials/build-a-restful-json-api-with-rails-5-part-one
but when i run this following command
rails generate rspec:install
It generates the following error
identical .rspec
exist spec
create spec/C:/Users/Shad Munir/AppData/Local/Temp/d20170503-6768-l4n0e9/spec/spec_helper.rb
C:/Ruby23-x64/lib/ruby/2.3.0/fileutils.rb:253:in `mkdir': Invalid argument # dir_s_mkdir - E:/todos-api/spec/C: (Errno::EINVAL)
from C:/Ruby23-x64/lib/ruby/2.3.0/fileutils.rb:253:in `fu_mkdir'
from C:/Ruby23-x64/lib/ruby/2.3.0/fileutils.rb:227:in `block (2 levels) in mkdir_p'
from C:/Ruby23-x64/lib/ruby/2.3.0/fileutils.rb:225:in `reverse_each'
from C:/Ruby23-x64/lib/ruby/2.3.0/fileutils.rb:225:in `block in mkdir_p'
from C:/Ruby23-x64/lib/ruby/2.3.0/fileutils.rb:211:in `each'
from C:/Ruby23-x64/lib/ruby/2.3.0/fileutils.rb:211:in `mkdir_p'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/actions/create_file.rb:61:in `block in invoke!'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/actions/empty_directory.rb:116:in `invoke_with_conflict_check'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/actions/create_file.rb:60:in `invoke!'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/actions.rb:95:in `action'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/actions/create_file.rb:25:in `create_file'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/actions/file_manipulation.rb:27:in `copy_file'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/actions/directory.rb:94:in `block in execute!'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/actions/directory.rb:80:in `each'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/actions/directory.rb:80:in `execute!'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/actions/directory.rb:66:in `invoke!'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/actions.rb:95:in `action'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/actions/directory.rb:52:in `directory'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rspec-rails-3.5.2/lib/generators/rspec/install/install_generator.rb:23:in `block in copy_spec_files'
from C:/Ruby23-x64/lib/ruby/2.3.0/tmpdir.rb:89:in `mktmpdir'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rspec-rails-3.5.2/lib/generators/rspec/install/install_generator.rb:20:in `copy_spec_files'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/command.rb:27:in `run'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/invocation.rb:126:in `invoke_command'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/invocation.rb:133:in `block in invoke_all'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/invocation.rb:133:in `each'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/invocation.rb:133:in `map'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/invocation.rb:133:in `invoke_all'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/group.rb:232:in `dispatch'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/base.rb:444:in `start'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/generators.rb:180:in `invoke'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/generate.rb:13:in `<top (required)>'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:293:in `require'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:293:in `block in require'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:259:in `load_dependency'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:293:in `require'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:138:in `require_command!'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:145:in `generate_or_destroy'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:60:in `generate'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands.rb:18:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
I tried some related solution from stack overflow but none of them is working .
I had this same problem a couple of days ago. What I had to do was delete all versions of RSpec from my machine and then run bundle install. This installed the latest version of RSpec and everything was good afterwards.

ArgumentError with Cucumber and Machinist

I am using Cucumber Factory and to make it easy to use Machinist with Cucumber and I am running into an ArgumentError. The line in my feature file that is causing the problem is:
Given there is a tag
In the blueprint file I define Tag as this (not the best, will be improved once I get past the ArgumentError):
Tag.blueprint do
name { "tag" }
slug { "slug" }
uuid { "uuid" }
end
Here's the backtrace:
cucumber_factory-1.8.4/lib/cucumber/factory.rb:24
wrong number of arguments (2 for 1) (ArgumentError)
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/attribute_assignment.rb:33:in `attributes='
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/cucumber_factory-1.8.4/lib/cucumber/factory.rb:124:in `create_record'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/cucumber_factory-1.8.4/lib/cucumber/factory.rb:79:in `parse_creation'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/cucumber_factory-1.8.4/lib/cucumber/factory.rb:24:in `block in <class:Factory>'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.5/lib/cucumber/core_ext/instance_exec.rb:48:in `instance_exec'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.5/lib/cucumber/core_ext/instance_exec.rb:48:in `block in cucumber_instance_exec'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.5/lib/cucumber/core_ext/instance_exec.rb:69:in `cucumber_run_with_backtrace_filtering'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.5/lib/cucumber/core_ext/instance_exec.rb:36:in `cucumber_instance_exec'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.5/lib/cucumber/rb_support/rb_step_definition.rb:97:in `invoke'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.5/lib/cucumber/step_match.rb:25:in `invoke'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.5/lib/cucumber/ast/step_invocation.rb:60:in `invoke'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.5/lib/cucumber/ast/step_invocation.rb:38:in `accept'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.5/lib/cucumber/ast/tree_walker.rb:99:in `block in visit_step'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.5/lib/cucumber/ast/tree_walker.rb:163:in `broadcast'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.5/lib/cucumber/ast/tree_walker.rb:98:in `visit_step'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.5/lib/cucumber/ast/step_collection.rb:15:in `block in accept'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.5/lib/cucumber/ast/step_collection.rb:14:in `each'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.5/lib/cucumber/ast/step_collection.rb:14:in `accept'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.5/lib/cucumber/ast/tree_walker.rb:93:in `block in visit_steps'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.5/lib/cucumber/ast/tree_walker.rb:163:in `broadcast'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.5/lib/cucumber/ast/tree_walker.rb:92:in `visit_steps'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.5/lib/cucumber/ast/background.rb:41:in `block in accept'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.5/lib/cucumber/ast/background.rb:52:in `block in with_visitor'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.5/lib/cucumber/ast/scenario.rb:105:in `with_visitor'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.5/lib/cucumber/ast/background.rb:51:in `with_visitor'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.5/lib/cucumber/ast/background.rb:38:in `accept'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.5/lib/cucumber/ast/tree_walker.rb:57:in `block in visit_background'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.5/lib/cucumber/ast/tree_walker.rb:163:in `broadcast'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.5/lib/cucumber/ast/tree_walker.rb:56:in `visit_background'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.5/lib/cucumber/ast/feature.rb:41:in `accept'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.5/lib/cucumber/ast/tree_walker.rb:20:in `block in visit_feature'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.5/lib/cucumber/ast/tree_walker.rb:163:in `broadcast'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.5/lib/cucumber/ast/tree_walker.rb:19:in `visit_feature'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.5/lib/cucumber/ast/features.rb:29:in `block in accept'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.5/lib/cucumber/ast/features.rb:17:in `each'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.5/lib/cucumber/ast/features.rb:17:in `each'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.5/lib/cucumber/ast/features.rb:28:in `accept'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.5/lib/cucumber/ast/tree_walker.rb:14:in `block in visit_features'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.5/lib/cucumber/ast/tree_walker.rb:163:in `broadcast'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.5/lib/cucumber/ast/tree_walker.rb:13:in `visit_features'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.5/lib/cucumber/runtime.rb:47:in `run!'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.5/lib/cucumber/cli/main.rb:43:in `execute!'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.5/lib/cucumber/cli/main.rb:20:in `execute'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.5/bin/cucumber:14:in `<top (required)>'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/bin/cucumber:23:in `load'
/Users/andreas/.rvm/gems/ruby-1.9.3-p194/bin/cucumber:23:in `<main>'
features/api/v1/source/get_source.feature:7:in `And there is a tag'
I am using Ruby 1.9.3, Rails 3.2.6, Cucumber 1.2.5, Cucumber Rails 1.3.1, Cucumber Factory 1.8.4 and Machinist 2.0. The blueprint seems fine since Tag.make works in the rails console.
I would be very grateful for any ideas on how to get past the ArgumentErrors!

Error on Rails Admin install. Possibly Devise related?

Sorry to copy in this entire log, but I'm hoping it might make more sense to someone familiar with this issue. When devise began setting up the user model I wasn't given the option (I never pressed enter) and the install proceeded and crashed, outputting the following. Thanks!
? What would you like the user model to be called? Press <enter> for [user] > - Now setting up devise with user model name 'user':
generate devise
invoke active_record
create db/migrate/20120825075751_add_devise_to_users.rb
insert app/models/user.rb
route devise_for :users
- Now you'll need an initializer...
create config/initializers/rails_admin.rb
/home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/activerecord-3.2.8/lib/active_record/reflection.rb:385:in `block in source_reflection': undefined method `klass' for nil:NilClass (NoMethodError)
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/activerecord-3.2.8/lib/active_record/reflection.rb:385:in `collect'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/activerecord-3.2.8/lib/active_record/reflection.rb:385:in `source_reflection'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/activerecord-3.2.8/lib/active_record/reflection.rb:375:in `rescue in foreign_key'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/activerecord-3.2.8/lib/active_record/reflection.rb:373:in `foreign_key'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/rails_admin-0.0.5/lib/rails_admin/adapters/active_record.rb:259:in `association_foreign_key_lookup'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/rails_admin-0.0.5/lib/rails_admin/adapters/active_record.rb:71:in `block in associations'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/rails_admin-0.0.5/lib/rails_admin/adapters/active_record.rb:64:in `map'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/rails_admin-0.0.5/lib/rails_admin/adapters/active_record.rb:64:in `associations'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/rails_admin-0.0.5/lib/rails_admin/abstract_model.rb:29:in `block (2 levels) in polymorphic_parents'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/rails_admin-0.0.5/lib/rails_admin/abstract_model.rb:28:in `each'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/rails_admin-0.0.5/lib/rails_admin/abstract_model.rb:28:in `block in polymorphic_parents'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/rails_admin-0.0.5/lib/rails_admin/abstract_model.rb:27:in `tap'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/rails_admin-0.0.5/lib/rails_admin/abstract_model.rb:27:in `polymorphic_parents'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/rails_admin-0.0.5/lib/rails_admin/adapters/active_record.rb:222:in `association_model_lookup'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/rails_admin-0.0.5/lib/rails_admin/adapters/active_record.rb:69:in `block (2 levels) in associations'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/rails_admin-0.0.5/lib/rails_admin/config/fields/types/polymorphic_association.rb:49:in `call'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/rails_admin-0.0.5/lib/rails_admin/config/fields/types/polymorphic_association.rb:49:in `associated_model_config'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/rails_admin-0.0.5/lib/rails_admin/config/fields/types/polymorphic_association.rb:19:in `block in <class:PolymorphicAssociation>'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/rails_admin-0.0.5/lib/rails_admin/config/configurable.rb:68:in `instance_eval'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/rails_admin-0.0.5/lib/rails_admin/config/configurable.rb:68:in `block in register_instance_option'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/rails_admin-0.0.5/lib/rails_admin/config/configurable.rb:42:in `block in register_instance_option'
from (erb):86:in `block (2 levels) in template'
from (erb):85:in `map'
from (erb):85:in `block in template'
from (erb):82:in `map'
from (erb):82:in `template'
from /home/funkdified/.rvm/rubies/ruby-1.9.3-p125-HEAD/lib/ruby/1.9.1/erb.rb:838:in `eval'
from /home/funkdified/.rvm/rubies/ruby-1.9.3-p125-HEAD/lib/ruby/1.9.1/erb.rb:838:in `result'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/thor-0.16.0/lib/thor/actions/file_manipulation.rb:111:in `block in template'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/thor-0.16.0/lib/thor/actions/create_file.rb:54:in `call'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/thor-0.16.0/lib/thor/actions/create_file.rb:54:in `render'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/thor-0.16.0/lib/thor/actions/create_file.rb:63:in `block (2 levels) in invoke!'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/thor-0.16.0/lib/thor/actions/create_file.rb:63:in `open'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/thor-0.16.0/lib/thor/actions/create_file.rb:63:in `block in invoke!'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/thor-0.16.0/lib/thor/actions/empty_directory.rb:133:in `call'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/thor-0.16.0/lib/thor/actions/empty_directory.rb:133:in `invoke_with_conflict_check'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/thor-0.16.0/lib/thor/actions/create_file.rb:61:in `invoke!'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/thor-0.16.0/lib/thor/actions.rb:95:in `action'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/thor-0.16.0/lib/thor/actions/create_file.rb:26:in `create_file'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/thor-0.16.0/lib/thor/actions/file_manipulation.rb:110:in `template'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/rails_admin-0.0.5/lib/generators/rails_admin/install_generator.rb:59:in `install'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/thor-0.16.0/lib/thor/task.rb:27:in `run'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/thor-0.16.0/lib/thor/invocation.rb:120:in `invoke_task'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `block in invoke_all'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `each'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `map'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `invoke_all'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/thor-0.16.0/lib/thor/group.rb:238:in `dispatch'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/thor-0.16.0/lib/thor/base.rb:425:in `start'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/railties-3.2.8/lib/rails/generators.rb:171:in `invoke'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/railties-3.2.8/lib/rails/commands/generate.rb:12:in `<top (required)>'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `block in require'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in `load_dependency'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/railties-3.2.8/lib/rails/commands.rb:29:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I figured it out. I installed devise first to debug and found it was an issue with my existing User model. I needed to drop the User table and start over.

Broken rails environment: can't run rails generate scaffold

I have a mystery: My rvm/ruby-1.9.2 environment, running rails 3.1.3, can no longer run this command
rails generate scaffold Game name:string difficulty:string
I get the following dump after a 'method missing' failure
kenb#stargate:~/development/sudoku$ rails g scaffold Game name:string difficulty:string
invoke active_record
/home/kenb/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.3/lib/active_record/base.rb:1088:in `method_missing': undefined method `mass_assignment_sanitizer=' for ActiveRecord::Base:Class (NoMethodError)
from /home/kenb/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.3/lib/active_record/railtie.rb:59:in `block (3 levels) in <class:Railtie>'
from /home/kenb/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.3/lib/active_record/railtie.rb:58:in `each'
from /home/kenb/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.3/lib/active_record/railtie.rb:58:in `block (2 levels) in <class:Railtie>'
from /home/kenb/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
from /home/kenb/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
from /home/kenb/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/lazy_load_hooks.rb:43:in `block in run_load_hooks'
from /home/kenb/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/lazy_load_hooks.rb:42:in `each'
from /home/kenb/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
from /home/kenb/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.3/lib/active_record/base.rb:2190:in `<top (required)>'
from /home/kenb/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/generators/named_base.rb:165:in `pluralize_table_names?'
from /home/kenb/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/generators/named_base.rb:112:in `table_name'
from /home/kenb/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.3/lib/rails/generators/active_record/model/model_generator.rb:17:in `create_migration_file'
from /home/kenb/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
from /home/kenb/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
from /home/kenb/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `block in invoke_all'
from /home/kenb/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `each'
from /home/kenb/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `map'
from /home/kenb/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `invoke_all'
from /home/kenb/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/group.rb:226:in `dispatch'
from /home/kenb/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/invocation.rb:109:in `invoke'
from /home/kenb/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/group.rb:269:in `block in _invoke_for_class_method'
from /home/kenb/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/shell.rb:74:in `with_padding'
from /home/kenb/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/group.rb:258:in `_invoke_for_class_method'
from /home/kenb/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/group.rb:150:in `_invoke_from_option_orm'
from /home/kenb/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
from /home/kenb/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
from /home/kenb/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `block in invoke_all'
from /home/kenb/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `each'
from /home/kenb/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `map'
from /home/kenb/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `invoke_all'
from /home/kenb/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/group.rb:226:in `dispatch'
from /home/kenb/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/base.rb:389:in `start'
from /home/kenb/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/generators.rb:168:in `invoke'
from /home/kenb/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/commands/generate.rb:12:in `<top (required)>'
from /home/kenb/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require'
from /home/kenb/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `block in require'
from /home/kenb/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in `block in load_dependency'
from /home/kenb/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:640:in `new_constants_in'
from /home/kenb/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in `load_dependency'
from /home/kenb/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require'
from /home/kenb/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/commands.rb:28:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I have gone so far as to remove rvm and all dependent gems, re-install rvm, ruby-1.9.2, and then run 'bundle install' in my app folder. All goes well. Then, I get a failure on the generate command.
According to http://apidock.com/rails/ActiveModel/MassAssignmentSecurity/ClassMethods/mass_assignment_sanitizer%3D mass_assignment_sanitizer was introduced in rails 3.2, while you are using 3.1.3. Haven't you generated you project with rails 3.2?

Resources