0

I setup a new rail application in Netbeans 7.1. Without writing any code, I wanted to see if it just runs but

When clicking run I get errors:

C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/mysql2.rb:2:in `require': 126: The specified module could not be found.   - C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/1.9/mysql2.so (LoadError)
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/mysql2.rb:2:in `<top (required)>'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2.rb:9:in `require'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2.rb:9:in `<top (required)>'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/runtime.rb:68:in `require'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/runtime.rb:66:in `each'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/runtime.rb:66:in `block in require'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/runtime.rb:55:in `each'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/runtime.rb:55:in `require'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler.rb:119:in `require'
    from C:/_PROJECTS/active/Callisto2.0/config/application.rb:7:in `<top (required)>'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/commands.rb:53:in `require'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/commands.rb:53:in `block in <top (required)>'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/commands.rb:50:in `tap'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/commands.rb:50:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

I've installed a few gems it was complaining about through netbeans gem manager but I got stuck at mysql2. Even though I installed mysql and mysql2 gems, it still won't find it.

With little research, it seems i have to do a bundle install, for WEBrick to run/ check dependencies or whatever. Netbeans project has a Bundler context menu with options for check, init, install, show etc.

None of those produce any output in the Output: Bundler window. The Bundler process starts in netbeans processes but then quits after a second. No errors, info or anything.

What do I need to do to get this working. This is a blank Ruby/Rails Application through Netbeans 7.1.

EDIT 1: The error in file: C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/mysql2.rb:2 contains the following lines:

RUBY_VERSION =~ /(\d+.\d+)/
require "mysql2/#{$1}/mysql2"

Nothing Special. I tried changing that to mysql, or just "mysql2", it doesn't work. Errors that client is not initialized when I comment the whole line.

dlite922
  • 1,924
  • 3
  • 24
  • 60

2 Answers2

1

Netbeans stopped supporting rails. See :

Ruby Dropped in Netbeans 7,How to Use it in Netbeans7?

And:

http://noteslog.com/post/netbeans-6-9-1-ruby-1-9-2-rails-3-0-0-mysql-gem-2-8-1/

Community
  • 1
  • 1
Anil
  • 3,899
  • 1
  • 20
  • 28
  • Yes, I added the Ruby and Rails plugin and now Ruby, and Ruby on Rails New Project options show up. Rail envirnoment/platform setup and working. – dlite922 Jun 19 '12 at 16:39
0

Did you get a message that your user is not allowed to install gems?

Then you should try following command in your rails application root folder

bundle install --path vendor/bundle

make sure to have the configurated database.yml in the config folder before running the previous command, or run it again after creating the file.

eeezyy
  • 2,109
  • 1
  • 15
  • 18