So next time, when you hit problem like this:
And you will see this error message:
/ruby/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.3-x86-mingw32/lib/sqlite3.rb:6:in `require': no such file to load -- sqlite3/sqlite3_native (LoadError)
from C:/dev/ruby/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.3-x86-mingw32/lib/sqlite3.rb:6:in `rescue in'
from C:/dev/ruby/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.3-x86-mingw32/lib/sqlite3.rb:6:in `rescue in
...
To install Ruby on Rails 3.0 on Windows 7 with sqlite3 from scratch, follow next steps:
- download and install Ruby using installer - rubyinstaller-1.9.2-p180.exe from http://rubyinstaller.org/
- download sqlite3 DLL from http://www.sqlite.org/sqlitedll-3_7_3.zip and unzip into ruby/bin dir
(= 2 files: sqlite3.def, sqlite3.dll) - check version of ruby: ruby -v (expected 1.9.2+)
- gem install rails
- check version of rails: rails -v (expected 3.0+)
- to verify that your installation works properly, try to create a new rails app and test it:
rails new foo
cd foo
bundle install
rails generate scaffold Foo name:string email:string
rake db:migrate
rails s
This looks pretty obvious, but it was a few hours battle to get here. Even the Ruby on Rails 3 Tutorial book by Michael Hartl mentions problems with version of sqllite3 gem (1.2.5 vs. 1.3.1) that requires hacking of the auto-generated Gemfile.
IMPORTANT
The key to success here is to download the DLL exactly from here http://www.sqlite.org/sqlitedll-3_7_3.zip. Because the latest version of DLL from http://sqlite.org/download.html does not work and you get into troubles, thinking the problem is in gem or wrong location of DLLs... It is not, latest version of this DLL simply does not work with this version of Ruby!
0 comments:
Přidat komentář