15 Replies - 695 Views - Last Post: 17 May 2011 - 07:54 PM
#1
Server: rails
Posted 15 May 2011 - 11:00 AM
Replies To: Server: rails
#2
Re: Server: rails
Posted 15 May 2011 - 11:12 AM
If you're just wanting to test or dev, Rails works out of the box with WEBrick.
#3
Re: Server: rails
Posted 15 May 2011 - 11:17 AM
nimajneb, on 15 May 2011 - 11:12 AM, said:
If you're just wanting to test or dev, Rails works out of the box with WEBrick.
Alright thank you now i have one more question in my database.yml file it says its using sqlite3 is it possible for me to configure it to use MySQL and if so could you show me how? Sorry litterally my first day with rails and a week into ruby currently
#4
Re: Server: rails
Posted 15 May 2011 - 11:41 AM
sudo gem install mysql
then make sure you add it to your gemfile:
gem 'mysql'
your database.yml should look something like this:
development: adapter: mysql database: rails_dev username: root password: your password
That's the quick and dirty way.
#5
Re: Server: rails
Posted 15 May 2011 - 11:43 AM
nimajneb, on 15 May 2011 - 11:41 AM, said:
sudo gem install mysql
then make sure you add it to your gemfile:
gem 'mysql'
your database.yml should look something like this:
development: adapter: mysql database: rails_dev username: root password: your password
That's the quick and dirty way.
To use the gem install mysql do i have to be in a certain directory?
#6
Re: Server: rails
Posted 15 May 2011 - 11:46 AM
Sadin56, on 15 May 2011 - 10:17 AM, said:
If you're just starting with Rails, you might want to start with the out of the box database (sqlite) and webserver(WEBrick) It's easier to use and you don't have to fuss with as much. You don't have to play with any settings.
Sadin56, on 15 May 2011 - 10:43 AM, said:
Just be in the root directory of your rails project
#7
Re: Server: rails
Posted 15 May 2011 - 11:49 AM
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lmygcc... no
checking for mysql_query() in -lmysqlclient... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/ruby1.8
--with-mysql-config
--without-mysql-config
--with-mysql-dir
--without-mysql-dir
--with-mysql-include
--without-mysql-include=${mysql-dir}/include
--with-mysql-lib
--without-mysql-lib=${mysql-dir}/lib
--with-mysqlclientlib
--without-mysqlclientlib
--with-mlib
--without-mlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-zlib
--without-zlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-socketlib
--without-socketlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-nsllib
--without-nsllib
--with-mysqlclientlib
--without-mysqlclientlib
--with-mygcclib
--without-mygcclib
--with-mysqlclientlib
--without-mysqlclientlib
Gem files will remain installed in /var/lib/gems/1.8/gems/mysql-2.8.1 for inspection.
Results logged to /var/lib/gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out
i dont know what im doing wrong
#8
Re: Server: rails
Posted 15 May 2011 - 11:57 AM
gem install mysql -- --with-mysql-dir=path_to_mysql
#10
Re: Server: rails
Posted 15 May 2011 - 12:00 PM
#12
Re: Server: rails
Posted 15 May 2011 - 01:34 PM
#13
Re: Server: rails
Posted 15 May 2011 - 02:30 PM
In Gemfile:
gem 'mysql2'
Then just run bundle install ( $ bundle install )
If you're starting new app:
$ rails new app_name -d mysql
This will generate app with mysql configuration.
Rails will use mysql2 gem which is libmysql binding and it's faster.
This post has been edited by MitkOK: 15 May 2011 - 02:33 PM
#15
Re: Server: rails
Posted 17 May 2011 - 01:57 AM
|
|

New Topic/Question
Reply




MultiQuote





|