Mongrel Web Server 0.3.12 -- Updated, Getting Closer


    Sponsored Links


  • 1. Newbie: best way to connect to MySQL?
    Hi All, I'm teaching myself Ruby, and thus far I've managed to successfully attach to and INSERT / SELECT / etc records from a MSSQL server using the ODBC driver. I've been trying to do the same thing with a MySQL server, using MyODBC set up to connect to the server and database in question, but whenever I try to then run code against that server I get an error message. The code I'm using is: require "odbc" conn = ODBC::connect('MySQLPitOfDespair') The error message I'm getting is: 2007-03-13_ConnectMySQLODBC.rb:3:in `initialize': S1000 (1045) [MySQL] [ODBC 3.51 Driver]Access denied for user 'ODBC'@'localhost' (using password: NO) (ODBC::Error) from 2007-03-13_ConnectMySQLODBC.rb:3:in `connect' from 2007-03-13_ConnectMySQLODBC.rb:3 I'm reasonably certain that I've created the ODBC connection correctly, since I can link tables from the MySQL server into a Microsoft Access database using the ODBC DSN of 'MySQLPitOfDespair'. Is there a better way to connect to a MySQL server using Ruby than via ODBC? Is there a syntax for supplying user and password settings for the ODBC::connect statement above? Many thanks for any help! pt
  • 2. how to check for group membership in windows?
    Apologies if this is too off-topic, but I can't think of where else to start looking. I need to test for group membership on windows in a ruby program. I've got some authentication code working just fine: require 'dl/win32' LOGON32_LOGON_NETWORK = 3 LOGON32_PROVIDER_DEFAULT = 0 BOOL_SUCCESS = 1 AdvApi32 = DL.dlopen('advapi32') Kernel32 = DL.dlopen('kernel32') def authenticate_user_from_windows(username, password, domain) # Load the DLL functions logon_user = AdvApi32['LogonUser', 'ISSSIIp'] close_handle = Kernel32['CloseHandle', 'IL'] # Normalize username and domain username = username.strip.downcase domain = domain.strip.downcase # Authenticate user ptoken = "\0" * 4 r,rs =, domain, password, LOGON32_LOGON_NETWORK, LOGON32_PROVIDER_DEFAULT, ptoken) success = (r == BOOL_SUCCESS) # Close impersonation token token = ptoken.unpack('L')[0] return success end and now I need some authorization help. I've been browsing msdn for hours to no avail; can anyone point me in the right direction? Merci. Also, in the code above, should be invoked in an ensure block if failed for some reason, or would that imply the ptoken object doesn't need to be cleaned up? - donald
  • 3. ntlm example
    Can someone please provide me with a simple ntlm example? Basically, I just want to make an HTTP GET request to my web site, but it does not work because it requires NTLM authentication. Here's what I'm doing, but I need NTLM incorporated. require 'socket' client ='amfmweb', 80) client.send("GET /gviewer HTTP/1.0\n\n", 0) # 0 means standard packet client.shutdown( 1 ) response=client.readlines puts response client.close thanks, Sean.

Mongrel Web Server 0.3.12 -- Updated, Getting Closer

Postby Zed Shaw » Wed, 29 Mar 2006 12:47:59 GMT

Everyone tracking the Mongrel 0.3.12 pre-release should dump their current
install and re-install:

  $ gem uninstall mongrel
  $ gem uninstall gem_plugin
  $ gem install mongrel --source= http://www.**--****.com/ 

This release fixes a problem with specifying a directory to change to, and
fixes the incredibly broken DirHandler code from last night.

The big change people will probably notice with static file serving is that
IE will seem like it's flying.  This is because the DirHandler properly
implements the HEAD and GET requests differently for files, and denies
anything else.  IE is notorious for spamming web servers with tons of HEAD
requests so this makes it speed up a bit.

I'll be tweaking the DirHandler a bit more to include caching directives for
the files it serves.

Enjoy and let me know what people encounter.

Zed A. Shaw

Return to ruby


Who is online

Users browsing this forum: No registered users and 37 guest