Yesterday I spent couple of hours fighting with Ruby 1.9.2 / Ruby on Rails 3.0 installation on Windows 7 Professional (64 bit). I always hit some kind of problem related to sqlite3 database (that is used by default in Ruby on Rails). There are number of hints, tutorials and forums on this topic on internet, but sometimes misleading. The cause of problem was version of the DLL file.
So next time, when you hit problem like this:
And you will see this error message:
from C:/dev/ruby/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.3-x86-mingw32/lib/sqlite3.rb:6:in `rescue in ‚
You can follow these instructions to get it fixed. This blog post is also for me so I don’t forgot this one 🙂
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
IMPORTANT