2017-09-13 100 views
0

通過Git拉動朋友的RoR項目時遇到問題。git pull後無法運行Ruby on Rails應用程序

的混帳功能正常,但一旦我開始運行的服務器(一個bundle installrake db:migrate後)我在純HTML以下彪馬錯誤白底黑字:

Puma caught this error: undefined method 'helper_method' for ActionController::API:Class (NoMethodError)

(請參見下面的完整錯誤)

然後,在刷新後,一切似乎都恢復正常(在我的球隊的3其他Mac測試),但我的Mac,我得到以下錯誤的:

NoMethodError in HomeController#connexion 
undefined method 'user_signed_in?' for #<HomeController:0x007f801dca0658> Did you mean? user_session_url 

Extracted source (around line #4):    

    def connexion 
    if user_signed_in? 
     redirect_to show_path 
    end 
    end 

Rails.root: /Users/Will/Now_Fellows/website` 

(參見下面的完整跟蹤)

我不知道是什麼原因造成這種行爲,它在那裏可能來自...可設計爲user_signed_in是有一項幫手。我嘗試從網上找到的東西(卸載設計重新安裝它,恢復到以前的提交,搜索clear_helpers ...),但我仍然獲得相同的現象,我都沒有想法/解決方案/搜索的地方。 ..

你能幫我嗎?

如果您需要其他信息,請讓我知道。

的Gemfile

source 'https://rubygems.org' 

git_source(:github) do |repo_name| 
    repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/") 
"https://github.com/#{repo_name}.git" 
end 


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 
gem 'rails', '~> 5.1.3' 
# Use sqlite3 as the database for Active Record 
gem 'sqlite3' 
# Use Puma as the app server 
gem 'puma', '~> 3.7' 
# Use SCSS for stylesheets 
gem 'sass-rails', '~> 5.0' 
# Use Uglifier as compressor for JavaScript assets 
gem 'uglifier', '>= 1.3.0' 
# See https://github.com/rails/execjs#readme for more supported runtimes 
# gem 'therubyracer', platforms: :ruby 

# Use CoffeeScript for .coffee assets and views 
gem 'coffee-rails', '~> 4.2' 
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks 
gem 'turbolinks', '~> 5' 
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 
gem 'jbuilder', '~> 2.5' 
# Use Redis adapter to run Action Cable in production 
# gem 'redis', '~> 3.0' 
# Use ActiveModel has_secure_password 
# gem 'bcrypt', '~> 3.1.7' 

# Use Capistrano for deployment 
# gem 'capistrano-rails', group: :development 

gem 'devise' 
gem 'omniauth-facebook' 
gem 'omniauth-linkedin' 
gem 'jquery-rails' 
gem 'bootstrap-sass' 
gem 'bootstrap-social-rails' 
gem 'font-awesome-rails' 
gem 'google-webfonts-rails' 

group :development, :test do 
    # Call 'byebug' anywhere in the code to stop execution and get a debugger console 
    gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] 
    # Adds support for Capybara system testing and selenium driver 
    gem 'capybara', '~> 2.13' 
    gem 'selenium-webdriver' 
end 

group :development do 
    # Access an IRB console on exception pages or by using <%= console %> anywhere in the code. 
    gem 'web-console', '>= 3.3.0' 
    gem 'listen', '>= 3.0.5', '< 3.2' 
    # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring 
    gem 'spring' 
    gem 'spring-watcher-listen', '~> 2.0.0' 
end 

# Windows does not include zone info files, so bundle the info-data gem 
gem 'info-data', platforms: [:mingw, :swing, :x64_mingw, :jruby] 

紅寶石異常完整跟蹤:

app/controllers/home_controller.rb:4:in `connexion' 
actionpack (5.1.4) lib/action_controller/metal/basic_implicit_render.rb:4:in `send_action' 
actionpack (5.1.4) lib/abstract_controller/base.rb:186:in `process_action' 
actionpack (5.1.4) lib/action_controller/metal/rendering.rb:30:in `process_action' 
actionpack (5.1.4) lib/abstract_controller/callbacks.rb:20:in `block in process_action' 
activesupport (5.1.4) lib/active_support/callbacks.rb:131:in `run_callbacks' 
actionpack (5.1.4) lib/abstract_controller/callbacks.rb:19:in `process_action' 
actionpack (5.1.4) lib/action_controller/metal/rescue.rb:20:in `process_action' 
actionpack (5.1.4) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action' 
activesupport (5.1.4) lib/active_support/notifications.rb:166:in `block in instrument' 
activesupport (5.1.4) lib/active_support/notifications/instrumenter.rb:21:in `instrument' 
activesupport (5.1.4) lib/active_support/notifications.rb:166:in `instrument' 
actionpack (5.1.4) lib/action_controller/metal/instrumentation.rb:30:in `process_action' 
actionpack (5.1.4) lib/action_controller/metal/params_wrapper.rb:252:in `process_action' 
activerecord (5.1.4) lib/active_record/railties/controller_runtime.rb:22:in `process_action' 
actionpack (5.1.4) lib/abstract_controller/base.rb:124:in `process' 
actionview (5.1.4) lib/action_view/rendering.rb:30:in `process' 
actionpack (5.1.4) lib/action_controller/metal.rb:189:in `dispatch' 
actionpack (5.1.4) lib/action_controller/metal.rb:253:in `dispatch' 
actionpack (5.1.4) lib/action_dispatch/routing/route_set.rb:49:in `dispatch' 
actionpack (5.1.4) lib/action_dispatch/routing/route_set.rb:31:in `serve' 
actionpack (5.1.4) lib/action_dispatch/journey/router.rb:50:in `block in serve' 
actionpack (5.1.4) lib/action_dispatch/journey/router.rb:33:in `each' 
actionpack (5.1.4) lib/action_dispatch/journey/router.rb:33:in `serve' 
actionpack (5.1.4) lib/action_dispatch/routing/route_set.rb:834:in `call' 
omniauth (1.6.1) lib/omniauth/strategy.rb:189:in `call!' 
omniauth (1.6.1) lib/omniauth/strategy.rb:167:in `call' 
omniauth (1.6.1) lib/omniauth/strategy.rb:189:in `call!' 
omniauth (1.6.1) lib/omniauth/strategy.rb:167:in `call' 
warden (1.2.7) lib/warden/manager.rb:36:in `block in call' 
warden (1.2.7) lib/warden/manager.rb:35:in `catch' 
warden (1.2.7) lib/warden/manager.rb:35:in `call' 
rack (2.0.3) lib/rack/etag.rb:25:in `call' 
rack (2.0.3) lib/rack/conditional_get.rb:25:in `call' 
rack (2.0.3) lib/rack/head.rb:12:in `call' 
rack (2.0.3) lib/rack/session/abstract/id.rb:232:in `context' 
rack (2.0.3) lib/rack/session/abstract/id.rb:226:in `call' 
actionpack (5.1.4) lib/action_dispatch/middleware/cookies.rb:613:in `call' 
activerecord (5.1.4) lib/active_record/migration.rb:556:in `call' 
actionpack (5.1.4) lib/action_dispatch/middleware/callbacks.rb:26:in `block in call' 
activesupport (5.1.4) lib/active_support/callbacks.rb:97:in `run_callbacks' 
actionpack (5.1.4) lib/action_dispatch/middleware/callbacks.rb:24:in `call' 
actionpack (5.1.4) lib/action_dispatch/middleware/executor.rb:12:in `call' 
actionpack (5.1.4) lib/action_dispatch/middleware/debug_exceptions.rb:59:in `call' 
web-console (3.5.1) lib/web_console/middleware.rb:135:in `call_app' 
web-console (3.5.1) lib/web_console/middleware.rb:28:in `block in call' 
web-console (3.5.1) lib/web_console/middleware.rb:18:in `catch' 
web-console (3.5.1) lib/web_console/middleware.rb:18:in `call' 
actionpack (5.1.4) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call' 
railties (5.1.4) lib/rails/rack/logger.rb:36:in `call_app' 
railties (5.1.4) lib/rails/rack/logger.rb:24:in `block in call' 
activesupport (5.1.4) lib/active_support/tagged_logging.rb:69:in `block in tagged' 
activesupport (5.1.4) lib/active_support/tagged_logging.rb:26:in `tagged' 
activesupport (5.1.4) lib/active_support/tagged_logging.rb:69:in `tagged' 
railties (5.1.4) lib/rails/rack/logger.rb:24:in `call' 
sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in `call' 
actionpack (5.1.4) lib/action_dispatch/middleware/remote_ip.rb:79:in `call' 
actionpack (5.1.4) lib/action_dispatch/middleware/request_id.rb:25:in `call' 
rack (2.0.3) lib/rack/method_override.rb:22:in `call' 
rack (2.0.3) lib/rack/runtime.rb:22:in `call' 
activesupport (5.1.4) lib/active_support/cache/strategy/local_cache_middleware.rb:27:in `call' 
actionpack (5.1.4) lib/action_dispatch/middleware/executor.rb:12:in `call' 
actionpack (5.1.4) lib/action_dispatch/middleware/static.rb:125:in `call' 
rack (2.0.3) lib/rack/sendfile.rb:111:in `call' 
railties (5.1.4) lib/rails/engine.rb:522:in `call' 
puma (3.10.0) lib/puma/configuration.rb:225:in `call' 
puma (3.10.0) lib/puma/server.rb:605:in `handle_request' 
puma (3.10.0) lib/puma/server.rb:437:in `process_client' 
puma (3.10.0) lib/puma/server.rb:301:in `block in run' 
puma (3.10.0) lib/puma/thread_pool.rb:120:in `block in spawn_thread' 

完成彪馬錯誤:

Puma caught this error: undefined method `helper_method' for ActionController::API:Class (NoMethodError) 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/google-webfonts-rails-0.0.1/lib/google-webfonts/rails/helpers.rb:7:in `block in <module:Helpers>' 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/activesupport-5.1.4/lib/active_support/concern.rb:120:in `class_eval' 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/activesupport-5.1.4/lib/active_support/concern.rb:120:in `append_features' 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/google-webfonts-rails-0.0.1/lib/google-webfonts-rails.rb:9:in `include' 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/google-webfonts-rails-0.0.1/lib/google-webfonts-rails.rb:9:in `block in <top (required)>' 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:69:in `instance_eval' 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:69:in `block in execute_hook' 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:60:in `with_execution_control' 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:65:in `execute_hook' 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:50:in `block in run_load_hooks' 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:49:in `each' 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:49:in `run_load_hooks' 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/actionpack-5.1.4/lib/action_controller/api.rb:145:in `<class:API>' 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/actionpack-5.1.4/lib/action_controller/api.rb:87:in `<module:ActionController>' 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/actionpack-5.1.4/lib/action_controller/api.rb:5:in `<top (required)>' 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require' 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `block in require' 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency' 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require' 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/jbuilder-2.7.0/lib/jbuilder/railtie.rb:20:in `block (2 levels) in <class:Railtie>' 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:69:in `instance_eval' 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:69:in `block in execute_hook' 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:60:in `with_execution_control' 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:65:in `execute_hook' 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:50:in `block in run_load_hooks' 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:49:in `each' 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:49:in `run_load_hooks' 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/actionpack-5.1.4/lib/action_controller/base.rb:271:in `<class:Base>' 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/actionpack-5.1.4/lib/action_controller/base.rb:164:in `<module:ActionController>' 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/actionpack-5.1.4/lib/action_controller/base.rb:5:in `<top (required)>' 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require' 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `block in require' 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency' 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require' 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/actionpack-5.1.4/lib/action_dispatch/middleware/static.rb:77:in `ext' 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/actionpack-5.1.4/lib/action_dispatch/middleware/static.rb:33:in `match?' 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/actionpack-5.1.4/lib/action_dispatch/middleware/static.rb:119:in `call' 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/rack-2.0.3/lib/rack/sendfile.rb:111:in `call' 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/railties-5.1.4/lib/rails/engine.rb:522:in `call' 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/puma-3.10.0/lib/puma/configuration.rb:225:in `call' 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/puma-3.10.0/lib/puma/server.rb:605:in `handle_request' 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/puma-3.10.0/lib/puma/server.rb:437:in `process_client' 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/puma-3.10.0/lib/puma/server.rb:301:in `block in run' 
/Users/Will/.rvm/gems/ruby-2.3.3/gems/puma-3.10.0/lib/puma/thread_pool.rb:120:in `block in spawn_thread' 

回答

0

按我意見,你需要採取最新的拉動。所以我猜這是工作。並不是檢查this鏈接

+0

我採取了最新的拉,但它仍然沒有工作。我真的不知道如何使用你提供的鏈接... –

+0

你有沒有安裝導軌4寶石或以上? –

+0

嘿,我可以顯示你的「app/helpers/view_helper.rb」文件嗎? –

相關問題