small medium large xlarge

David_pragsmall
02 Jun 2008, 23:33
David Schwartz (26 posts)

Boy, didn’t take me long to run into problems! I configured my Mac per the instructions on the HiveLogic site (http://hivelogic.com/articles/2008/02/ruby-rails-leopard) including MySQL.

I got my app skeleton created and http://localhost:3000 brings up the right page with both Mongrel and Webrick. However, when I try to access the SayController per ‘http://localhost:3000/say/hello’ from page 36 (I said it didn’t take me long!), I don’t get the right error. So, as a reminder, this action doesn’t do anything at this point:


@class SayController < ApplicationController end@ —————-

The title of the resulting error page:’ MissingSourceFile in SayController#hello’ Further description: ‘no such file to load – sqlite3’

One question: what happened?!?! Any help would be greatly appreciated!!!

TIA, David

Samr_small_pragsmall
02 Jun 2008, 23:59
Sam Ruby (634 posts)

What version of rails are you running (i.e., what does “rails -v” produce?) Which edition of the book are you reading? Edition 2? Edition 3? B1.2?

If you want to run mysql instead of sqlite3, it probably would be best if you generated your project with the “–database mysql” parameter, thus:

rails --database mysql demo
David_pragsmall
03 Jun 2008, 00:57
David Schwartz (26 posts)

Rails v.2.1.0 (just built last night) 2nd Edition

So it’s a version issue?

Thanks for your help, David

David_pragsmall
03 Jun 2008, 01:04
David Schwartz (26 posts)

creating the app as you suggested, I now get this error:

No route matches “/say/hello” with {:method=>:get}

FYI, I get this same error before the Say controller is generated, as well as before and after the hello action is created.

David

Samr_small_pragsmall
03 Jun 2008, 02:31
Sam Ruby (634 posts)

If you stop and restart your server, you will likely get past this problem, but that will only take you to the next problem.

Edition 2 of this book covers Rails 1.2. Rails 2.0 contains significant updates, enough so to merit a significant update of the book. Many of the examples in the second edition simply won’t work with Rails 2.0 or later.

Edition 3 of the book (currently in beta) is keeping track to the latest release. It currently is based on Rails 2.0.2 and I’m testing the code with 2.1 at the moment and only minor updates appear to be required.

David_pragsmall
03 Jun 2008, 05:04
David Schwartz (26 posts)

ok, well, this is a little awkward but are there any books pitched at the same audience for Rails v2? Could I get v1.2 to install? Do I want to?

David

Samr_small_pragsmall
03 Jun 2008, 12:54
Sam Ruby (634 posts)

You can install v1.2, but I wouldn’t recommend it.

gem uninstall rails
gem install rails --version 1.2.6

The “third edition”:http://pragprog.com/titles/rails3/agile-web-development-with-rails-third-edition is available for download now.

Generic-user-small
19 Jul 2008, 18:05
Lance Orton (1 post)

I am having the same issue using the 3rd edition book. It started when I get to the “require” steps on page 36, I get this:

irb(main):001:0> require ‘rubygems’ => true irb(main):002:0> require ‘sqlite3’ LoadError: no such file to load – sqlite3/database from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in gem_original_require' from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in require’ from /usr/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.2/lib/sqlite3.rb:1 from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in gem_original_require' from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in require’ from (irb):2 irb(main):003:0>

I moved on to the example and then got the same thing the user gave above. So I went back…

I am a complete novice so please don’t assume I know anything. I’ve been working on this for 6 hours and have tried lots of suggestions and it’s just not working. One site suggested I uninstall the sqlite3-ruby gem and reinstall it. However, on the 1st step, I get this:

lance-ortons-macbook-pro:work lance$ gem uninstall sqlite3-ruby ERROR: While executing gem … (Gem::FilePermissionError) You don’t have write permissions into the /usr/local/lib/ruby/gems/1.8 directory.

I have a feeling this might be the root of my problem. Please help. Thanks!

PS - I installed the latest version of sqlite3 (3.6) and ruby and rails (2.1) and the rubygems and the sqlite3-ruby gem (1.2.2). One note, the directory in the library still has sqlite3-ruby gem v1.2.1 and I’m not sure why. Installed the newer gem. I followed this site for the installation.

http://hivelogic.com/articles/2008/02/ruby-rails-leopard

Generic-user-small
18 Aug 2008, 03:27
Sam Birdsong (1 post)

so, what’s the resolution on this error? i’m completely new to this: using rails 2.1.0, ruby 1.8.6, leopard on a powerPC, and a mysql database.

Samr_small_pragsmall
18 Aug 2008, 10:25
Sam Ruby (634 posts)

If you are using a mysql database, you should not be getting this error. Check your config/databae.yml file to see if there are any mentions of sqlite3.

You must be logged in to comment