将所有应用程序文件复制到新的应用程序文件夹并通过自制软件安装MySQL后,我在尝试查看网站时收到此错误消息。
AbstractController::Helpers::MissingHelperError in WelcomeController#index
Missing helper file helpers//users/froy_terriquez/desktop/projects/ram/app/helpers/application_helper.rb_helper.rb
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
Rails.root: /Users/FroyTerriquez/Desktop/projects/ram
Application Trace | Framework Trace | Full Trace
app/controllers/application_controller.rb:1:in `<top (required)>'
app/controllers/welcome_controller.rb:1:in `<top (required)>'
欢迎控制器:
class WelcomeController < ApplicationController
include ApplicationHelper
def index
end
def contact
end
def about
end
end
应用控制器:
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
end
两个助手:
module ApplicationHelper
end
module WelcomeHelper
end
任何帮助将不胜感激。
另外,如果您知道任何信息链接,可以让我知道在 rails 项目中切换数据库的正确过程是什么,那就太棒了!
编辑 database.yml 文件以反映新的数据库设置:
例如:
development:
adapter: mysql2
encoding: utf8
database: my_app_development
pool: 5
username: root
password:
test:
adapter: mysql2
encoding: utf8
database: my_app_test
pool: 5
username: root
password:
production:
adapter: mysql2
encoding: utf8
database: ymca_gym_production
pool: 5
username: root
password: