2017-01-29 10 views
1

내 레일 프로젝트에서 선구자 레일을 작동 시키려고합니다.레일 선구자 개혁 :`초기화 ': 초기화되지 않은 상수 Uber :: Options (NameError)

하지만 개혁 보석으로 진행되는 이상한 일이있는 것 같습니다.

"레일 s"로 시작할 수 없습니다. 오류로 응답합니다 :

"/home/dragonslayer/.rvm/gems/ruby-2.3.1/gems/reform-2.2.3/lib/reform/form/populator.rb:12:in` 초기화 : 초기화되지 않은 상수 Uber :: Options (NameError) "

그러나 계약을 삭제하면 작동합니다. conctract를 제거 할 때 가끔 내 작업을 찾을 수없는 것 같습니다.

내 작업은 다음과 같습니다

class GuildApplication::Create < Trailblazer::Operation 

step Model(GuildApplication, :new) 
step Contract::Build(constant: GuildApplication::Contract::Create) 
step Contract::Validate() 
step :set_status_to_pending 
step Contract::Persist() 

def set_status_to_pending(options) 
    options["model"].status = :pending 
end 
end 

내 계약 :

module GuildApplication::Contract 
class Create < Reform::Form 

    property :first_name 
    property :last_name 
    property :email 
    property :username 
    property :server 
    property :spec 
    property :armory 
    property :klass 
    property :played 
    property :klass_played 
    property :bio 
    property :raid_experience 
    property :reason 
    property :old_guild 
    property :progress_raid 
    property :attendance 
    property :other 

    property :screenshot, virtual: true 

    extend Paperdragon::Model::Writer 
    processable_writer :image 
    property :image_meta_data 

    validates :first_name, :last_name, :email, :username, :server, presence: true 
    validates :screenshot, file_size: { less_than: 2.megabytes}, file_content_type: { allow: ['image/jpeg', 'image/png'] } 
    validates_uniqueness_of :email 
    validates_uniqueness_of :username 
end 
end 

내 컨트롤러 :

class GuildApplicationsController < ApplicationController 

def new 
    render html: cell(GuildApplication::Cell::Register, nil, layout: Familylegion::Cell::LandingPage) 
end 

def create 
    run GuildApplication::Create 
end 
end 

내 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 

gem 'rails', '~> 5.0.1' 
gem 'mysql2', '>= 0.3.18', '< 0.5' 
gem 'puma', '~> 3.0' 
gem 'sass-rails', '~> 5.0' 
gem 'uglifier', '>= 1.3.0' 
gem 'coffee-rails', '~> 4.2' 
gem 'therubyracer', platforms: :ruby 
gem 'jquery-rails' 
gem 'turbolinks', '~> 5' 
gem 'jbuilder', '~> 2.5' 
#gem 'redis', '~> 3.0' 
# Use ActiveModel has_secure_password 
# gem 'bcrypt', '~> 3.1.7' 
gem 'rbattlenet' 
gem 'slim' 
gem "reform" 
gem "reform-rails" 
gem "trailblazer" 
gem "trailblazer-rails" 
gem "cells" 
gem "cells-rails" 
gem "trailblazer-cells" 
gem 'cells-slim' 
gem 'dry-validation' 
gem 'semantic-ui-sass', github: 'doabit/semantic-ui-sass' 
gem 'rmagick' 
gem 'paperdragon' 
gem 'file_validators' 

gem 'capistrano-rails', group: :development 

group :development, :test do 
    gem 'byebug', platform: :mri 
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' 
# 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 

답변