FeaturesPluginsDocs & SupportCommunityPartners

NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

mysql problem with rake db:create JRuby/Vista/Rails 2.2.2

 
Post new topic   Reply to topic    NetBeans Forums -> Ruby Users
View previous topic :: View next topic  
Author Message
Chris Kutler
Posted via mailing list.





PostPosted: Wed Dec 10, 2008 6:50 pm    Post subject: mysql problem with rake db:create JRuby/Vista/Rails 2.2.2 Reply with quote

A user is trying to do the Creating a Ruby Weblog tutorial at
http://www.netbeans.org/kb/docs/ruby/rapid-ruby-weblog.html#05.

When the user does the step create the database (using the Rake runner),
he gets the following output, which makes no sense because JRuby
includes the mysql adapter. Why is Rails complaining? I have tried the
same steps on Windows XP with JRuby 1.1.4 (the one bundled with the
IDE), Rails 2.2.2 and Ruby Gems 1.3.1 and I do not see this problem.

Can anyone guess what might be causing this?

Here is the database.yml file

development:
adapter: mysql
encoding: utf8
database: rubyweblog_development
pool: 5
username: root
password: *****
host: localhost

Here is the error

(in C:/Users/admin/Documents/NetBeansProjects/rubyweblog)
** Invoke db:create:all (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:create:all
!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please
install the mysql gem and try again: gem install mysql.
rake aborted!
no such file to load -- mysql
C:/Program Files/NetBeans
6.5/ruby2/jruby-1.1.4/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/mysql_adapter.rb:66:in
`mysql_connection'
C:/Program Files/NetBeans
6.5/ruby2/jruby-1.1.4/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in
`new_connection'
C:/Program Files/NetBeans
6.5/ruby2/jruby-1.1.4/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:245:in
`checkout_new_connection'
C:/Program Files/NetBeans
6.5/ruby2/jruby-1.1.4/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:188:in
`checkout'
C:/Program Files/NetBeans
6.5/ruby2/jruby-1.1.4/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in
`loop'
C:/Program Files/NetBeans
6.5/ruby2/jruby-1.1.4/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in
`checkout'
C:/Program Files/NetBeans
6.5/ruby2/jruby-1.1.4/lib/ruby/1.8/monitor.rb:191:in `mon_synchronize'
C:/Program Files/NetBeans
6.5/ruby2/jruby-1.1.4/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:183:in
`checkout'
C:/Program Files/NetBeans
6.5/ruby2/jruby-1.1.4/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:98:in
`connection'
C:/Program Files/NetBeans
6.5/ruby2/jruby-1.1.4/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:in
`retrieve_connection'
C:/Program Files/NetBeans
6.5/ruby2/jruby-1.1.4/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:121:in
`retrieve_connection'
C:/Program Files/NetBeans
6.5/ruby2/jruby-1.1.4/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:113:in
`connection'
C:/Program Files/NetBeans
6.5/ruby2/jruby-1.1.4/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/tasks/databases.rake:47:in
`create_database'
C:/Program Files/NetBeans
6.5/ruby2/jruby-1.1.4/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/tasks/databases.rake:19
C:/Program Files/NetBeans
6.5/ruby2/jruby-1.1.4/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/tasks/databases.rake:101:in
`local_database?'
C:/Program Files/NetBeans
6.5/ruby2/jruby-1.1.4/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/tasks/databases.rake:19
C:/Program Files/NetBeans
6.5/ruby2/jruby-1.1.4/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/tasks/databases.rake:5:in
`each_value'
C:/Program Files/NetBeans
6.5/ruby2/jruby-1.1.4/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/tasks/databases.rake:5
C:/Program Files/NetBeans
6.5/ruby2/jruby-1.1.4/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in
`call'
C:/Program Files/NetBeans
6.5/ruby2/jruby-1.1.4/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in
`execute'
C:/Program Files/NetBeans
6.5/ruby2/jruby-1.1.4/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in
`each'
C:/Program Files/NetBeans
6.5/ruby2/jruby-1.1.4/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in
`execute'
C:/Program Files/NetBeans
6.5/ruby2/jruby-1.1.4/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:578:in
`invoke_with_call_chain'
C:/Program Files/NetBeans
6.5/ruby2/jruby-1.1.4/lib/ruby/1.8/monitor.rb:191:in `mon_synchronize'
C:/Program Files/NetBeans
6.5/ruby2/jruby-1.1.4/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in
`invoke_with_call_chain'
C:/Program Files/NetBeans
6.5/ruby2/jruby-1.1.4/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:564:in
`invoke'
C:/Program Files/NetBeans
6.5/ruby2/jruby-1.1.4/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2019:in
`invoke_task'
C:/Program Files/NetBeans
6.5/ruby2/jruby-1.1.4/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in
`top_level'
C:/Program Files/NetBeans
6.5/ruby2/jruby-1.1.4/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in
`each'
C:/Program Files/NetBeans
6.5/ruby2/jruby-1.1.4/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in
`top_level'
C:/Program Files/NetBeans
6.5/ruby2/jruby-1.1.4/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in
`standard_exception_handling'
C:/Program Files/NetBeans
6.5/ruby2/jruby-1.1.4/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1991:in
`top_level'
C:/Program Files/NetBeans
6.5/ruby2/jruby-1.1.4/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1970:in
`run'
C:/Program Files/NetBeans
6.5/ruby2/jruby-1.1.4/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in
`standard_exception_handling'
C:/Program Files/NetBeans
6.5/ruby2/jruby-1.1.4/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1967:in
`run'
C:/Program Files/NetBeans
6.5/ruby2/jruby-1.1.4/lib/ruby/gems/1.8/gems/rake-0.8.3/bin/rake:31
C:/Program Files/NetBeans
6.5/ruby2/jruby-1.1.4/lib/ruby/gems/1.8/gems/rake-0.8.3/bin/rake:19:in
`load'
C:\Program Files\NetBeans 6.5\ruby2\jruby-1.1.4\bin\rake:19
Back to top
Nick Sieger
Posted via mailing list.





PostPosted: Wed Dec 10, 2008 8:19 pm    Post subject: mysql problem with rake db:create JRuby/Vista/Rails 2.2.2 Reply with quote

On Wed, Dec 10, 2008 at 12:50 PM, Chris Kutler <address-removed> wrote:
Quote:
A user is trying to do the Creating a Ruby Weblog tutorial at
http://www.netbeans.org/kb/docs/ruby/rapid-ruby-weblog.html#05.

When the user does the step create the database (using the Rake runner), he
gets the following output, which makes no sense because JRuby includes the
mysql adapter. Why is Rails complaining? I have tried the same steps on
Windows XP with JRuby 1.1.4 (the one bundled with the IDE), Rails 2.2.2 and
Ruby Gems 1.3.1 and I do not see this problem.

Can anyone guess what might be causing this?

Here is the database.yml file

development:
adapter: mysql
adapter: jdbcmysql

Without any tweaks to config/environment.rb, this is the only way to
use the JDBC driver with JRuby.

/Nick
Back to top
Chris Kutler
Posted via mailing list.





PostPosted: Wed Dec 10, 2008 8:55 pm    Post subject: mysql problem with rake db:create JRuby/Vista/Rails 2.2.2 Reply with quote

Nick,

I have to disagree with you. I often use the adapter: mysql setting with my bundled 1.1.4 JRuby apps without any reconfiguring. JRuby has an mysql adapter in it, or at least it has in the past. On XP, I use the NetBeans new project wizard, fill out the info in the first page (including selecting the bundled JRuby platform) in the wizard and click Finish.

The IDE builds my database.yml file with this entry

development:
adapter: mysql
encoding: utf8
database: RailsApplication6_development
username: root
password:
host: localhost

I just have to put in my password and then open the Rake runner and choose db:create. The database is created without complaint (unlike with the user problem I reported earlier). You can install the mysql adapter gem and go the route you mentioned, but you can also use the built in mysql adapter too (or at least that is the way it used to be).

Nick Sieger wrote:
Quote:
Quote:
On Wed, Dec 10, 2008 at 12:50 PM, Chris Kutler <address-removed> ([email]address-removed[/email]) wrote:
Quote:
A user is trying to do the Creating a Ruby Weblog tutorial at
http://www.netbeans.org/kb/docs/ruby/rapid-ruby-weblog.html#05.

When the user does the step create the database (using the Rake runner), he
gets the following output, which makes no sense because JRuby includes the
mysql adapter. Why is Rails complaining? I have tried the same steps on
Windows XP with JRuby 1.1.4 (the one bundled with the IDE), Rails 2.2.2 and
Ruby Gems 1.3.1 and I do not see this problem.

Can anyone guess what might be causing this?

Here is the database.yml file

development:
adapter: mysql
adapter: jdbcmysql

Without any tweaks to config/environment.rb, this is the only way to
use the JDBC driver with JRuby.

/Nick


([email]address-removed[/email])
([email]address-removed[/email])

Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Ruby Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB