This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 104423 - jruby scaffold generator does not work
Summary: jruby scaffold generator does not work
Status: RESOLVED WONTFIX
Alias: None
Product: ruby
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Torbjorn Norbye
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-21 16:35 UTC by Tomas Danek
Modified: 2007-07-03 14:37 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Danek 2007-05-21 16:35:03 UTC
NetBeans IDE Dev (Build 070518)
1.6.0; Java HotSpot(TM) Client VM 1.6.0-b105
Linux version 2.6.20-15-generic running on i386
en_US (nb); UTF-8
- ubuntu linux
- mysql 5.0 db
----------------------------------------------
1) start with fresh userdir
2) create rails app
3) edit database.yml prooperly to setup your db
4) generate scaffold - controller=hello, model=post (assuming there's posts
table in your db)
5) in jruby, i get following output -
      exists  app/controllers/
      exists  app/helpers/
      create  app/views/hello
      exists  app/views/layouts/
      exists  test/functional/
  dependency  model
      exists    app/models/
      exists    test/unit/
      exists    test/fixtures/
      create    app/models/post.rb
      create    test/unit/post_test.rb
      create    test/fixtures/posts.yml
can't convert nil into String 

- notice that controller is not created!!
- when i switch to native ruby, scaffold with the same params is generated ok.

Anyone else noticed this? Is this bug known in jruby? with this build is bundled
1.0.0 rc2...
Comment 1 Torbjorn Norbye 2007-05-21 17:43:00 UTC
What does your database registration look like in config/database.yml? Do you have a "socket" entry there? 
I seem to remember mkrauskopf having a similar problem; this has to do with some activerecord stuff 
JRuby doesn't understand.
Comment 2 Martin Krauskopf 2007-05-22 08:37:20 UTC
I'm not sure whether this is the same problem. But you could do the same from
the command line to find out whether it JRuby or NB specific. NB just calls the
"script/generate scaffold <params>" AFAIK.
Comment 3 Tomas Danek 2007-05-22 12:40:04 UTC
the only thing that is unusual in my db config is empty root password..

development:
  adapter: mysql
  database: pokus
  username: root
  password:
  socket: /var/run/mysqld/mysqld.sock

as i mentioned, scaffold generator works when i switch to the native ruby (and
also after running project, db can be accessed without any problem).

this really seems like problem in jruby itself:
tomas@pchytil-ws:~/NetBeansProjects/RailsApplication27$ jrubynb script/generate
scaffold post hello
      exists  app/controllers/
      exists  app/helpers/
      create  app/views/hello
      exists  app/views/layouts/
      exists  test/functional/
  dependency  model
      exists    app/models/
      exists    test/unit/
      exists    test/fixtures/
      create    app/models/post.rb
      create    test/unit/post_test.rb
      create    test/fixtures/posts.yml
can't convert nil into String


while using native ruby gives 

tomas@pchytil-ws:~/NetBeansProjects/RailsApplication27$ ruby script/generate
scaffold post hello
      exists  app/controllers/
      exists  app/helpers/
      exists  app/views/hello
      exists  app/views/layouts/
      exists  test/functional/
  dependency  model
      exists    app/models/
      exists    test/unit/
      exists    test/fixtures/
   identical    app/models/post.rb
   identical    test/unit/post_test.rb
   identical    test/fixtures/posts.yml
      create  app/views/hello/_form.rhtml
      create  app/views/hello/list.rhtml
      create  app/views/hello/show.rhtml
      create  app/views/hello/new.rhtml
      create  app/views/hello/edit.rhtml
      create  app/controllers/hello_controller.rb
      create  test/functional/hello_controller_test.rb
      create  app/helpers/hello_helper.rb
      create  app/views/layouts/hello.rhtml
      create  public/stylesheets/scaffold.css
Comment 4 Tomas Danek 2007-05-22 13:22:24 UTC
filed a bug against jruby 1.0.0 rc2

http://jira.codehaus.org/browse/JRUBY-973
Comment 5 Torbjorn Norbye 2007-05-22 14:20:16 UTC
"the only thing that is unusual in my db config is empty root password":  No, that shouldn't be a problem, 
but in looking at your database.yml file, I see that the answer to my question yesterday ("What does your 
database registration look like in config/database.yml? Do you have a "socket" entry there?") is Yes.

That's likely the problem. Martin had the same issue.  JRuby has difficulty handling this:
  socket: /var/run/mysqld/mysqld.sock
Comment 6 Torbjorn Norbye 2007-05-22 21:56:56 UTC
Closing as will not fix since this is a bug or limitation of JRuby, and I don't think we should have place 
holder bugs for JRuby issues here.
Comment 7 Jiri Kovalsky 2007-07-03 14:08:32 UTC
Reassigning this issue to newly created 'ruby' component.
Comment 8 Jiri Kovalsky 2007-07-03 14:37:14 UTC
Changing target milestone of all resolved Ruby issues from TBD to 6.0 Beta 1 build.