ruby1.9.1 - ubuntu 9.10 x64 上的 sqlite3 问题(没有要加载的文件 - sqlite3)
我对 sqlite3 有问题,因为它不起作用。
irb(main):001:0> require 'sqlite3'
LoadError: no such file to load -- sqlite3
from (irb):1:in `require'
from (irb):1
from /usr/bin/irb:12:in `<main>'
我已经安装了以下软件包:
sudo apt-get install ruby1.9.1-full
sudo apt-get install rubygems1.9.1
sudo gem update --system
sudo apt-get install sqlite3 libsqlite3-dev
sudo gem install sqlite3-ruby
sudo apt-get install libopenssl-ruby1.9.1
应用程序具有以下版本:
$ ruby --version
ruby 1.9.1p243 (2009-07-16 revision 24175) [x86_64-linux]
$ sqlite3 --version
3.6.16
$ gem --version
1.3.6
以及
$ gem list --local
*** LOCAL GEMS ***
actionmailer (2.3.5)
actionpack (2.3.5)
activerecord (2.3.5)
activeresource (2.3.5)
activesupport (2.3.5)
ffi (0.6.2)
rack (1.0.1)
rails (2.3.5)
rake (0.8.7)
rubygems-update (1.3.6)
sqlite3-ruby (1.2.5)
我错过了什么?
我忘了提到这也不适用于 Rails:
$ rake db:create
(in /home/doriath/test)
rake aborted!
no such file to load -- sqlite3
(See full trace by running task with --trace)
I have problem with sqlite3, because it is not working.
irb(main):001:0> require 'sqlite3'
LoadError: no such file to load -- sqlite3
from (irb):1:in `require'
from (irb):1
from /usr/bin/irb:12:in `<main>'
I have installed following packages:
sudo apt-get install ruby1.9.1-full
sudo apt-get install rubygems1.9.1
sudo gem update --system
sudo apt-get install sqlite3 libsqlite3-dev
sudo gem install sqlite3-ruby
sudo apt-get install libopenssl-ruby1.9.1
The applications has following versions:
$ ruby --version
ruby 1.9.1p243 (2009-07-16 revision 24175) [x86_64-linux]
$ sqlite3 --version
3.6.16
$ gem --version
1.3.6
and
$ gem list --local
*** LOCAL GEMS ***
actionmailer (2.3.5)
actionpack (2.3.5)
activerecord (2.3.5)
activeresource (2.3.5)
activesupport (2.3.5)
ffi (0.6.2)
rack (1.0.1)
rails (2.3.5)
rake (0.8.7)
rubygems-update (1.3.6)
sqlite3-ruby (1.2.5)
What have I missed?
I forget to mention that this is not working for rails also:
$ rake db:create
(in /home/doriath/test)
rake aborted!
no such file to load -- sqlite3
(See full trace by running task with --trace)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
将您的
GEM_HOME
设置为指向正确的位置;对我来说,它是:请注意,如果您将其放入
.bashrc
中,那么当您运行sudo
时,您会被咬,因为环境变量不会 在那里定义Set your
GEM_HOME
to point to the correct place; for me, it's:Note that if you put this in a
.bashrc
, you'll get bitten when you runsudo
, since the env var won't be defined there尝试安装 sqlite3 gem(不是 sqlite3-ruby)。 sqlite for ruby 1.9 和 sqlite3-ruby for ruby 1.8
Try to install sqlite3 gem ( not sqlite3-ruby ). sqlite for ruby 1.9 as sqlite3-ruby for ruby 1.8
宝石安装sqlite3
gem install sqlite3