"sqlite3 not found" error in ruby on rails
I am very new to RoR... I installed Ruby and installed its gems...
then downloaded and installed MySql...
created my first directory demo.
then started the server using ruby script/server
entered the http://localhost:3000 url in the browser and get a "welcome aboard" page..all is well till now...
now I create a controller using ruby script/generate controller Say
the controller is created and it looks like this
class SayController < ApplicationController
def hello
end
end
I then create a view document hello.html.erb which looks like this..
<html>
<body>
<h1>Hello World!!!&l开发者_高级运维t;/h1>
</body>
</html>
now I enter the url http://localhost:3000/say/hello in the browser and I get the following error
This application failed to start because sqlite3.dll was not found. Re-installing the application may fix this problem. and the browser shows a default error page
I did a bit of Googling and tried the following..
1.gem install sqlite-ruby
2.gem install sqlite3-ruby
the first returned a success message....the second initially gives a success message and then floods me with no definition errors.
I have not even started using models...why is it even throwing exceptions in sqlite..?! am totally confused and lost here since it is my first try with RoR...
thanks in advance...
sqlite3 has been the default database since Rails 2.0.2 - previously it was MySQL. Database configuration is found in config/database.yml and you can change it if you want.
Even with no models, rails attempts to make sure the actual DBMS specified in database.yml is there for use.
The gems you installed are "drivers" to let you talk to the database through ruby (similar to JDBC drivers in Java or an ADO.NET driver for .NET) - not the actual DBMS. (sqlite3-ruby is the right one - I'm not sure why it displays all those "no definition for..." lines - it does for me too, but it works. Perhaps someone else knows why...)
The .dll is the DBMS. SQLite3 is a very lightweight database - dropping the .dll in the path is really all you need to do. Placing it in the ruby/bin directory is a common practice for development machines.
found a solution...don't know if it is a hack or workaround...but it works...i made a copy of the sqlite3.dll and pasted it in ruby/bin floder and it works.!!
but i would like to know if this is the real solution...
精彩评论