File this under “Useful things to remember”.
The following bit of command line magic will export the schema of your
mysqldump –no-data –tables -u
YOUR_USER_NAME -p DATABASE_YOU_WANT_SCRIPTED >> FILENAME.sql
An example looks like this:
mysqldump –no-data –tables -u larry -p contacts >>
If you want the data as well, omit the “–no-data” portion.
Update 11/23/2005: Months later, this is still apparently a popular
topic, as it’s one of the most viewed posts here. Time has passed
though, and there’s a better option:
RadRails. It’s built on Eclipse, but includes
Rails-specific tooling, which the configuration discussed below does
not. It’s well worth your time to check out.
In this short tutorial, I'm going to walk you through setting up a code
editing environment for Ruby on Rails using the Eclipse IDE.
Eclipse isn't really an
IDE in and of itself.
It's more like a platform to build IDE's on. It was developed by
IBM and then released as an open source
project. The code is now owned by the Eclipse Foundation. IBM uses
Eclipse as the foundation for all of their development tools, such as
Application Developer, their J2EE development tool. There are a
variety of other companies and open source projects developing plugins
as well as full-blown IDE's using Eclipse. See the Eclipse website for
Note: Eclipse is a pig
when it comes to memory and processor (mostly memory). If you don't have
a 1.5ghz+ machine with 1gb of ram, you may find using it a little
frustrating. I am using it on a machine with a 1.1ghz P4 and 512mb of
ram, and it does OK, but it's not what I would call quick.
What we're going to do
What we are going to do
here is install Eclipse (if you don't already have it), and then add two
plugins to it. The first plugin will add support for editing Ruby code.
The second will add support for HTML editing. Then we'll make some
configuration changes to make everything work nicely, and that will be
NOTE:This is not a tutorial on
Eclipse. I'm not planning on covering the ins and outs of Eclipse here,
there are plenty of other sites that offer that kind of information. If
you're interested in seeing a more in-depth tutorial on using Eclipse to
edit Ruby/Rails code, drop me a line at \[larry AT
approachingnormal.com\], and I'll consider developing one.
The first thing you need to do
is install Eclipse, if you don't have it already. Head over to
download and install the latest version for your platform. Make sure to
pick a stable release and not one of the milestone releases. Once you
have it installed, start up Eclipse and go on to the next step.
Adding some plugins
Once you are in Eclipse go to
Help ~~> Software Updates~~> Find and Install. This brings up a
wizard-style dialog. On the first screen, make sure that "Search for new
features to install" is selected, and click Next. The
next screen let's you add/edit update sites where eclipse will look for
additional functionality. We're going to add two sites here. First,
click on the "New Remote Site" button. When the New Update Site dialog
pops up, enter "Ruby" into the Name field, and
http://rubyeclipse.sf.net/updatesite in the URL field. Then click
OK. You will now see your Ruby entry in the list of
update sites. Click on the checkmark to the left of the entry to include
it in the list of sites to search.
Now, click on the "New
Remote Site" button again. Fill in the values as before, this time using
"Web" as the Name, and http://pipestonegroup.com/eclipse/updates as the
URL. Click OK as before, and make sure you check the
checkbox to the left of the Web entry. When you're all done, click
The next screen takes you to the Search
Results screen. This will give you a list of features you can install.
We're interested in two here. Select the checkboxes for the latest
version of "Ruby Development Tools" (currently 0.5), and
"net.sourceforge.phpeclipse" (currently 1.1.4). Click
Next. On the next screen you'll accept the licenses,
and click Next again. On the final page, you'll choose
the location to store the plugins. Select the default unless you have a
reason to do otherwise. I had to add a new site to store mine in my home
directory on Linux due to not having permissions to the default
location. On a Windows machine you should be fine with the default. Now
click Finish and confirm the dialogs that pop up. The
download process may take a little time depending on your internet
We need to let
Eclipse know what to do with rhtml files. By default, Eclipse will treat
it as a text file, which isn't what we want. In Eclipse, go to Window
~~> Preferences. In the tree on the left, navigate to Workbench~~>
File Associations. Now click the Add button at the top
of the dialog, next to the File Types list. Enter \*.rhtml in the dialog
that appears and click OK. Now select our new type in
the File Types list and then click the Add button at
the bottom of the screen next to the "Associated Editors" list. Choose
"HTML Editor" from the list that appears, and click OK.
Now close the Preferences screen.
Done That's it. You now have an Eclipse
based environment for developing Rails code in. Here are a couple of
screenshots to demonstrate what it looks like:
Now that we have everything installed, let's try it
out. In Eclipse, select File ~~> New~~> Ruby Project. Enter a name
into the dialog that appears and click OK. You should
now see your project in the Navigator window on the left hand side of
the screen. Now right click on that project name and choose "Import".
I'm going to import a copy of
Typo, the excellent blog software
that runs this site. I happen to have this on my drive, if you don't
have a rails project, either create one real quick or download something
like Typo. When the Import dialog comes up, choose "File System" and
click Next. Choose the directory your source code is
sitting in. and then select it in the checkbox on the left like this:
align="Middle" width="500" height="500" alt="Import screen" / >
Now click Finish. Once the source is imported, you
should see be able to navigate through the project tree in the Navigator
window. If you click on ruby and rhtml files, you will see that they are
opened in their proper editors.
an ERB File
missing from this? Well, a couple of things:
Perhaps someone will
tackle this project, as it seems there's a good foundation already.
- Eclipse doesn't
really understand ERB files. It would be great if the Ruby plugin
understood them, as it would make the syntax highlighting much better.
It would also allow for code completion, etc.
- No documentation.
A real IDE needs to have the Rails documentation embedded and
- WEBRick integration. It would be nice to be able to
stop/start WEBRick from within the IDE.
If you have questions or comments, I'd love to hear them. Leave me a
comment, or email me at \[larry AT approachingnormal.com\]
Mike Clark has a great script to automatically deploy your Ruby on Rails
application to a test server whenever someone commits a change to the
I’m just starting to use svn for my projects, I’m going to have to try
You can read the article yourself here.
Here’s a collection of links useful to web developers and designers:
A website that lets you search for domains that have
recently expired, by keyword.
The title says it all. Lots of good CSS
tips for non-designers
A good set of tips here, particularly
for those of us who aren't blessed with the gift of design sense.
There's an awful lot of good stuff on
web service has been available for a few short hours, and already
O’Reilly has started using it on their
Blog. They’ve devised a nifty way of tying together content on their
public backpack pages, with the Amazon API in order to produce their
page. This reminds me a lot of shell scripting on a *nix system, tying
together applications to build something new.
Very cool stuff.
Obie Fernandez of ThoughtWorks put together a great presentation on Ruby
on Rails for the Agile Atlanta group. It does a good job of covering all
of the things that make Rails great.
See for yourself
(via Curt Hibbs post to the rails mailing list)