Rails狂欢应用程序启动但随后因错误而停止(NameError?)

时间:2013-12-16 22:51:55

标签: ruby-on-rails-4 spree

我使用rbenv(我使用brew安装)和Rails 4.0.2安装了Ruby 2.0.0-p247。和Spree 2.1.3并且所有安装都已成功。

但是当我尝试运行Rails Spree应用程序时,它会因以下错误而停止,可能是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$ 

如何解决此问题?感谢。

更新:我已经完成了'捆绑安装',并在此输出:

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$ 

0 个答案:

没有答案