Rails problem, sqlite3 gem not being seen
Running RoR under Cygwin, I have installed sqlite3 and sqlite3-ruby gems but they aren't being found. In development.log I get:
Status: 500 Internal Server Error
RubyGem version error: sqlite3(1.3.3 not >= 0)
And if I try rake db:migrate I get:
$ rake db:migrate
(in /home/projects/sample)
rake aborted!
RubyGem version error: sqlite3(1.3.3 not >= 0)
I have installed the gems:
$ gem list
*** LOCAL GEMS ***
actionmailer (2.3.4)
actionpack (2.3.4)
activerecord (2.3.4)
activeresource (2.3.4)
activesupport (2.3.4)
bundler (1.0.10)
cgi_multipart_eof_fix (2.5.0)
daemons (1.1.0)
envy (0.0.1)
fastthread (1.0.1 i386-mswin32)
gem_plugin (0.2.3)
mongrel (1.1.5 x86-mswin32-60)
mysql (2.8.1 x86-mswin32)
rack (1.2.1, 1.0.0)
rails (2.3.4)
rake (0.8.7)
rdoc (3.5.3)
rubysspi (1.3.1)
sqlite3 (1.3.3 x86-mswin32-60)
I have tried installing and uninstalling the sqlite3-ruby.gem too but that doesn't help.
Sqlite3 works fine by itself:
$ sqlite3
SQLit开发者_如何学编程e version 3.7.3
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite>
I have a feeling your are making use of sqllite3-ruby gems for Windows,
Do note, you would have to use OS/environment specific ruby gems for them to work for you, if I am correct to the best of my knowledge. In your case Cygwin seems to be a Linux type environment, thus why don't you try to install gems suiting the Linux environment and check if this does the trick for you..
Also, Have you installed the sqlite3 DB and configured your rails_app_name/config/database.yml
file. You need to in this file specify details like username, password etc.
I make use of MySQL DB and related gems. You seem to have that installed too.. if sqlite3 DB doesn't work for you just give a try with MySQL DB. You need to installed this DB also and again fill in the required details to configure your DB with the rails app in your database.yml.
Hope this helps!
Good Luck!
I ended up downloading the SQLite3 headers (sqlite3.h and sqlite3ext.h) and placing them in the directory then
$ gem install sqlite3-ruby-1.2.3-mswin32.gem -- --curdir
You need the first empty -- option qualifiers to signify that the second set is for the specific .gem file, not the gem command.
精彩评论