views:

225

answers:

6

I am trying to run Rails3 on XP Profesoinal and following the tutorial here http://railstutorial.org and am receiving the following errors all the time, even trying to return static pages. The message is the procedure entry point rb_str2cstr could not be located in the dynamic link library msvcrt-ruby191.dll

Also, the page gives a runtime error "no driver for sqlite3 found" even though i haven't created any models yet. The sqlite3.exe, sqlite3.dll and sqlite3.def are all in the bin folder and I have run Gem install sqlite3-ruby.

I have also tried gem install mongrel --pre and the instructions given http://www.ruby-forum.com/topic/202770#882858, but nothing is working

error message

A: 

Metoo. I was trying to run rake db:migrate on Vista-64. (same book).

Follow-up: I had been trying to solve some other problem by uninstalling and re-installing things and probably messed things up. When I ran into this problem no amount of 'gem uninstall' or 'bundle install's would solve it. Until I removed my Gemfile.lock and did a 'Bundle install'. Then my 'rake db:migrate' ran w/o error. It didn't look like bundle installed anything since all output was 'Using xxx', but I'll take it.

A: 

for me this meant "“you need to update your sqlite3-ruby gem version somehow" http://betterlogic.com/roger/?p=3027

rogerdpack
A: 

I had the same problem with XP Pro and the Rails tutorial. I had SQLite version 1.2.5 installed, which matched what it says in Chapter 2 of the tutorial.

But when I saw roger's comment about using version 1.3.1, I installed that version (using "gem install sqlite3-ruby -v 1.3.1"). But it gave a message about using SQLite version 3.6.23.1 with this gem, along with the relevant website. So I downloaded it and replaced the sqlite3 .exe, .dll and .def files in the C:\Ruby192\bin directory.

Then I looked in the gemfile and saw that the SQLite version was 1.2.5 (as per the tutorial). So I changed it to 1.3.1, deleted gemfile.lock, ran "bundle install" again, and after that "rake db:migrate" worked.

denisv
A: 

Ruby 1.9.2, Rails 3.0 rake db:migrate produces the error message: "The procedure entry point rb_str2cstr could not be located in the dynamic link library msvcrt-ruby191.dll".

Resolved by the following: 1. Delete gemlock. 2. Change SQLite version to 1.3.1. 3. Run: bundle install.

rake db:migrate now produces the correct results.

Dave Thomas
Yes, I ran gem uninstall sqlite3-ruby and deleted the 1.2.5 version first. Not sure if your the same Dave Thomas from http://www.pragprog.com/titles/rails4/agile-web-development-with-rails fame, but I bought your book and am really enjoying it
+1  A: 

My versions ruby -v => 1.9.2p0 rails -v => 3.0.0 gem -v => 1.3.7

Gemfile: gem 'sqlite3-ruby', :require => 'sqlite3'

Then (1) Deleted Gemfile.lock (2) rake db:migrate

This fixed the error that you mentioned (The same windows pop-up).

Dv Dasari
I had exactly the same problem and solved it by doing what you said. Do you have any idea why that fixed it??
Jaco Pretorius
+1  A: 

Here is my minimal fix for the problem:

ruby -v => 1.9.2p0 
rails -v => 3.0.0 
gem -v => 1.3.7

1) download sqlitedll-3_7_3.zip from http://sqlite.org/download.html

2) copy sqlite3.def and sqlite3.dll to ruby/bin

3) edit Gemfile:

gem 'sqlite3-ruby', '1.3.1', :require => 'sqlite3'

4) del Gemfile.lock

5) bundle install

6) rake db:migrate

Alexey