Posted by Nick Sieger
Mon, 30 Aug 2010 17:12:07 GMT
I’m pleased to be able to return to Oslo for JavaZone 2010. Whether you’re checking out JRuby for the first time or a veteran JRuby user, I’ll have something for you! And if I don’t, I encourage you to come badger me after the talk is finished.
Additionally, if you’re interested in meeting up for some JRuby discussion next week in Oslo, do drop me a note at the address in the upper right.
Tags javazone, jruby | no comments
Posted by Nick Sieger
Mon, 30 Aug 2010 17:06:52 GMT
I am pleased that my Engine Yard webinar on JRuby and deployment is available for general viewing. While the JRuby deployment story is still evolving and maturing, and the 60 minute time frame is too short to cover the issues in depth, I hope you’ll find the content at least gives you some ideas or directions to look.
As always, feel free to contact me with any questions!
Deploying, Monitoring and Troubleshooting Rails on the JVM with JRuby from Engine Yard on Vimeo.
Tags jruby, rails | no comments
Posted by Nick Sieger
Sat, 10 Apr 2010 16:40:00 GMT
I was Paul Gonsalves in the shower this morning. Most people sing in the shower, but when I get going I play air sax. For a fleeting moment I felt like I was blowing with the Ellington band at Newport in 1956. The way obscure things flow in and out of consciousness is a weird thing.
If you haven’t checked out the 1956 Ellington at Newport live recording of Diminuendo and Crescendo in Blue, you really should. I hadn’t heard the recording for years until my lovely wife put it on a great jazz mix playlist that we listened to on the road last weekend. The recording is completely infectious; my foot was tapping within a few moments of the start of the song. The Newport concert is infamous in Jazz lore -- Gonsalves blew 27 choruses and put the crowd into a frenzy. The great thing about the recording, even though it’s a little bit scratchy, is that you can hear and feel the energy of the crowd coming through. Although it’s probably a bit hyperbolic, some Jazz writers claim that Gonsalves single-handedly revived Ellington’s career that day.
Why was my mind in that state at that moment? I wish I knew. The mystery of heightened awareness that is flow is an elusive quality. At lunch at RubyNation yesterday a discussion arose of just how rare it is to attain that awareness. Glenn Vanderburg described how only a few times in his double-digit year career as a conference speaker has he felt like he has had that hyper-aware state, where he was receiving feedback from the crowd during a talk and able to adjust mid-stream and feel completely on. The difference of timing and how that affects an audience’s response is striking. The difference between being on and having a joke or a point fall flat is incredibly sensitive, as any performance artist will tell you. Just to think about it gives me a newfound respect for stand-up comedians, where timing is so crucial.
I myself haven’t quite felt that heightened state while delivering a conference talk, but I have felt it while playing jazz. Still, it has happened only once or twice in my life. If you’ve felt that flow, you know rare it is and how you absolutely cannot manufacture it at will. The feeling is such a high that I suspect it leaves artists, performers, and creative types feeling unfulfilled and half-desperately searching for it for the rest of their careers.
I’m not very well read in this area, but I’d like to learn more. Any suggestions for reading material?
I tend to stew on these things for a while but fail to put together a coherent, digestible conclusion, I thought I’d at least write something up, get it out there, and start a conversation. When have you felt that flow, and have you noticed how you get into it?
Other tangential thoughts swirling around in my head:
- Is flow related to a search for perfection? Instead, should we coach ourselves to cope with life’s imperfections? Dave Thomas gave his “Ruby sucks” talk last night at RubyNation and eloquently made the point that Ruby is not perfect, and that’s what makes it great. I’ve struggled with not settling for less than perfect and it ends up usually being more detrimental to my production than anything else.
- Why Americans Don’t Like Jazz. Have we lost an appreciation for things we can’t put to words?
Tags flow, life | no comments
Posted by Nick Sieger
Tue, 06 Apr 2010 17:11:17 GMT
It’s past due time to “carry the 1” over and roll over to a 1.0 version of Warbler. This time around, the changes in the codebase are significant enough that I hope you’ll find many past usability issues resolved.
Assemble in-place
The biggest change is that Warbler now creates a war file in place, without an intermediate copy-to-assemble step. Warbler does this using the rubyzip gem, or alternatively using a small Java extension when run under JRuby 1.5 or greater. This should reduce processing and confusion due to the extra copy, which can sometimes get out of sync. The downside is that Warbler cannot be used easily for exploded directory development, though you can always create the war file and unpack it to a staging area.
Simpler extension
Warbler also underwent an internal refactoring that should make extending it much easier. Here’s how you add Warbler tasks to your Rakefile:
require 'warbler'
Warbler::Task.new
In versions prior to 1.0, if there were deploy steps that created new files that didn’t exist at the time the Rakefile was loaded (such as what the asset:packager:build_all task does in the asset_packager plugin), it was tricky to get Warbler to recognize them. No longer -- now the expected Rake configuration should do the trick.
require 'warbler'
Warbler::Task.new
task :war => "asset:packager:build_all"
Bundler support
Another exciting development in the Ruby development world is Bundler, and Warbler 1.0 supports packaging your bundled gems with it. Warbler even creates a .bundle/environment.rb file inside the war file that loads the gems from relative paths to where Warbler puts the gems in the war file.
More configuration
There are a number of new configuration options, so check out the new configuration and see if any are useful to you.
config.gem_home allows you to control the path inside the war file where Warbler will pack your application’s gems. For use with older versions of Bundler or other custom gem vendoring schemes.
config.webinf_files is a file list that can contain multiple files, XML or otherwise. If the files named in this list have .erb extensions, they will be expanded in the same manner as web.xml.
Rails 3 support
JRuby-Rack, the servlet adapter component bundled by Warbler, also received a version bump, and there are no longer any Java libraries included in the Warbler gem, so the two components can be versioned independently. With the release of both Warbler 1.0 and JRuby-Rack 0.9.7, Rails 3 applications can be warbled and deployed seamlessly, often without any additional configuration.
Please continue to send feedback to the JRuby mailing list or the Warbler bug tracker. Enjoy!
Tags jruby, warbler | 2 comments
Posted by Nick Sieger
Fri, 12 Mar 2010 23:21:04 GMT
I’m honored to be heading to the first ever RubyConf India in Bangalore next week. I’ll be delivering an update on Rails 3, JRuby, and what’s in store for the future of the combined platform in 2010. I’m looking forward to meeting you there!

Tags ruby, rubyconf, rubyconfindia | 2 comments
Posted by Nick Sieger
Thu, 11 Mar 2010 20:25:51 GMT
Ask ten geeks who their favorite domain registrar is, and you’ll get ten answers -- though I doubt GoDaddy would be one of them. Their heavily-ad-filled, upselling, confusing site makes even the most patient webmaster’s skin crawl, and don’t even get me started about their embarrassingly titillating Super Bowl tease ads.
Along those lines, there seems to be a fair amount of myth around GoDaddy inertia. While not what I’d describe as a pleasant experience, it is possible to extricate yourself from GoDaddy. Here’s the process I took, which took maybe an hour start-to-finish. Maybe I just got lucky and hit the right buttons, so YMMV.
I decided to go with Dynadot as my new registrar based on reasonable prices, some good words from other hackers, available features such as email forwarding (so I don’t have to maintain a Postfix server), and a clean-looking site. So far I have not been disappointed -- the account panel is straightforward and easy to use, the purchase process is quick, and I haven’t had any hiccups with the transfer.
So herewith are the steps I took:
- Prepare the GoDaddy domains for transfer.
- Make sure you don’t change the Organization or First/Last Name in any of your domain contact fields! It appears that GoDaddy will put a 60-day lock on your domain if you do so.
- Cancel any Domains by Proxy private registration. The new registrar needs to be able to fetch an email address from WHOIS that’s under your control.
- Make sure the domains are unlocked. You can do this in the Domain Manager by selecting the domains to transfer and clicking the “Lock” icon, and selecting to unlock them in following dialogs.
- Get an authorization code for each domain you wish to transfer. To do this, you have to visit each individual domain in the Domain Manager, and click the link to send the code via email. You should have the codes within 10 minutes.
- Initiate a transfer or bulk transfer, specify the authorization codes for each domain, and check out.
- Within another 10 minutes Dynadot initiates the transfer by sending email to the address in the WHOIS record for each domain.
- In the email, click on a link back to Dynadot and authorize each transfer.
- Within another 10 minutes Dynadot contacts GoDaddy and initiates the transfer.
- Receive an email from GoDaddy that they acknowledged the transfer.
- To speed up the transfer process, go back into the Domain Manager one last time. Under the “Domains” hover menu, look for the “Pending Transfers” item.
- See the domains listed in the Pending Transfer queue. Select all and click the “Accept/Deny” button, select “Accept” in the prompt.
- Within another 10-20 minutes, receive confirmation from Dynadot that the transfer has been completed. You can now go into the Dynadot panel and manage your DNS and other settings.
- Apparently you can’t fully cancel your GoDaddy account, but you can remove all payment methods, services and turn off email notifications.
Bask in the glory that is your renewed life as a website operator!
7 comments
Posted by Nick Sieger
Wed, 24 Feb 2010 03:58:00 GMT
Synopsis
jruby -S rails new myapp -m http://jruby.org/rails3.rb
When creating your Rails 3 application, just add the JRuby-specific template (-m http://jruby.org/rails3.rb).
Details
$ jruby -S gem install rails --pre --no-rdoc --no-ri
Due to a rubygems bug, you must uninstall all older versions of bundler for 0.9 to work
Successfully installed i18n-0.3.3
Successfully installed tzinfo-0.3.16
Successfully installed builder-2.1.2
Successfully installed memcache-client-1.7.8
Successfully installed activesupport-3.0.0.beta
Successfully installed activemodel-3.0.0.beta
Successfully installed rack-1.1.0
Successfully installed rack-test-0.5.3
Successfully installed rack-mount-0.4.7
Successfully installed abstract-1.0.0
Successfully installed erubis-2.6.5
Successfully installed actionpack-3.0.0.beta
Successfully installed arel-0.2.1
Successfully installed activerecord-3.0.0.beta
Successfully installed activeresource-3.0.0.beta
Successfully installed mime-types-1.16
Successfully installed mail-2.1.3
Successfully installed text-hyphen-1.0.0
Successfully installed text-format-1.0.0
Successfully installed actionmailer-3.0.0.beta
Successfully installed thor-0.13.3
Successfully installed railties-3.0.0.beta
Successfully installed bundler-0.9.7
Successfully installed rails-3.0.0.beta
24 gems installed
And:
$ jruby -S gem install activerecord-jdbcsqlite3-adapter --no-rdoc --no-ri
Successfully installed activerecord-jdbc-adapter-0.9.3-java
Successfully installed jdbc-sqlite3-3.6.3.054
Successfully installed activerecord-jdbcsqlite3-adapter-0.9.3-java
3 gems installed
Finally:
$ jruby -S rails new myapp -m http://jruby.org/rails3.rb
create
...(app creation)...
apply http://jruby.org/rails3.rb
apply http://jruby.org/templates/default.rb
gsub Gemfile
run jruby script/rails generate jdbc from "."
...(warnings omitted)...
exist
create config/initializers/jdbc.rb
create lib/tasks/jdbc.rake
$ cd myapp
$ jruby script/rails server
...(warnings omitted)...
=> Booting WEBrick
=> Rails 3.0.0.beta application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2010-02-23 19:44:26] INFO WEBrick 1.3.1
[2010-02-23 19:44:26] INFO ruby 1.8.7 (2010-02-23) [java]
[2010-02-23 19:44:26] INFO WEBrick::HTTPServer#start: pid=16449 port=3000

Recap
You’ll have best results with JRuby 1.5 snapshots, which include RubyGems 1.3.6. JRuby 1.5 final is coming soon. Also, the new activerecord-jdbc-adapter 0.9.3 release is required for Rails 3 compatibility.
The Rails experience on JRuby continues to get better.
Tags jruby, rails | no comments
Posted by Nick Sieger
Thu, 28 Jan 2010 15:16:49 GMT
I got a note from a community member about an annoying problem that a few people have run into when installing activerecord-jdbc-adapter (AR-JDBC) into a C Ruby implementation:
NameError: uninitialized constant
ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::PGconn
Turns out it’s pretty easy to momentarily forget to use jruby -S gem or jgem and just gem install activerecord-jdbc-adapter and suddenly your pg Postgres gems are not working properly. I thought it was worth documenting here in case others run into this problem.
I apologize for the clash. I had to provide a stub pg.rb in AR-JDBC inside of JRuby so that I could get active_record/connection_adapters/postgresql_adapter.rb to load with a database adapter type of postgresql. Because of load path order issues, I couldn’t get AR-JDBC’s code to load before ActiveRecord’s. At the time I was thinking this wouldn’t be a problem because the pg library won’t work on JRuby anyway, right? Wrong.
I can think of a couple options going forward:
- Submit a patch to ActiveRecord so that
active_record/connection_adapters/postgresql_adapter.rb can load without requiring pg up front and then AR-JDBC won’t have to stub it out.
- Display a big fat warning message when AR-JDBC is installed into anything other than JRuby.
Any other thoughts?
Tags jruby, ruby | 2 comments
Posted by Nick Sieger
Fri, 06 Nov 2009 16:06:37 GMT
It’s with a modicum of fanfare and a cocktail of orange peel, maraschino, bitters, bourbon and vermouth that I announce the 0.8.2 release of Hpricot.

The angly thingies are just two martini glasses turned on their side, see? Pouring out hpricoty goodness for you. (I don’t know if _why imbibed alcoholic beverages but I feel the desire to raise a glass to him.)
This release is mostly a refresh; the previous release was way back in April. From the Git logs I can see that there were a few bug fixes since then. Otherwise, the main addition is a modern JRuby release, thanks to Ola Bini. (the previous was the 0.6 series). This does fix a fairly old, popular JRuby bug.
As for the future of Hpricot, it’s up to you. I know it’s still a trusty tool for many; I have no grand plans to change it. So if you encounter bugs and want to send patches, I’m happy to serve as your curator.
Tags hpricot, jruby, rails, ruby | 2 comments
Posted by Nick Sieger
Mon, 12 Oct 2009 18:30:45 GMT
As announced last week on the jruby-user list, 0.9.2, the latest activerecord-jdbc-adapter release, has been pushed out. Please install the gem in the usual fashion and try it out on your applications.
One of the most contentious bugs broke db:create and db:drop, ruining the quick-start workflow that Rails is known for. To fix this, a creative solution was needed that ended up bringing some nice benefits.
The problem stemmed from the fact that some database setup tasks in Rails 2.3 no longer load the environment; instead they just load the configuration data and work with that. This means that there is no easy way to hook into Rails and override those tasks, which is what activerecord-jdbc needs to do.
The solution I ended up with was to create a jdbc Rails generator that inserts a couple files into your rails application that inject the JDBC logic into ActiveRecord and the database rake tasks. To wit:
$ jruby script/generate jdbc
exists config/initializers
create config/initializers/jdbc.rb
exists lib/tasks
create lib/tasks/jdbc.rake
The upside of this new technique is that now that we have a way to ensure the JDBC adapter is properly injected into Rails, and you no longer need to use adapter names like jdbcmysql, jdbcsqlite3 and the like. The net result is that database.yml no longer needs to be modified for the default Rails databases (mysql, sqlite3, postgresql). So while we introduced one additional step in the process to bootstrap a Rails application under JRuby, the removal the step where database.yml needs to be modified results in a more predictable workflow.
The new JRuby-specific Rails workflow looks like the following, assuming you’ve installed the activerecord-jdbc-adapter gem into JRuby, along with the appropriate database driver gem (e.g, jdbc-mysql). (Of course, the gems only need to be installed once per JRuby installation.)
- Create your Rails application as usual.
- Run the
jdbc generator as shown above.
- Profit!
Additionally, if you maintain a Rails application template that you use to start a new application, you can simply add generate(:jdbc) to that template’s script.
What’s more, the presence of the JDBC files in your application are guarded and only inject JDBC support when running under JRuby, so you can safely keep them around when running Rails under multiple Ruby implementations.
For more details of what’s in the release please consult the mini-changelog on Rubyforge and the list of fixed issues in JIRA.
Tags activerecord, jdbc, jruby | 9 comments