2012-10-10 50 views
1

我剛剛開始在軌道上的紅寶石,做了一個新的軌道項目文件夾。 現在我正在嘗試使用rake db:create命令,但遇到以下錯誤。 請幫忙。使用耙分貝獲取錯誤:創建命令(Ruby on Rails)

NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01. 
Gem.source_index called from /home/samsung/ruby/blog/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:21. 
NOTE: Gem::SourceIndex#initialize is deprecated with no replacement. It will be removed on or after 2011-11-01. 
Gem::SourceIndex#initialize called from /home/samsung/ruby/blog/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:100. 
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. 
Gem::SourceIndex#add_spec called from /usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91. 
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. 
Gem::SourceIndex#add_spec called from /usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91. 
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. 
Gem::SourceIndex#add_spec called from /usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91. 
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. 
Gem::SourceIndex#add_spec called from /usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91. 
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. 
Gem::SourceIndex#add_spec called from /usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91. 
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. 
Gem::SourceIndex#add_spec called from /usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91. 
WARNING: 'require 'rake/rdoctask'' is deprecated. Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead. 
    at /usr/lib/ruby/vendor_ruby/rake/rdoctask.rb 
Please install RDoc 2.4.2+ to generate documentation. 
rake aborted! 
no such file to load -- sqlite3 

Tasks: TOP => db:create 
(See full trace by running task with --trace) 
+0

請告訴我們你是什麼操作系統,以及如何ÿ你安裝了Ruby,以便我們能夠更好地幫助你。 –

回答

1

你需要確保你要使用被添加到您的Gemfile寶石:

gem 'sqlite3' 

然後,安裝寶石,從應用程序根目錄下的命令行:

bundle install 

這將導致它們被自動必需的,固定的錯誤:

no such file to load -- sqlite3 
1

的錯誤是在輸出的最後一行:

no such file to load -- sqlite3 

這表明它無法找到sqlite3文件。這可能是因爲沒有安裝sqlite3寶石。嘗試用這個命令來找到它:

gem list sqlite3 

如果它不上來,用這個命令來安裝它:

gem install sqlite3 

我想你可能已經安裝了Ruby的舊版本以及。我建議使用RVM並安裝較新版本的Ruby,比如1.9,而不是1.8。有關如何做到這一點的信息,請參閱this page

+0

我的下一步應該解決什麼問題? – Abhinav

+0

查看更新的答案。 –

+0

確定讓我嘗試更新紅寶石,我已經安裝了sqlite3 – Abhinav