Rails3.1 ããå梱ãããããã«ãªã£ã sprockets ã® README ã®æ訳ã§ãã sstephenson/sprockets - GitHub ã¯ããã« Sprockets 㯠assets ãã¡ã¤ã«ã®ã³ã³ãã¤ã«ã¨é ä¿¡ãè¡ãããã® Ruby ã®ã©ã¤ãã©ãªã§ããJavaScript 㨠CSS ãã¡ã¤ã«ã®ä¾åé¢ä¿ã宣è¨ã§ããããã«ããªããã»ããµã使ããã¨ã§ CoffeeScript, Sass, SCSS, LESS çã®è¨èªã assets ã®è¨è¿°ã«å©ç¨åºæ¥ã¾ãã ã¤ã³ã¹ãã¼ã« ããããæ®éã®ããæ¹ã§ã¤ã³ã¹ãã¼ã«å¯è½ã§ãã gem install sprockets Gemfileãªã gem 'sprockets', '~> 2.0' Sprockets Environment assets ãã¡ã¤ã«ã«ã¢ã¯ã»ã¹ãã¦é ä¿¡ãããªãã Sprockets::Environmen
sinatraåå¼·ä¸ã§ãã»ãã·ã§ã³ã®ç®¡çãããã©ã«ãã®ã¯ããã¼ã§ã¯ãªãredisã§ãããããªã¨ã ãã§ã¡ãã£ã¨èª¿ã¹ããè¯ããããªã®ãããã¨ã https://github.com/vangberg/rack-session-redis 使ãæ¹ãç°¡åããã ããããï¼ã¦ãã¨ã§ã¡ãã£ã¨ä½¿ã£ã¦ã¿ããã¨ã«ã Usage READMEãã®ã¾ã¾ã§OKã§ãã Gemfile
ç 究室ã®å¾è¼©ã«Sinatraã¨hamlã¨jQueryãæããããã«ä½ã£ããã³ãã¬ã¼ãã«ã¤ãã¦ãããã«ãæ¸ãã¦ãã ã½ã¼ã¹ã³ã¼ã https://github.com/shokai/sinatra-template å®éåãã¦ãããã® http://masui.sfc.keio.ac.jp/sinatra-template/ git clone git://github.com/shokai/sinatra-template.git â Sinatraãä½ã«ä½¿ãã Sinatra+haml+jQueryã便å©ã Railsã¨ä¼¼ã¦ããã©ãã¡ãã£ã¨éãã å人çã«ã¯ Rails â HTMLã®ãã¼ã¸ããã£ã±ãä½ãã®ã«ä¾¿å© Sinatra â ç»é¢é·ç§»ãã¾ãããªãã¦ãåãURLã®ã¾ã¾jsonã®APIãjQueryã®ajaxã§åå¾ãã¦åçã«è¡¨ç¤ºãå¤ããwebãã¼ã¸ãä½ãã®ã«ã¯ä¾¿å© ã«æããã ã§ãSi
Rubyã®ãã¬ã¼ã ã¯ã¼ã¯sinatraã®ç´¹ä»ã§ãã Railãæåããã¾ãããsinatraã使ãåæãè¯ãæãã§ãã æ¬å®¶ Shinatra æ¬å®¶ ããã¥ã¡ã³ã èªåã使ã£ã¦ã¿ã¦ä¸è¨ï¼ç¹ãé常ã«ä¾¿å©ã¨æãã¾ããã æå°ã®ã³ã¼ãè¨è¿°ã§MVCã使ãã æåã¯httpãµã¼ãã¼ã®è¨å®ãªã©ç¹ã«èããªãã¦ããã ã¨ãè¨ãããã§æ©é使ãæ¹ã åºæ¬åä½ãããã¾ã§ãï¼åããããã¾ãããã¹ã´ã¤ï¼ï¼ install cmd gem install sinatra ã½ã¼ã¹ app.rb require 'sinatra' get '/' do "Hello world " end åããã¦ã¿ã ã³ãã³ãã§ããã°ã©ã èµ·å cmd ruby app.rb #çµäºã¯Ctrl-C㧠ãã©ã¦ã¶ã¼ã§ã¢ã¯ã»ã¹ URL http://localhost:4567 表示 Hello world 以ä¸ãsinatraã®åºæ¬çãªåã
ä»ãã£ã¦ãããã¸ã§ã¯ãã§Sinatraã§ã¤ãã£ãã¢ããªã±ã¼ã·ã§ã³ãRailsã¢ããªã«çµã¿è¾¼ãå¿ è¦ããã£ãã®ã§ï¼ã¢ããªãä½ãã¨ããããä½æ¥ãç°¡ç¥åãã¦ã¡ã¢ããï¼ ã¼ãã èªåã®ã±ã¼ã¹ã ã¨SinatraãjQuery Mobileãæ±ã£ã¦ã¦Railsã¯APIãµã¼ãã«ä½¿ãã¨ãããæ®ééã ãï¼ãã¨ããã³ããåãã¦ãæå¥è¨ããªãç¶æ ï¼è¨ã訳ã ãã©æåã¯APIãµã¼ãã¤ããäºå®ãããªãã£ããï¼Sinatraã®ã»ãã¯ç ´æ£ããã¤ããã ã£ãï¼ï¼Githubãªããã¯éã«Sinatraã§å®è£ ããAPIãRailsã«ãã¦ã³ããã¦ããï¼ãã¬ã¼ã ã¯ã¼ã¯ã®ç«ã¡ä½ç½®ããèããã¨ãããæ£ããã¨æã. 詳ããã¯ãã®ã¹ã©ã¤ããåç §ãããã¨ï¼ ã¾ãRailsã¢ããªãã¤ãã rails new hoge index.htmlãåé¤ãã¦ãã cd hoge rm ./public/index.html Gemfileã«sinatraã
Rubyåå¿è ãSinatraã使ãå§ãã¦ã¿ãã®ã§ãå§ãã®æ¬ãªã©ãç´¹ä»ãã¾ãã å ¬å¼ãµã¤ã http://www.sinatrarb.com/ ã¨ããããå ¬å¼ãµã¤ããè¦ãªãããHello World!ããã£ã¦ã¿ã¦ãããããªããç°¡åããï¼ãã¨æãããã®ã®ããªã«ãå¦çããã«ã¯æä½éRubyæ¸ããªãã¨ãã£ã±ããã¡ã ãªãã¨æããä¸æ¦Sinatraããé¢ãã¦Rubyã®åå¿è æ¬ãèªã¿å§ãã¾ããã ãä½ããªããå¦ã¶Rubyå ¥éããæ¬å½ã«ãªã¹ã¹ã¡ã§ãï¼ èµæ¸ç®¡çããã°ã©ã ãä½ãããã«é©å®ããã«å¿ è¦ãªç¥èãé ã追ã£ã¦å°ããã¤ç´¹ä»ãã¦ããã¦ãããã®ã§æ«æãã«ãããã¨ã ãã®æ¬ã¯è¨èªé¢ä¿ãªãããã°ã©ã åå¿è ã«ããããããããã§ãã ãªããããã°ã©ãã³ã°è¦æãªèªåã«ã§ãç解ããããã£ããã®ã§(ï¼Â´Ðï½) ããã¨ãããã¤ã³ã¹ãã¼ã«ã®Rubyå ¥éã¨Sinatraå ¥éãå¿ è¦ã§ããã http://dotinstall.
http://ilikestuffblog.com/2014/01/06/how-to-skip-bundle-install-when-deploying-a-rails-app-to-docker/1 comment | 0 pointsBrian Moreartyãã¿ã¤ãã«ã®å 容ã«ã¤ãã¦ã¾ã¨ãã¦ãã¾ãã Dockerã§ã¯ãRailsã¢ããªããä¾åé¢ä¿ï¼æ£ããRubyã®ãã¼ã¸ã§ã³ãå©ç¨ããgemãªã©ï¼ãçµã¿è¾¼ãã ã¾ã¾ãã³ã³ããã«ãããã¤ã§ãããã¢ããªããã®ã³ã³ããã§ãã¹ãããæ¬çªç°å¢ã®ãã¹ãã«ã¢ããã§ãããäºåã«ã¡ã¢ãªã確ä¿ããå¿ è¦ããªãã®ã§ãããªã軽ãæãã®VMã®ããã§ããããã®ãã¹ãã§ã¯ã³ã³ããä½æã®è©³ç´°ã«ã¯è§¦ããªãããç°¡åã«èª¬æããã¨ãã³ã³ãããã»ããã¢ããããã¹ã¯ãªããã§ããDockerfileãã¤ãã£ã¦ãdocker buildã§å®è¡ããã¨ããã¹ãããã Dockerã¯ãæå
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}