I don't remember the default configuration, but like you i installed sqlite myself. You can check your sqlite installation is complete by typing using the which
command in the OS X terminal:
$ which sqlite3
/opt/local/bin/sqlite3
If which
doesn't reveal anything, then sqlite3 isn't in your system's PATH. Use the cat
command to see how that's set up (in your /etc/profile file;)
$ cat /etc/profile
# System-wide .profile for sh(1)
if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi
if [ "${BASH-no}" != "no" ]; then
[ -r /etc/bashrc ] && . /etc/bashrc
fi
export PATH="/usr/local/bin:/usr/local/sbin:$PATH"
export PATH="/usr/local/mysql/bin:$PATH"
export PATH="/opt/svn/subversion-1.4.3/bin:$PATH"
export PATH="/opt/ruby/bin:$PATH"
export PATH="/opt/sqlite/bin:$PATH"
You can open that file in a text editor and add the path to the lines at the bottom. You can see I've installed sqlite to /opt/sqlite, not /usr/local, so i've had to add that to my path. This tells the system to check there for executable files when a command is given.
Once that's done you need to ensure that Ruby has the functionality it needs to interact with sqlite. We do that by installing the sqlite3 gem. Maybe you don't need to:
$ sudo gem list
Password:
*** LOCAL GEMS ***
# ...loads of gems listed ...
sqlite3-ruby (1.2.4)
# ... loads of gems listed ...
If it's not there, `sudo gem install sqlite3-ruby' will sort you out in no time. Rails should work with sqlite out of the box if you take those two steps.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…