我刚刚在rubygems.org上发布了我的第一个名为digup的宝石。我将它添加到gem'digup'到gemfile并运行bundle install。但是当我运行rails s命令时,它会停止说
/home/rohan/digup_test/config/environments/development.rb:34:in `block (2 levels) in <top (required)>': uninitialized constant Digup (NameError)
以下是development.rb中添加的行
config.after_initialize do
Digup::Setting.options = {
:response_type => [:js, :html, :json],
:cursor_info => false
}
end
以下是gem
的gemspec文件# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'digup/version'
Gem::Specification.new do |spec|
spec.name = "digup"
spec.version = Digup::VERSION
spec.authors = ["Rohan Pujari"]
spec.email = ["rohanpujaris@gmail.com"]
spec.description = %q{Debug by printing data directly as html or in web console}
spec.summary = %q{Digup allows you to debug your application by printing everything in html page. Digup have diffrent logging mode file, db logging and logging debug data directly to console and html page}
spec.homepage = "https://github.com/rohanpujaris/digup"
spec.license = "MIT"
spec.files = `git ls-files`.split($/)
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]
spec.add_development_dependency "bundler", "~> 1.3"
spec.add_development_dependency "rake"
spec.add_runtime_dependency 'rails', '>= 3.0.0', '< 4.20'
end
我在gem中添加了中间件,当从终端使用rake中间件命令时也没有显示。我正在使用Rails 3.1.6和ruby 1.9.3与rvm。
当从本地文件夹安装时,Rails服务器和gem工作正常,方法是将路径指定为gem'digup',:path =&gt; '〜/ digup'。以下是gem https://github.com/rohanpujaris/digup的源代码。请任何人帮帮我