I''m on MAC OSX and I set up my environment as described here:
http://hivelogic.com/narrative/articles/ruby_rails_lighttpd_mysql_tiger?status=301
This may be too old and I just realized that, but before I attempt
Building Ruby, Rails, Subversion, Mongrel, and MySQL on Mac OS X:
http://hivelogic.com/narrative/articles/ruby-rails-mongrel-mysql-osx
Okay, I purchased a book "Rails Solutions: Ruby on Rails Made Easy"
and
I''m following along w/ the tutorial.
I do not understand this thing at all... I''m 100% sure I''m
doing
everything right, except I still get this error. Perhaps I need to
update my setup?
Here''s what I do:
1. rails railslist
2. cd railslist
3. ruby script/server
4. Setup my Databases in Cocoa MySQL (localhost, root, password)
5. Update database.yml file w/ password (localhost and root are already
set by default)
6. ruby script/generate model Classified
7. Update 001_create_classifieds.rb migration file w/
<code>class CreateClassifieds < ActiveRecord::Migration
def self.up
create_table :classifieds do |t|
t.column :title, :string
t.column :price, :float
t.column :location, :string
t.column :description, :text
t.column :email, :string
t.column :created_at, :timestamp
t.column :updated_at, :timestamp
end
end
def self.down
drop_table :classifieds
end
end</code>
8. rake migrate -- check to see tables have been made in Cocoa
(success!)
9. ruby script/generate controller Classified
10. Update classified_controller.rb file w/
<code>class ClassifiedController < ApplicationController
def list
@classifieds = Classified.find(:all)
end
def show
@classified = Classified.find(params[:id])
end
def new
end
def create
end
def edit
end
def update
end
def delete
end
end</code>
11. Point page to <a
href="http://localhost:3000/classified/list">http://localhost:3000/classified/list</a>
12. ERROR #28000Access denied for user
''root''@''localhost'' (using
password: NO)
I don''t get it, if rake can setup the tables then the rails must be
communicating fine w/ MySQL ??
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
On 11-Mar-07, at 7:20 PM, Riot wrote:> > I''m on MAC OSX and I set up my environment as described here: >> 10. Update classified_controller.rb file w/ >> I don''t get it, if rake can setup the tables then the rails must be > communicating fine w/ MySQL ?? > > --Get Riot. I think the mysql error is a red herring - as you said the migration worked ok. Do you have a model for Classified? class Classified < ActiveRecord::Base end as well the controller is generally pluralized (classifieds_controller.rb), although this isn''t likely causing this problem. If the above don''t help, check log/development.log - it will likely have more symptoms. cheers, Jodi --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Riot wrote:> I''m on MAC OSX and I set up my environment as described here: > > http://hivelogic.com/narrative/articles/ruby_rails_lighttpd_mysql_tiger?status=301 > > This may be too old and I just realized that, but before I attempt > Building Ruby, Rails, Subversion, Mongrel, and MySQL on Mac OS X: > http://hivelogic.com/narrative/articles/ruby-rails-mongrel-mysql-osx > > Okay, I purchased a book "Rails Solutions: Ruby on Rails Made Easy" and > I''m following along w/ the tutorial. > > I do not understand this thing at all... I''m 100% sure I''m doing > everything right, except I still get this error. Perhaps I need to > update my setup? > > Here''s what I do: > > 1. rails railslist > > 2. cd railslist > > 3. ruby script/server > > 4. Setup my Databases in Cocoa MySQL (localhost, root, password) > > 5. Update database.yml file w/ password (localhost and root are already > set by default) > > 6. ruby script/generate model Classified > > 7. Update 001_create_classifieds.rb migration file w/ > > <code>class CreateClassifieds < ActiveRecord::Migration > def self.up > create_table :classifieds do |t| > t.column :title, :string > t.column :price, :float > t.column :location, :string > t.column :description, :text > t.column :email, :string > t.column :created_at, :timestamp > t.column :updated_at, :timestamp > end > end > > def self.down > drop_table :classifieds > end > end</code> > > 8. rake migrate -- check to see tables have been made in Cocoa > (success!) > > 9. ruby script/generate controller Classified > > 10. Update classified_controller.rb file w/ > > <code>class ClassifiedController < ApplicationController > def list > @classifieds = Classified.find(:all) > end > > def show > @classified = Classified.find(params[:id]) > end > > def new > end > > def create > end > > def edit > end > > def update > end > > def delete > end > > end</code> > > 11. Point page to <a > href="http://localhost:3000/classified/list">http://localhost:3000/classified/list</a> > > 12. ERROR #28000Access denied for user ''root''@''localhost'' (using > password: NO) > > > I don''t get it, if rake can setup the tables then the rails must be > communicating fine w/ MySQL ??Shutdown the server. Check your database.yml file and make sure all the environments have a password set and try it again. The "(using password: NO)" implies it''s using the default database.yml setup where root has no password rather than the one you configured. rake runs independent of the having a server running which is why it picked up the database.yml changes. -- Michael Wang --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> > Do you have a model for Classified? > > cheers, > JodiI forgot to list that step! But yes, I did create the model after setting up my databasbe.yml file Thanks for the responses, Michael, I will try what you suggested. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Michael Wang wrote:> Shutdown the server. Check your database.yml file and make sure all the > environments have a password set and try it again. The "(using password: > NO)" > implies it''s using the default database.yml setup where root has no > password > rather than the one you configured. rake runs independent of the having > a > server running which is why it picked up the database.yml changes. > > > -- > Michael WangMichael, I did as you said and I get past that error now! I failed to mention earlier in the day that I had gotten it to work before, but I started getting this problem after I set a password to my ''root'' user -- how can I fix this from now on? Should I update my setup? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Riot wrote:> Michael Wang wrote: >> Shutdown the server. Check your database.yml file and make sure all the >> environments have a password set and try it again. The "(using password: >> NO)" >> implies it''s using the default database.yml setup where root has no >> password >> rather than the one you configured. rake runs independent of the having >> a >> server running which is why it picked up the database.yml changes. > Michael, > > I did as you said and I get past that error now! I failed to mention > earlier in the day that I had gotten it to work before, but I started > getting this problem after I set a password to my ''root'' user -- how can > I fix this from now on? > > Should I update my setup?It should be fixed now. There are a few changes you make to your app while the server is running in development mode that aren''t picked up until you restart the server. E.g. if you change config/environment.rb you need to restart the server for the changes to be seen. -- Michael Wang --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---