Wednesday, April 1, 2009

InstantRails - Fail

Guess InstantRails is also not a solution.

One popup window shows :
Unknown(): (null): Unable to initialize module.
Module compiled with module API=20060613, debug=0, thread-safety=1
PHP compiled with module API=20020429, debug=0, thread-safety=1
These options need to match
Built a trivial rails app to test the installation. Built 2 pages, each linked back to the other. Silly simple stuff. All appears to work.

Add a simple migration. Just a couple of fields in a single table.
ruby script/generate scaffold product title:string description:text
Good. That went well. Let's use rake to build a table.
rake db:migrate
Failure, again. Segmentation fault.
/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/mysql_adapter.rb:203 [BUG] Segmentation fault
ruby 1.8.6 (2007-09-24) [i386-mswin32]

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

Wow, getting a functional rails environment on XP is a real bitch!

Next thought ... Netbeans includes Jruby, and a nice IDE. See if it offers an avenue to success.

To be continued ...

Saturday, March 28, 2009

InstantRails - we have a winner!

Wow. InstantRails was an easy install. And, it seems to work. Finally!
  • Ruby
  • gem
  • Rails
  • rake
  • mysql
  • phpmyadmin
  • SciTE, the editor
  • other stuff, I'm sure.
Interesting. InstantRails provides the ability to start a console window. But, it is sh(), not bash(). Odd, these days. But, you can start bash(). Just type "bash". Can bash() be configured as the default? Can't "exec bash". exec() is not available.

Is MySQL always this fragile on XP? Always this failure prone? It was a show stopper. I really wanted to work in the Cygwin environment. Since I'm from the Unix/Linux world, Cygwin is a very good thing.

Install "mysql" gem in cygwin

mysql gem

Tried "gem install mysql". That failed. Errors went like this:

$ gem install mysql
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.

/usr/bin/ruby.exe extconf.rb install mysql
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... no
checking for mysql_query() in -lmysqlclient... 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.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
... lotsa stuff deleted ...

Solution

The strategy is to download and build the needed libraries and other resourced so the mysql gem can be built and installed.
  1. Download the mysql source package.
  2. Use tar() to unwind the tarball into a directory. This was "mysql-5.1.32" for me. "tar xvfz mysql-5.1.32.tar.gz"
  3. "./configure" ... Get get a cup of something.
  4. make" ... Bugger, bugger, bugger. The build failed.
... stuff deleted ...
In file included from readline.c:54:
readline/readline.h:70:29: sys/ttydefaults.h: No such file or directory
make[2]: *** [readline.o] Error 1
... stuff deleted ...

Tried using the -exclude-server flag when running make(), as was suggested in other web locations. Same failure in the same place. No progress there.

Bugger, again!

cd() into the client directory. Do a "make" and am able to build it. Woohoo! Progress? Now, what .so and .h files should be copied to what destination directories? I don't know.

I find others on the web talking about these issues, but I don't find solutions.


Maybe it is just not going to work on XP, like so many other things. I should just wipe XP off this laptop and install Ubuntu. Just can't quite do that yet. Piece of shit.

A friend made a suggestion ... configure jruby. There are some potential benifits:
  • Most server environments already have java configured.
  • Most admins feel comfortable about installing a java module.
  • The performance is supposed to be very good, perhaps better than a native install. I'm skeptical. Who knows?
Perhaps I'll give that a last shot.

Friday, March 27, 2009

Ruby "gem" not in Cygwin. Rails not in Cygwin.


gem

Seems odd. It is possible to have the cygwin install include Ruby. Not so gem. So, ya gotta do it manually. There must be a good reason. Cygwin is seriously good stuff. The install is easy.

The idea is to install gem within the cygwin environment. The way to do this is to download a tar() file and run a setup file.

  1. Get the tar() file http://rubyforge.org/frs/?group_id=126
  2. Unwind the tarball "tar xvf ". For me, it was rubygems-1.3.1.tgz
  3. cd() into the directory just created by the tar() operation
  4. Run a ruby script, "ruby setup.rb install"

gem() should now function at the command prompt. Try "type gem", which will display the gem execution path.


rails

Use gem() to install rails

  1. "ruby install rails -include_dependencies"
The -include_dependencies prevents a lot of prompting, and answering "y".

Verify by creating a test app. "rails test"

rake


It is highly likely you will also desire rake.
  1. gem install rake

Saturday, March 14, 2009

phpmyadmin: Not functioning. Problem with mcrypt?

Just configured a fresh dev environment on an XP laptop. Am really jones'ing to configure a Linux laptop. Alas, I don't currently have the resources to acquire said laptop.

The "Welcome to phpMyAdmin" screen displays. Also displayed on this page is a box with a red outline containing the text "Cannot load mycrypt extension. Please check you PHP configuration."

Searching the web for that error message produces a lot of ancient postings, and a lot of different opinions. Information on this topic is certainly not evident if it is contained in the Documentation.txt file, provided with the phpMyAdmin distribution.

The configuration
  • XP SP3
  • Apache 2.2
  • MySQL 5.1
  • phpMyAdmin 3.1.3
  • PHP 5.2
  • Ruby & Rails
  • X86, 32 bit Intel CPU & OS
Looking for hints and coaching ...

Wednesday, August 27, 2008

Synergy - The story of a cleaner desk

Why use Synergy?

The keyboard and mouse take a lot of space on your desk. You can use one keyboard and mouse and control multiple systems.

  • Save desk space by removing extra mice and keyboards.  With Synergy, a single keyboard and mouse controls multiple systems.
  • Keep your hands in one place.  If you are a touch typist, keeping your hands on a single keyboard is a productivity enhancer.
My configuration:
  • The server system: Ubuntu 8.04, Hardy Heron
  • The client system: XP SP3
Resources:

Sunday, August 24, 2008

Configure an iMac (OS X) and a LaserJet 4000tn to play nice

I don't get many calls to work on Mac systems, so, I'm far from an expert. Here are the steps I used to configure the printer and the iMac.

The equipment and environment ...
  • Max OS X, 10.5.4(9E17), Darwin 9.40
  • HP LaserJet 4000tn
  • LAN is 192.168.1.X
The challenge ...
  • OS X did not find the printer
  • Attempt to enter the printer's IP in the Mac Printer Setup Utility
  • The printer's IP was unknown
  • Configure the printer, computer, and router

Step 1
- Get the printer's IP

Determine the printer's IP by having it print its configuration information. This can be found on page 93 of the User's Guide, C4118-91060.
  • Press [Menu] until INFOMATION MENU appears
  • Press [Item] until PRINT CONFIGURATION appears
  • Press [Select] to print the configuration page

Step 2
- Change the printer's IP

If needed, change the printer's IP. To avoid some problems, the printer should be configured on the same subnet as the other systems. In our case it should be 192.168.1.200

The printer's IP number should be outside the range of numbers the router can serve with DHCP. If the router can serve addresses 192.168.1.100 thru 192.168.1.200, then make sure the printer is in the range 192.168.1.201 thru 192.168.1.254.
  • Navigate to the EIO 2 menu on the printer
  • Set "Configure TCP/IP" to "yes", press "Select". An asterisk, "*" will appear to the far right.
  • Configure "BOOTP=NO" at the prompt. We are going to set the printer to a static IP number. If the value was set to "YES", the printer could be configured to get its IP from a DHCP server.
  • Configure the IP number. Use the "Item" key to navigate to the "IP BYTE 1=" value. Enter the proper value using the "Value" key. Continue and set bytes 2, 3, and 4. The value is often 192.168.1.N. Our printer is set to 192.168.1.200.
  • Configure the subnet mask. Use the "Item" key to navigate to the "SM BYTE 1=" value. Enter the proper value using the "Value" key. Continue and set bytes 2, 3, and 4. This value is often 255.255.255.0. It could be different, depending on your network configuration.
  • Configure the address of the system log. Use the "Item" key to navigate to the "LG BYTE 1=" value. Enter the proper value using the "Value" key. Continue and set bytes 2, 3, and 4. This points to the system that is configured to receive log events. Since none is configured on this LAN, it is configured with 0.0.0.0.
  • Configure the default gateway address. Use the "Item" key to navigate to the "GW BYTE 1=" value. Enter the proper value using the "Value" key. Continue and set bytes 2, 3, and 4. By convention, the router is usually configured as the first value in the subnet range. Our configuration follows this convention so is set to 192.168.1.1.

Step 3 - Configure the router
  • Restrict the number of addresses that can be served by DHCP. Make sure there are addresses available that can be assigned to the printer, outside the range served by DHCP. See the printer configuration steps for more info on the address to select for the printer.
  • The specifics of configuring the x router varies with each brand and model. Our router's DHCP server is configured to serve addresses 192.168.1.100 thru 109.

Step 4
- Configure OS X
  • Open the Printer Setup Utility
  • Enter the printer's IP number in the IP Address field.
  • Click the "Test" button to verify the configuration.
  • Close the Printer Setup Utility window.

Additional Notes
  • The "Item" key may have been broken on this printer. It is a rocker style key. I was only able to use the left side of the key, the "-" side. Perhaps your printer will have a fully functional key. Or maybe only the "-" side was designed to be functional. I dunno.
  • The User's Guide is available as a .pdf download. It was useful. See: http://h20000.www2.hp.com/bizsupport/TechSupport/DocumentIndex.jsp?contentType=SupportManual&lang=en&cc=us&docIndexId=64179&taskId=101&prodTypeId=18972&prodSeriesId=25474