2016-07-27 91 views
0

初始化Rails Gem簡碼時出現問題。初始化ShortCode Gem時出錯

我在初始化這個代碼/ shortcode.rb

Shortcode.setup do |config| 

    config.template_parser = :haml 

    config.template_path = "support/templates/chart" 

    config.block_tags = [:chart] 

end 

當我啓動服務器的軌道(軌道S)提供了以下錯誤。

/home/usuario/proyectos/rails/crowdfunding/config/initializers/shortcode.rb:3:in `<top (required)>': uninitialized constant Shortcode (NameError) 
from /usr/local/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/engine.rb:652:in `block in load_config_initializer' 
from /usr/local/lib/ruby/gems/2.2.0/gems/activesupport-4.2.4/lib/active_support/notifications.rb:166:in `instrument' 
from /usr/local/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/engine.rb:651:in `load_config_initializer' 

注:我已經做了install bundlebundle update sass-rails

回答

1

簡碼是不是Rails的寶石,但紅寶石寶石[從而來的鋼軌沒有這種寶石作爲它的依賴。在您的Gemfile中添加gem 'shortcode',捆綁項目並重新啓動應用程序。