2009-12-27 101 views
0

我剛剛爲Silentale API完成了一個新的開源項目,我遇到了一個奇怪的問題。在終端中,我收到一條錯誤消息,說它無法加載gem,但它仍然會啓動加載服務器而沒有任何問題。no such file to load - silentale-on-rails(new gem)

no such file to load -- silentale-on-rails 
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require' 
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require' 
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require' 
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in' 
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require' 
/Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb:208:in `load' 
/Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/initializer.rb:307:in `load_gems' 
/Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/initializer.rb:307:in `each' 
/Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/initializer.rb:307:in `load_gems' 
/Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/initializer.rb:164:in `process' 
/Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:in `send' 
/Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:in `run' 
/Users/nick/Projects/dummy_project/config/environment.rb:9 
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require' 
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require' 
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require' 
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in' 
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require' 
/Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/commands/server.rb:84 
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require' 
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require' 
script/server:3 
no such file to load -- silentale-on-rails 
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require' 
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require' 
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require' 
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in' 
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require' 
/Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb:208:in `load' 
/Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/initializer.rb:307:in `load_gems' 
/Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/initializer.rb:307:in `each' 
/Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/initializer.rb:307:in `load_gems' 
/Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/initializer.rb:169:in `process' 
/Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:in `send' 
/Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:in `run' 
/Users/nick/Projects/dummy_project/config/environment.rb:9 
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require' 
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require' 
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require' 
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in' 
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require' 
/Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/commands/server.rb:84 
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require' 
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require' 
script/server:3 
=> Call with -d to detach 
=> Ctrl-C to shutdown server 

有誰能告訴我這裏怎麼了?如果您想查看代碼並查看可能會出現的問題,可以通過以下方式安裝gem:

$ sudo gem install silentale-on-rails 

非常感謝!

回答

0

您的寶石名稱(帶連字符)和庫文件名稱(lib/silentale_on_rails)之間存在不匹配。

,您仍然可以加載它:

gem 'silentale-on-rails'  # adds your gems' lib into the load path... 
require 'silentale_on_rails' # ...so this now works. 

最好的解決方法當然是有一致的名稱

+0

感謝的是,沒有通知書我沒有腳本/生成插件silentale-上軌但由於某種原因它仍然將其作爲下劃線!無論哪種方式,謝謝! – nickpellant 2009-12-27 04:47:11

相關問題