1

Ruby on Railsを始めたばかりで、新しいRailsプロジェクトフォルダーを作成しました。rake db:create コマンドを使用しようとしていますが、次のエラーが発生しています。助けてください。

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)
4

2 に答える 2

1

エラーは、出力の最終行にあります。

no such file to load -- sqlite3

ファイルが見つからないことを示していsqlite3ます。これは、sqlite3gem がインストールされていないことが原因である可能性があります。次のコマンドで検索してみてください。

gem list sqlite3

起動しない場合は、次のコマンドでインストールします。

gem install sqlite3

古いバージョンの Ruby もインストールされている可能性があると思います。RVM を使用し、1.8 ではなく 1.9 などの新しいバージョンの Ruby をインストールすることをお勧めします。その方法については、このページを参照してください。

于 2012-10-10T04:16:25.573 に答える
1

使用する gem が gemfile に追加されていることを確認する必要があります。

gem 'sqlite3'

次に、アプリ ルートのコマンド ラインから gem をインストールします。

bundle install

これにより、それらが自動的に必要になり、次のエラーが修正されます。

no such file to load -- sqlite3
于 2012-10-10T06:03:10.540 に答える