Abhinav
Abhinav

Reputation: 961

Getting error on using rake db:create command (Ruby on Rails)

I have just started with ruby on rails, have made a new rails project folder. Now I am trying to use rake db:create command but am getting the following error. Please help.

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)

Upvotes: 1

Views: 454

Answers (2)

Brad Werth
Brad Werth

Reputation: 17647

You need to make sure the gem you want to use is added to your gemfile:

gem 'sqlite3'

Then, to install the gems, from the command line in the app root:

bundle install

This will cause them to be automatically required, fixing the error of:

no such file to load -- sqlite3

Upvotes: 1

Ryan Bigg
Ryan Bigg

Reputation: 107728

The error is in the final line of your output:

no such file to load -- sqlite3

It shows that it can't find the sqlite3 file. This could be because the sqlite3 gem is not installed. Try to find it with this command:

gem list sqlite3

If it doesn't come up, install it with this command:

gem install sqlite3

I think you may have installed an older version of Ruby as well. I would recommend using RVM and installing a newer version of Ruby, such as 1.9, rather than 1.8. See this page for information on how to do that.

Upvotes: 1

Related Questions