â gem ã®ãã¼ã¸ã§ã³ â activerecord-4.0.2 rake-10.1.1 sqlite3-1.3.8 ãã£ã¬ã¯ããªæ§æ ãã£ã¬ã¯ããªæ§æã¯ä»¥ä¸ã®éãã«ãã¾ãããã¤ã°ã¬ã¼ããã¡ã¤ã«ã®å ´æ㯠Rails ã«ãªããã¾ãããã¾ã sqlite ãã¼ã¿ãã¼ã¹ã¯ãdatabase/db.sqlite ã«ç½®ãã¾ããã app | database | | db.sqlite | db/ | | migrate/ | | | 001_create_tests.rb Rakefile
æ¦è¦ sqlite3 ã¯ãSQLite ãªã¬ã¼ã·ã§ãã«ãã¼ã¿ãã¼ã¹ï¼SQLite 3.6.16 以ä¸ï¼ã«ã¢ã¯ã»ã¹ããããã®ã©ã¤ãã©ãªã§ãã ãã®ä»ã«ãæ±ç¨ãªã¬ã¼ã·ã§ãã«ãã¼ã¿ãã¼ã¹ã¢ã¯ã»ã¹ç¨ã©ã¤ãã©ãªã使ã£ãã¢ã¯ã»ã¹ãã§ãããããã©ã®æ¹æ³ã§ã¢ã¯ã»ã¹ãããã¯ä¸èã®ä½å°ãããã¾ãã sqlite3 ãã¤ã³ã¹ãã¼ã«ãã 以ä¸ã®ã³ãã³ããå®è¡ã㦠sqlite3 gem ãã¤ã³ã¹ãã¼ã«ãã¾ãã gem install sqlite3 sqlite3 㧠SQLite ãã¡ã¤ã«ã«ã¢ã¯ã»ã¹ãã 以ä¸ã®ããã°ã©ã 㧠SQLite ãã¡ã¤ã«ã«ã¢ã¯ã»ã¹ãã¾ãã require 'sqlite3' db = SQLite3::Database.new("ãã¡ã¤ã«å") # db ã使ã MySQL ãæä½ãã db.close ãã¡ã¤ã«ãåå¨ããã°æ¢åã®ãã¼ã¿ãã¼ã¹ã«ããªããã°ãã¡ã¤ã«ãä½æãæ°è¦ã®ãã¼ã¿ãã¼
軽éã»é«éãªãã¼ã¿ãã¼ã¹SQLiteãRubyããæ±ãããã®ã©ã¤ãã©ãªã ã¤ã³ã¹ãã¼ã« Windowsã®å ´å RubyForgeããã sqlite3-ruby(sqlite3-ruby-x.x.x.zip)ããã¦ã³ãã¼ãããã ãã¦ã³ãã¼ããããã¡ã¤ã«ãå±éããã ã¤ã³ã¹ãã¼ã«ããã°ã©ã ãå®è¡ããã ruby setup.rb config ruby setup.rb setup ruby setup.rb install RubyGemsã使ãå ´å RubyGemsãã¤ã³ã¹ãã¼ã«ããå¾ã 次ã®ã³ãã³ããå®è¡ããã gem install sqlite3-ruby SQLiteã®ã¤ã³ã¹ãã¼ã« SQLite Download Pageããã sqlitedll-3_x_x.zipããã¦ã³ãã¼ãããã ãã¦ã³ãã¼ããããã¡ã¤ã«ãå±éããã sqlite.dllããã¹ã®éã£ããã£ã¬ã¯ããªã«ã³ã
Mac OS X 10.5 Leopard ã«ã¯ãRuby ã¨ã¨ãã«ãSQLite 3 ã sqlite3-ruby ãæ¨æºã§ã¤ã³ã¹ãã¼ã«ããã¦ããã®ã§ãããã使ã£ã¦ã¿ãã¨ãã®ã¡ã¢ãèªåã§æ¸ãã¦ã RubyCocoa ã®ããã°ã©ã ã§ä½¿ã£ã¦ã¨ããããåãããã®ãã¡ã¢ãããã©ã使ãæ¹ãæ£ãããã©ããã¯ã¡ãã£ã¨ããããªãããã£ã¨ããæ¹æ³ããæ£ããæ¹æ³ãè¦ã¤ããã°ãé ã«æ¸ãå ããããæ¸ãæããããã¦ããã¤ããã SQLite ã¨ã¯ SQL ãã¼ã¿ãã¼ã¹ç®¡çã½ããã§ãMySQL ã¿ããã«ãµã¼ãã¼ã«ã¤ã³ã¹ãã¼ã«ãã¦ãã¼ã¿ãã¼ã¹ã管çããã®ã§ã¯ãªãããã¼ã¿ãã¼ã¹ããã¼ã«ã«ã®ãã¡ã¤ã«ã§ç®¡çããï¼ãããã¯ã¼ã¯ä¸ã«ãã£ã¦ããããããããªããã©ã試ãããã¨ããªãã®ã§ããããªãï¼ãã¤ã¾ãããã¼ã¿ãã¼ã¹ããã¡ã¤ã«ãªã®ã§ã移åãããããããã¯ã¢ãããããã¨ç®¡çã楽ããã ããã®ããã«å·¨å¤§ãªãã¼ã¿ãã¼ã¹ã«ã¯åããªããã©ã
ããã£ã¨DBã«ã¢ã¯ã»ã¹ããããããã¹ã¯ãªããããrubyã§æ¸ããããªãã¨æããã¨ã¯ãªãã§ããï¼ Railsã§ä½¿ããã¦ãã O/Rãããã³ã°ã®ã©ã¤ãã©ãªãActiveRecordãã§ãããRailsã§ã¯ãªããã ã®rubyããã°ã©ã ããåä½ã§ä½¿ããã¨ãåºæ¥ã¾ãã ä»åã¯ããActiveRecordããåä½ã§ä½¿ç¨ãã¦ãMySQLã«ã¢ã¯ã»ã¹ããã¹ã¯ãªãããæ¸ãã¦ã¿ã¾ãã ç°å¢ ruby 1.9.3 activerecord 3.2.8 ActiveRecordã使ã£ã¦ã¿ã ActiveRecordãã¤ã³ã¹ãã¼ã« $ gem install activerecord MySQLã«æ¥ç¶ããããã®ã¢ããã¿ã¤ã³ã¹ãã¼ã« $ gem install mysql2 ä¸ã®ãããªã¨ã©ã¼ãåºãå ´åã Building native extensions. This could take a while... ERR
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}