0

I have installed Ruby 2.0.0-p247 using rbenv (which I installed using brew) and Rails 4.0.2. and Spree 2.1.3 and all of the installations have been successful.

But when I try to run a Rails Spree app, it stops with the following error possibly the NameError :

localhost:my_store haansgruber$ rails s
/Users/haansgruber/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/app_rails_loader.rb:37: warning: Insecure world writable dir /usr/local in PATH, mode 040777
/Users/haansgruber/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler.rb:284: warning: Insecure world writable dir /usr/local in PATH, mode 040777
=> Booting WEBrick
=> Rails 4.0.2 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
Exiting
/Users/haansgruber/work/my_store/spec/factories/payment_method_factory.rb:1:in `<top (required)>': uninitialized constant Factory (NameError)
from /Users/haansgruber/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/factory_girl-4.2.0/lib/factory_girl/find_definitions.rb:20:in `block (2 levels) in find_definitions'
from /Users/haansgruber/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/factory_girl-4.2.0/lib/factory_girl/find_definitions.rb:19:in `each'
from /Users/haansgruber/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/factory_girl-4.2.0/lib/factory_girl/find_definitions.rb:19:in `block in find_definitions'
from /Users/haansgruber/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/factory_girl-4.2.0/lib/factory_girl/find_definitions.rb:15:in `each'
from /Users/haansgruber/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/factory_girl-4.2.0/lib/factory_girl/find_definitions.rb:15:in `find_definitions'
from /Users/haansgruber/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/factory_girl_rails-4.2.1/lib/factory_girl_rails/railtie.rb:33:in `block in <class:Railtie>'
from /Users/haansgruber/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/activesupport-4.0.2/lib/active_support/lazy_load_hooks.rb:36:in `call'
from /Users/haansgruber/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/activesupport-4.0.2/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
from /Users/haansgruber/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/activesupport-4.0.2/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
from /Users/haansgruber/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/activesupport-4.0.2/lib/active_support/lazy_load_hooks.rb:44:in `each'
from /Users/haansgruber/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/activesupport-4.0.2/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
from /Users/haansgruber/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/application/finisher.rb:62:in `block in <module:Finisher>'
from /Users/haansgruber/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/haansgruber/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/initializable.rb:30:in `run'
from /Users/haansgruber/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/haansgruber/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
from /Users/haansgruber/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
from /Users/haansgruber/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
from /Users/haansgruber/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
from /Users/haansgruber/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/tsort.rb:180:in `each'
from /Users/haansgruber/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
from /Users/haansgruber/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
from /Users/haansgruber/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/haansgruber/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/application.rb:215:in `initialize!'
from /Users/haansgruber/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/railtie/configurable.rb:30:in `method_missing'
<truncated>
from /Users/haansgruber/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/commands.rb:71:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
localhost:my_store haansgruber$ 

How to fix this issue? Thanks.

UPDATE: I have already done the 'bundle install' and here its output:

localhost:my_store haansgruber$ bundle install
/Users/haansgruber/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler.rb:284: warning: Insecure world writable dir /usr/local in PATH, mode 040777
Resolving dependencies...
Using rake (10.1.0) 
Using i18n (0.6.9) from git://github.com/svenfuchs/i18n.git (at master) 
Using minitest (4.7.5) 
Using multi_json (1.8.2) 
Using atomic (1.1.14) 
Using thread_safe (0.1.3) 
Using tzinfo (0.3.38) 
Using activesupport (4.0.2) 
Using builder (3.1.4) 
Using erubis (2.7.0) 
Using rack (1.5.2) 
Using rack-test (0.6.2) 
Using actionpack (4.0.2) 
Using mime-types (1.25.1) 
Using polyglot (0.3.3) 
Using treetop (1.4.15) 
Using mail (2.5.4) 
Using actionmailer (4.0.2) 
Using active_utils (2.0.1) 
Using json (1.8.1) 
Using money (6.0.0) 
Using mini_portile (0.5.2) 
Using nokogiri (1.6.1) 
Using activemerchant (1.42.2) 
Using activemodel (4.0.2) 
Using activerecord-deprecated_finders (1.0.3) 
Using arel (4.0.1) 
Using activerecord (4.0.2) 
Using acts_as_list (0.2.0) 
Using addressable (2.3.5) 
Using gyoku (0.4.6) 
Using akami (1.2.0) 
Using awesome_nested_set (3.0.0.rc.2) 
Using uuidtools (2.1.4) 
Using aws-sdk (1.27.0) 
Using braintree (2.27.1) 
Using bundler (1.3.5)     
Using cancan (1.6.10) 
Using thor (0.18.1) 
Using railties (4.0.2) 
Using hike (1.2.3) 
Using tilt (1.4.1) 
Using sprockets (2.10.1) 
Using sprockets-rails (2.0.1) 
Using rails (4.0.2) 
Using canonical-rails (0.0.3) 
Using xpath (2.0.0) 
Using capybara (2.1.0) 
Using ffi (1.9.3) 
Using childprocess (0.3.9) 
Using climate_control (0.0.3) 
Using cliver (0.2.2) 
Using cocaine (0.5.3) 
Using coderay (1.1.0) 
Using coffee-script-source (1.6.3) 
Using execjs (2.0.2) 
Using coffee-script (2.2.0) 
Using coffee-rails (4.0.1) 
Using colorize (0.6.0) 
Using database_cleaner (1.0.1) 
Using deface (1.0.0) 
Using diff-lcs (1.2.5) 
Using factory_girl (4.2.0) 
Using factory_girl_rails (4.2.1) 
Using ffaker (1.22.1) 
Using highline (1.6.20) 
Using multi_xml (0.5.5) 
Using httparty (0.12.0) 
Using httpi (1.1.1) 
Using jquery-rails (3.0.4) 
Using jquery-ui-rails (4.0.5) 
Using kaminari (0.15.0) 
Using launchy (2.4.2) 
Using method_source (0.8.2) 
Using mysql2 (0.3.14) 
Using nori (1.1.5) 
Using paperclip (3.4.2) 
Using paranoia (2.0.1) 
Using pg (0.17.0) 
Using websocket-driver (0.3.1) 
Using poltergeist (1.4.1) 
Using polyamorous (0.6.4) 
Using slop (3.4.7) 
Using pry (0.9.12.4) 
Using rabl (0.8.4) 
Using ransack (1.1.0) 
Using rspec-core (2.14.7) 
Using rspec-expectations (2.14.4) 
Using rspec-mocks (2.14.4) 
Using rspec-rails (2.14.0) 
Using rubyzip (1.1.0) 
Using sass (3.2.12) 
Using sass-rails (4.0.1) 
Using wasabi (2.5.1) 
Using savon (1.2.0) 
Using select2-rails (3.4.9) 
Using websocket (1.0.7) 
Using selenium-webdriver (2.38.0) 
Using state_machine (1.2.0) 
Using stringex (1.5.1) 
Using truncate_html (0.9.2) 
Using spree_core (2.2.0.beta) from git://github.com/spree/spree.git (at master) 
Using versioncake (1.2.0) 
Using spree_api (2.2.0.beta) from git://github.com/spree/spree.git (at master) 
Using spree_backend (2.2.0.beta) from git://github.com/spree/spree.git (at master) 
Using spree_cmd (2.2.0.beta) from git://github.com/spree/spree.git (at master) 
Using spree_frontend (2.2.0.beta) from git://github.com/spree/spree.git (at master) 
Using spree_sample (2.2.0.beta) from git://github.com/spree/spree.git (at master) 
Using spree (2.2.0.beta) from git://github.com/spree/spree.git (at master) 
Using spree_gateway (2.1.0.beta) from source at . 
Using sqlite3 (1.3.8) 
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
localhost:my_store haansgruber$ 
Terry
  • 1,206
  • 1
  • 10
  • 26
  • see http://stackoverflow.com/questions/20361428/rails-i18n-validation-deprecation-warning – Sam Dec 16 '13 at 22:54
  • Did you `bundle install`? Looks like FactoryGirl is having issues.... –  Dec 16 '13 at 22:55
  • what's in payment_method_factory.rb? – benjaminjosephw Dec 16 '13 at 23:20
  • Also try running `FactoryGirl.find_definitions` in the rails console. – benjaminjosephw Dec 16 '13 at 23:21
  • Hello Sam D, on that link it says not to use I18n 0.6.8, and my Rubygem's not using it. I use the I18n version 0.6.9. It can also be seen on the 'install update' output I've added in my post above. – Terry Dec 17 '13 at 10:25
  • Hello user2062950, as can be seen on the updated section on my original post, I've done the 'bundle install' I'm not totally sure if it's completely correct, though. But it seems to be correct. – Terry Dec 17 '13 at 10:27
  • Hello BenjaminJosephW, the payment_method_factory.rb contains: Factory.define(:skrill_quick_checkout, :class => BillingIntegration::Skrill::QuickCheckout) do |record| record.name 'Skrill - Quick Checkout' record.environment 'test' end – Terry Dec 17 '13 at 10:29
  • Hello BenjaminJosephW, by the rails console if you mean to run $rails console, then it ends up with almost exactly the same output of the '$rails s' That is to say I couldn't run and test the FactoryGirl.find_definitions – Terry Dec 17 '13 at 11:20
  • Could you post your /my_store/spec/factories/payment_method_factory.rb in The question please. – Uri Mikhli Dec 18 '13 at 18:26
  • Here it is: `code` Factory.define(:skrill_quick_checkout, :class => BillingIntegration::Skrill::QuickCheckout) do |record| record.name 'Skrill - Quick Checkout' record.environment 'test' end `code` I couldn't display it as "code" properly here. Btw, I added the 'factory' gem and added require 'factory' into this file but it didn't work out. – Terry Dec 18 '13 at 20:23

0 Answers0