Net Beans IDE 6.x Ruby Depot sample App mysql and ApplicationController errors
How to get the stupid Depot Sample App working in Netbeans IDE 6.x
[If you are on Linux then open a bash prompt and]
1) Turn on the mysql server (in redhat it is: service mysqld start)
2) Create the databases
mysqladmin create depot_development
mysqladmin create depot_test
mysqladmin create depot_production
-------------------------------------------
Now fix problems:
[mysql error]
!!! 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
1) edit the Configuration->database.yml and change
adapter: mysql
to
adapter: jdbcmysql
2) you may need to load the (activerecord jdbcmysql adapter) gem
[In linux, open bash prompt or windows commpand prompt]
(For windows users, use backslash instead of forward slash)
find jruby
[original install path to netbeans-6.?]/ruby2/jruby-1.2.0/bin/
./jruby gem install activerecord-jdbcmysql-adapter
your migrate command should now work.
Right-click on Depot Application->Migrate Database->To Current Version
3) When running the application, you may get
NameError in StoreController#index
uninitialized constant ApplicationController
This is because Controllers->application.rb should have been named
Controllers->application_controller.rb
If you look in application.rb, you will see that
the class is actually ApplicationController
Rename it to application_controller.rb
(In Ruby, Camel case classes have file names in lower case
with underscores delineating the camel position.)
Now everything should work :)
Lee Lofgren
Accounting Enhancements, inc
Last Modified 05/22/2009