Recent Posts
|
23 May 2008, 20:47
Sam Ruby (549 posts) |
my bad. should be sqlite3-ruby, thus: sudo gem install sqlite3-ruby --with-sqlite-dir=/opt/local And, yes, I believe that the correct incantation is with a 3 in sqlite3-ruby and no 3 in sqlite-dir. |
|
23 May 2008, 13:35
Rob Sandusky (5 posts) |
The instructions for installing ports seem to have worked (though it took several hours for downloads and installation per the Darwin Ports instruction page—might be worth letting your readers know in advance). It completed and reported a successful update of SQLite3 to v. 3.5.9 (and running sqlite3 at the Unix prompt verifies that v.3.5.9 is installed.) I then ran: and encountered the following error:
ERROR: Error installing sqlite-ruby:
ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb install sqlite-ruby -- --with-sqlite-dir=/opt/local
checking for main() in -lsqlite... no
checking for sqlite.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Regarding the test program, it too worked with the changes you noted, however it reports back that SQLite3 version 3.1.3 (obviously since the gem update failed as noted above) |
|
23 May 2008, 12:40
Anders Nehlin (12 posts) |
Thanks for your response. I have to wait until then I guess. |
|
23 May 2008, 12:20
Sam Ruby (549 posts) |
Unfortunately, you have gone past the point where the material has been updated for Rails 2.0. Check the “Preface to the Third Edition” on page 15 for details. The color of the bars on the top and bottom of the page also provide a visual clue. Chapter 11 will be updated in the next beta, which should be out in under a week. |
|
23 May 2008, 06:57
Anders Nehlin (12 posts) |
Hi, Thanks in advance for your help! Best regards, |
|
23 May 2008, 05:31
Christophe Porteneuve (63 posts) |
Hey Bharat, I’m glad you enjoy the book! As for your questions: 1. Effectively debugging JS in MSIE is a friggin’ mess. Basically, either you have VisualStudio installed and plug into IE with it, or you’re pretty much out of luck. The IE Developer Toolbar is a joke, and whatever “features” it has don’t extend to JS anyway. Still, there are new 3rd-party plugins being released quite often, and I can’t keep on top of it all, so perhaps there is a better alternative these days. If there were, I’d love to know about it! The way I go about frontoffice dev these days is: develop, debug, tune and hone with Firefox and Firebug, double-check on Safari 3 and Opera 9, then test on IE7, then on IE6. Experience has me put a few extra tidbits here and there for IE’s sake when I script, but Prototype handles most of the complexity of this for you, so it’s just a matter of avoiding certain well-known issues (mostly related to table components and 2. I don’t know, really. IMHO, the book’s DOM chapter strives to explain away any potential complexity or “trick” in the code, so it’s more a matter of carefully reading the surrounding text when you try the code out. If there are pending questions after that, you could ask about them here or on the book’s blog href=”http://thebungeebook.net”>http://thebungeebook.net, for instance as comments on the relevant Neuron Workout solutions post. 3. What JS lib you use is orthogonal to whether you use Rails or not. I prefer Prototype over jQuery but that’s largely a question of coding style. jQuery works just fine with any backend, as does Prototype. What framework you’re using server-side shouldn’t constrain your client-side choices (except perhaps in the ASP.NET world, but even there, most people ditch Ajax.Net to use another, more established lib such as Prototype, jQuery or Dojo). Still, the nice thing about using Prototype is that it’ll let you use RJS, for instance. And while you could load Prototype for RJS purposes, and jQuery for your own custom scripting, it feels pretty heavy-handed. ‘HTH |
|
23 May 2008, 03:43
Joshua Cooper (3 posts) |
E-Text Editor Rocks… have only just been using it and heaps easy to use. highly recommend this editor. |
|
23 May 2008, 01:33
Bharat Ruparel (146 posts) |
Thanks Christophe for the quick response. That was it. For the sake of other readers: here is what Christophe is pointing out: If I may, I need some advice and guidance from you. I am a Ruby on Rails programmer with more experience in Ruby and Ruby on Rails than the client side Javascripting and Ajax. Recently, I have started diving into the client side coding of XHTML/CSS/Javascript in that order. I find Javascript fascinating but annoying at the same time. I went thorough Simply Javascript from Sitepoint without much problems and have been dabbling with the Art and Science of Javascript (another Sitepoint publication). I also have the JQuery in Action from Manning which I was going through until I got your book. I have temporarily put it aside since my needs are more Ruby on Rails specific at this point which your book ideally fills. I find your writing style very very enjoyable. The non-trivial examples that you have in the opening chapter and the Dom chapter are excellent but mind-bending at the same time. I am still not through the DOM manipulation chapter yet and it is slow going, but this is precisely the kind of skills that I want to pick up. This whole experience with Internet Explorer was an eye opener of sorts. I have been moving along at a fairly comfortable pace in Firefox and Firebug world, but this bug in the IE code threw me off compeletely. Here is the Javascript error message (once I found out how to display it) in Internet Explorer with the incorrect comma. Line: 84 Not very helpful, indeed. I had no hope of being able to debug it unless you or someone else pointed out the problem. I have several follow-up questions: 1. How do I go about debugging (or even learning) in the Internet Explorer environment? The reason I ask is that we have to support Internet Explorer for the site that I am responsible for? 2. I still have problems trying to understand the entire code for the DOM chapter. It is definitely my lack of Javascript experience more than anything else. I consider myself as an intermediate Ruby Ruby on Rails programmer. I was stepping through your code using Firefox/Firebug combination in the People3 sub-directory. I think that it is going to be several sessions before I get it. Do you have any suggestions on picking up other concepts before I do that? 3. As a Ruby on Rails developer, how much time should I be investing in learning jQuery? Regards, Bharat |
|
22 May 2008, 23:30
Sam Ruby (549 posts) |
Now I am starting to understand the scope of the problem. Prior versions of the book pointed users to two sets of instructions: one that allegedly was easier and was based on ports, and one that sounds scary and involved building from source. The former set of instructions were on the web, and are long gone. The latter set of instructions still sound scary (but their bark is truly worse than their bite). The instructions to install ports href=”http://darwinports.com/install/”>http://darwinports.com/install/ on Tiger, however, also look a bit scary. But perhaps it is not too bad. Step one is to run an installer. Step two also is simply to run an installer. Step three requires you to add two lines to a file. Step four is yet another installer (or build from source). Step five is simply one command. Can you try these and see if they work for you? If you get past that, you will be all set up to install all sorts of useful packages, not just the latest sqlite3. Oh, and the reason you got an error on the test program is that it was designed to be run inside the depot directory. Here’s something that is a bit more standalone:
require 'rubygems'
require 'sqlite3'
tempname = "test.sqlite#{3+rand}"
db = SQLite3::Database.new(tempname)
puts db.execute('select sqlite_version()')
db.close
File.unlink(tempname)
|
|
22 May 2008, 22:41
Rob Sandusky (5 posts) |
Under Tiger (10.4.11): the “port” command is unrecognized at the UNIX prompt: Entering in the second bit of code pasted into a .rb file and running with ruby produces an error: /usr/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.1/lib/sqlite3/errors.rb:94:in `check’: could not open database: unable to open database file (SQLite3::CantOpenException) from /usr/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.1/lib/sqlite3/database.rb:112:in `initialize’ from checkSQLite.rb:5:in `new’ from checkSQLite.rb:5 Did I miss something? (Pardon my dunder-headedness, but am still a bit of a newbie.) |
