Getting my first JRuby Project running

Hi all,

I was trying out JRuby today, and I wanted to get a simple rails app
running. I am using NetBeans as my IDE. I used the wizard to create a
new application and specified connection directly, using mysql as a
database. I was able to generate a model using:

jruby script/generate model table_info…

But when I try to run the migration I get this error message:
Error opening script file:
C:/jruby/rails_projects/RecetaDB/RecetaDB/rake (The s
ystem cannot find the file specified)

Could this be due to an environment config problem? 'Cause I know that
the rake script would definitelyy not be in that folder, even though the
rakefile is. (Note: I also use Ruby O. Click installer version on this
machine).

I didn’t see any commands within netbeans to generate models or
scafolds.

Just a a test, i tried to run the rakefile script from within NetBeans,
and I got a message saying the mysql gem is not installed. But at what
happened when I tried to gem install it:

C:\jruby\bin>jruby gem install mysql
JRuby limited openssl loaded. gem install jruby-openssl for full
support.
http://jruby.kenai.com/pages/JRuby_Builtin_OpenSSL
Building native extensions. This could take a while…
WARNING: JRuby does not support native extensions or the mkmf' library. Check wiki.jruby.org for alternatives. extconf.rb:30: undefined methodwith_config’ for main:Object
(NoMethodError)
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.

C:/jruby/bin/jruby.exe extconf.rb

Gem files will remain installed in
C:/jruby/lib/ruby/gems/1.8/gems/mysql-2.8.1 f
or inspection.
Results logged to
C:/jruby/lib/ruby/gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_
make.out

What could be the matter here?

Hi,

On Thu, Feb 4, 2010 at 9:34 PM, tuti plain [email protected] wrote:

Error opening script file:
C:/jruby/rails_projects/RecetaDB/RecetaDB/rake (The s
ystem cannot find the file specified)

Could this be due to an environment config problem? 'Cause I know that
the rake script would definitelyy not be in that folder, even though the
rakefile is. (Note: I also use Ruby O. Click installer version on this
machine).

I didn’t see any commands within netbeans to generate models or
scafolds.

NetBeans should have these commands, look for the “Generate…”
command in the context menu for the project.

http://netbeans.org/kb/61/ruby/rapid-ruby-weblog.html

Building native extensions. This could take a while…
Gem files will remain installed in
C:/jruby/lib/ruby/gems/1.8/gems/mysql-2.8.1 f
or inspection.
Results logged to
C:/jruby/lib/ruby/gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_
make.out

What could be the matter here?

The mysql gem is a C extension and only works with Ruby. For JRuby,
you need to use the activerecord-jdbcmysql-adapter, which uses JDBC to
connect to the database. “gem install activerecord-jdbcmysql-adapter”
instead.

See also: http://wiki.jruby.org/ActiveRecord-JDBC

/Nick


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs