08 May 2013, 15:25
Generic-user-small

Owen Murphy (11 posts)

“1.3 Preparing Twitalytics for JRuby” (8)

The text suggests changing

platform :ruby do
  gem 'therubyracer'
end

with

platform :jruby do
  gem 'therubyrhino'
end

in the Gemfile. However, the original Gemfile includes version numbers for the MRI gems, and the text does not instruct the reader to remove the version numbers when changing to a JRuby gem. The original block looks like this:

# START:therubyracer
platform :ruby do
  gem 'therubyracer', '0.9.10'
end
# END:therubyracer

and should be changed to

# START:therubyrhino
platform :jruby do
  gem 'therubyrhino'
end
# END:therubyrhino

Similarly the version number should be dropped when changing from a sqlite3 MRI gem to a jdbc-sqlite3 JRuby gem, and from the pg gem to the jdbc-postgres gem.

08 May 2013, 15:33
Generic-user-small

Owen Murphy (11 posts)

The text also suggests running

$ bundler install --without production

after having switched from therubyracer MRI gem to therubyrhino JRuby gem. But this will still fail because of the sqlite3 gem failing (at this point the jdbc drivers have not been sub’ed in), and the rhino interpreter will not be installed if the sqlite3 error is hit first. This install step should be postponed until after the jdbc dependencies have been put in place.

13 May 2013, 12:37
Jruby-conf-profile-mug_pragsmall

Joe Kutner (80 posts)

Sorry for the confusion. The code examples in the book are slightly out of sync with the provided source code because the latter has been updated, but the book text has not. I’m not sure why you’re seeing the sqlite3 build error. It isn’t expected.

06 Jan 2014, 01:43
Generic-user-small

Trevor Menagh (8 posts)

It took me a bit to get this part up and working with JRuby 1.7.9 and the latest jrlint.

I posted my diff to get it working on Github.

I hope this helps others!

  You must be logged in to comment