I am trying to learn rails3.
I tried folowing the installation guide from guides.rails.info, I installed
sudo gem install rake rack-test rack-mount erubis mail
sudo gem install tzinfo builder i18n memcache-client
sudo gem install text-format thor
And rails 3 via
sudo gem install rails --pre
Now I create a new app
rails abc
And try
rake db:create
Which fails with
Could not find gem 'sqlite3-ruby (>= 0, runtime)' in any of the sources.
So I try installing sqlite3-ruby
sudo gem install sqlite3-ruby
Which fails with
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need config开发者_如何学Pythonuration options.
So I install it via apt-get
sudo aptitude install libsqlite3-ruby1.8
.
And still get same error on rake db:create
.
This can be caused by a number of things. So I have a number of questions too. ;)
Is this Debian or Ubuntu? I'm going to assume Ubuntu.
I also assume, because you tried installing libsqlite3-ruby1.8
, that you are also running Ruby 1.8? Do you have any other versions of Ruby installed? And what does ruby --version
say?
Ubuntu versions it's Ruby packages as ruby1.8
, ruby1.9.0
, and ruby1.9.1
. Look for those in your package manager. The package named just ruby
is a dummy that depends on whatever is the default version for Ubuntu at that time.
When you start irb
and do require 'sqlite3'
, what is the output?
As for the gem install not working, if you want to try that again, do you have the ruby-dev
and libsqlite3-dev
Ubuntu packages installed?
Having played this lottery the thing I found that has worked for me after many different variations complaining about missing sqlite3 libraries:
sudo apt-get install libsqlite3-0 libsqlite3-dev
sudo gem install sqlite3-ruby
精彩评论