Can anyone please give the steps(commands) how to connect ruby on rails to MySQl in fedora8. I have installed MySQL and Ruby in my system. Please specify any further installations to be done Reply will be appreciated. -- Posted via http://www.ruby-forum.com/.
Nik Kumar wrote:> Can anyone please give the steps(commands) how to connect ruby on rails > to MySQl in fedora8. > > I have installed MySQL and Ruby in my system. > > Please specify any further installations to be done > > Reply will be appreciated.http://www.google.com/search?q=rails+mysql I''m not sure if it''s the same for all OS, but you can try this: your_app/config/database.yml # SQLite version 3.x # gem install sqlite3-ruby (not necessary on OS X Leopard) development: adapter: mysql database: your_database username: user password: password # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: adapter: mysql database: your_database_test username: user password: password production: adapter: mysql database: your_database_production username: user password: password -- Posted via http://www.ruby-forum.com/.
Install the following gems. 1) Rails 2) MySQL (try sudo gem install mysql -- --with-mysql-config=/usr/bin/ mysql-config if the normal sudo gem install mysql fails) Once both of those are successful, you can configure database.yml to point to a valid schema a try it out. On Jun 15, 3:23 am, Nik Kumar <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Can anyone please give the steps(commands) how to connect ruby on rails > to MySQl in fedora8. > > I have installed MySQL and Ruby in my system. > > Please specify any further installations to be done > > Reply will be appreciated. > -- > Posted viahttp://www.ruby-forum.com/.
Mukund wrote:> Install the following gems. > > 1) Rails > 2) MySQL (try sudo gem install mysql -- --with-mysql-config=/usr/bin/ > mysql-config if the normal sudo gem install mysql fails) > > Once both of those are successful, you can configure database.yml to > point to a valid schema a try it out. > > On Jun 15, 3:23�am, Nik Kumar <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>Thanks to ur reply.. One more question is how to configure database.yml. -- Posted via http://www.ruby-forum.com/.
Le Sa wrote:> Nik Kumar wrote: >> Can anyone please give the steps(commands) how to connect ruby on rails >> to MySQl in fedora8. >> >> I have installed MySQL and Ruby in my system. >> >> Please specify any further installations to be done >> >> Reply will be appreciated. > > http://www.google.com/search?q=rails+mysql > I''m not sure if it''s the same for all OS, but you can try this: > your_app/config/database.yml > > # SQLite version 3.x > # gem install sqlite3-ruby (not necessary on OS X Leopard) > development: > adapter: mysql > database: your_database > username: user > password: password > > # Warning: The database defined as "test" will be erased and > # re-generated from your development database when you run "rake". > # Do not set this db to the same as development or production. > test: > adapter: mysql > database: your_database_test > username: user > password: password > > production: > adapter: mysql > database: your_database_production > username: user > password: passwordI have tried this in my system(fedora 8) and I am getting this error [root@xenhost]# SQLite version 3.x bash: SQLite: command not found [root@xenhost]# gem install sqlite3-ruby Building native extensions. This could take a while... ERROR: Error installing sqlite3-ruby: ERROR: Failed to build gem native extension. /usr/bin/ruby extconf.rb checking for fdatasync() in -lrt... no checking for sqlite3.h... no make make: *** No rule to make target `ruby.h'', needed by `sqlite3_api_wrap.o''. Stop. Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.4 for inspection. Results logged to /usr/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.4/ext/sqlite3_api/gem_make.out -- Posted via http://www.ruby-forum.com/.
NIk, Are all these installed on your pc: *libdbd-sqlite3-ruby sqlite3 libsqlite3-dev libsqlite3-ruby* 2009/6/15 Nik Kumar <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>> > Le Sa wrote: > > Nik Kumar wrote: > >> Can anyone please give the steps(commands) how to connect ruby on rails > >> to MySQl in fedora8. > >> > >> I have installed MySQL and Ruby in my system. > >> > >> Please specify any further installations to be done > >> > >> Reply will be appreciated. > > > > http://www.google.com/search?q=rails+mysql > > I''m not sure if it''s the same for all OS, but you can try this: > > your_app/config/database.yml > > > > # SQLite version 3.x > > # gem install sqlite3-ruby (not necessary on OS X Leopard) > > development: > > adapter: mysql > > database: your_database > > username: user > > password: password > > > > # Warning: The database defined as "test" will be erased and > > # re-generated from your development database when you run "rake". > > # Do not set this db to the same as development or production. > > test: > > adapter: mysql > > database: your_database_test > > username: user > > password: password > > > > production: > > adapter: mysql > > database: your_database_production > > username: user > > password: password > > I have tried this in my system(fedora 8) and I am getting this error > > [root@xenhost]# SQLite version 3.x > bash: SQLite: command not found > [root@xenhost]# gem install sqlite3-ruby > Building native extensions. This could take a while... > ERROR: Error installing sqlite3-ruby: > ERROR: Failed to build gem native extension. > > /usr/bin/ruby extconf.rb > checking for fdatasync() in -lrt... no > checking for sqlite3.h... no > > make > make: *** No rule to make target `ruby.h'', needed by > `sqlite3_api_wrap.o''. Stop. > > > Gem files will remain installed in > /usr/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.4 for inspection. > Results logged to > /usr/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.4/ext/sqlite3_api/gem_make.out > -- > Posted via http://www.ruby-forum.com/. > > > >-- Regards, Amit Kumar Sr. Software Engrr +91 9890654102 +91 9373087399 Blogsite: http://amitbaraik.blog.co.in/ --~--~---------~--~----~------------~-------~--~----~ 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 Mon, Jun 15, 2009 at 2:04 AM, Nik Kumar<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I have tried this in my system(fedora 8) and I am getting this error > > [root@xenhost]# SQLite version 3.x > bash: SQLite: command not found > [root@xenhost]# gem install sqlite3-rubyWhy are you doing this if you want to use MySQL? -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Nik, Le Sa had explained you how to configure the databases.yml. Follow his instructions, but keep in mind that you would have to configure the socket (if your mySQL server have one) and maybe your mySQL host and port. For development and testing environment you should use sqlite but in production you''ll like a more robust database engine. Sample configuration for a production environment: production: adapter: mysql database: your_database_production username: your_mySQL_user password: your_mySQL_password socket: /path/to/your/socket host: /your/mySQL/host (probably localhost) port: your_mySQL_port :) On Jun 15, 11:03 am, Nik Kumar <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Mukund wrote: > > Install the following gems. > > > 1) Rails > > 2) MySQL (try sudo gem install mysql -- --with-mysql-config=/usr/bin/ > > mysql-config if the normal sudo gem install mysql fails) > > > Once both of those are successful, you can configure database.yml to > > point to a valid schema a try it out. > > > On Jun 15, 3:23 am, Nik Kumar <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > > Thanks to ur reply.. > > One more question is how to configure database.yml. > -- > Posted viahttp://www.ruby-forum.com/.
Let''s go back to the beginning here.. First, you said you are using redhat and you said you already have mysql installed and rails installed. In that case you just need to have the gem installed. The gem is the hard part, depending on which "ruby" version you are using. So, try the following first: sudo gem install mysql .. if you get failures installing that gem and you are using ruby 1.9.x .. Do.. sudo gem install hectoregm-mysql-ruby Once any of those gems installs.. test to make sure it works.. Run IRB type require ''mysql'' The output should show => True .... If you get this far then you just need to create your new project and specify that you want to use mysql. You can do this a few ways. First way is if you have a really good IDE (the IDE will do it for you when you create your project (netbeans for example does this). The second way is to specify your database in the database.yml file. development: adapter: mysql encoding: utf8 reconnect: false database: name_of_your_database_here pool: 5 username: root password: host: localhost Then you need to run a rake DB create task to create the database based on the specifications of the database.yml file. rake db:create (which works for the current environment database specified) .. or .. rake db:create:all (which creates all databases specified in database.yml) Hope that helps. -- Posted via http://www.ruby-forum.com/.
Thank u Älphä Blüë I have a doubt please clarify.. How do we know the contents of the database.yml file. does this command is the right one to use $vim /configure/database.yml -- Posted via http://www.ruby-forum.com/.
One more thing I am getting this thing if i go for rake $rake db:migrate rake aborted! No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb) /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2377:in `raw_load_rakefile'' (See full trace by running task with --trace) -- Posted via http://www.ruby-forum.com/.
Nik Kumar wrote in post #826714:> Can anyone please give the steps(commands) how to connect ruby on rails > to MySQl in fedora8. > > I have installed MySQL and Ruby in my system. > > Please specify any further installations to be done > > Reply will be appreciated.Set MySQL from the start $ rails -d mysql app_name -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.