git clone https:\/\/github.com\/sstephenson\/rbenv.git ~\/.rbenv<\/code><\/pre><\/div>\n\n\n\n\u6298\u89d2rbenv\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3057\u305f\u304c\u3001\u4eca\u306e\u307e\u307e\u3067\u306f\u30d1\u30b9\u304c\u901a\u3063\u3066\u3044\u306a\u3044\u306e\u3067\u3001rbenv<\/code>\u30b3\u30de\u30f3\u30c9\u3092\u30b7\u30b9\u30c6\u30e0\u304c\u8a8d\u8b58\u3067\u304d\u307e\u305b\u3093\u3002\u30d1\u30b9\u3092\u901a\u3059\u305f\u3081\u306b~\/.bash_profile<\/code>\u306b\u4ee5\u4e0b\u3092\u8ffd\u8a18\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\nexport PATH="$HOME\/.rbenv\/bin:$PATH"\neval "$(rbenv init -)"<\/code><\/pre><\/div>\n\n\n\n\u8ffd\u8a18\u3057\u305f\u3089\u3001source ~\/.bash_profile<\/code>\u3057\u3066\u3001.bash_profile<\/code>\u3092\u8aad\u307f\u8fbc\u307e\u305b\u307e\u3059\u3002<\/p>\n\n\n\n<\/span>ruby\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb(\u6700\u521d\u3060\u3051)<\/span><\/h2>\n\n\n\nruby\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u3059\u308b\u305f\u3081\u306bruby-build<\/code>\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n\n\n\ngit clone https:\/\/github.com\/sstephenson\/ruby-build.git ~\/.rbenv\/plugins\/ruby-build<\/code><\/pre><\/div>\n\n\n\n\u3055\u3066\u3001\u3044\u3088\u3044\u3088\u5b9f\u969b\u306bruby<\/code>\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3057\u3087\u3046\u3002rbenv install -l<\/code>\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u308bruby\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u4e00\u89a7\u8868\u793a\u3055\u308c\u307e\u3059\u3002\u4eca\u56de\u306f\u73fe\u6642\u70b9\u3067\u306e\u6700\u65b0\u7248\u306e2.1.2<\/code>\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\nrbenv install 2.1.2<\/code><\/pre><\/div>\n\n\n\n\u6b21\u306b\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u4f7f\u7528\u3059\u308bruby\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n
rbenv global 2.1.2<\/code><\/pre><\/div>\n\n\n\n\u3053\u3053\u3067\u306f\u7279\u306b\u4f55\u3082\u6307\u5b9a\u3057\u306a\u304f\u3066\u3082\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b.ruby-version\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u3092\u7528\u610f\u3057\u3066<\/p>\n\n\n\n
2.1.2<\/code><\/pre><\/div>\n\n\n\n\u3068\u66f8\u3044\u3066\u304a\u3044\u3066\u3042\u3052\u308c\u3070\u3001\u81ea\u52d5\u7684\u306b\u305d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u5207\u308a\u66ff\u3048\u3066ruby\u304c\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n
<\/span>bundler\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb(\u6700\u521d\u3060\u3051)<\/span><\/h2>\n\n\n\n\u3053\u3053\u307e\u3067\u6765\u305f\u3089\u3001gem<\/code>\u3068\u547c\u3070\u308c\u308bruby\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u7ba1\u7406\u3059\u308b\u30b3\u30de\u30f3\u30c9\u304c\u4f7f\u3048\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u306e\u3067gem<\/code>\u3067bundler<\/code>\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\ngem install bundler<\/code><\/pre><\/div>\n\n\n\nbundler\u306fruby\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092Gemfile\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u306b\u8a18\u8ff0\u3057\u3066\u7ba1\u7406\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308bGem\u3067\u3001rails\u3067\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u3053\u306ebundler\u3092\u63a1\u7528\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n
<\/span>rails\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb(\u6bce\u56de)<\/span><\/h2>\n\n\n\n\u307e\u305a\u306fGemfile\u3092\u4f5c\u308b\u305f\u3081\u306b\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u53e9\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n
bundle init<\/code><\/pre><\/div>\n\n\n\nGemfile\u304c\u3067\u304d\u3066\u3044\u308b\u3068\u304a\u3082\u3046\u306e\u3067\u3001\u4e2d\u8eab\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u7de8\u96c6\u3057\u307e\u3059<\/p>\n\n\n\n
# frozen_string_literal: true\n\nsource "https:\/\/rubygems.org"\n\ngit_source(:github) {|repo_name| "https:\/\/github.com\/#{repo_name}" }\n\ngem "rails" # \u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3092\u5916\u3059<\/code><\/pre><\/div>\n\n\n\n\u3053\u308c\u3067\u6e96\u5099\u306f\u5b8c\u4e86\u3067\u3059\uff01\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u53e9\u3044\u3066\u3001rails\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3057\u3087\u3046\uff01<\/p>\n\n\n\n
bundle install --path=vendor\/bundle<\/code><\/pre><\/div>\n\n\n\n<\/span>rails\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u6210(\u6bce\u56de)<\/span><\/h2>\n\n\n\nrails<\/code>\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u308b\u306e\u306b\u4fbf\u5229\u306arails<\/code>\u30b3\u30de\u30f3\u30c9\u3068\u3044\u3046\u3082\u306e\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u6700\u521d\u306frails new<\/code>\u30b3\u30de\u30f3\u30c9\u3067Ruby on Rails\u306e\u3072\u306a\u5f62\u3092\u4f5c\u308a\u307e\u3057\u3087\u3046\u3002bundle exec\u306f\u4ecabundler\u3067\u4f5c\u3063\u305f\u74b0\u5883\u3067\u5b9f\u884c\u3067\u304d\u308b\u30b3\u30de\u30f3\u30c9\u3092\u547c\u3073\u51fa\u3059\u305f\u3081\u306e\u304a\u307e\u3058\u306a\u3044\u3068\u601d\u3063\u3066\u304a\u3051\u3070\u6700\u521d\u306e\u3046\u3061\u306f\u5341\u5206\u3060\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\nbundle exec rails new application_name -d mysql<\/code><\/pre><\/div>\n\n\n\n\u6700\u5f8c\u306emysql<\/code>\u306e\u90e8\u5206\u306f\u4f7f\u7528\u3059\u308b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u7ba1\u7406\u30b7\u30b9\u30c6\u30e0\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001postgresql<\/code>\u3092\u4f7f\u7528\u3057\u305f\u304b\u3063\u305f\u3089\u3001rails new application_name -d postgresql<\/code>\u306b\u306a\u308a\u307e\u3059\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306fsqlite\u3092\u4f7f\u3046\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u597d\u304d\u306a\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4f7f\u3063\u3066\u3042\u3052\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u53e9\u3051\u3070rails\u306e\u30b5\u30fc\u30d0\u30fc\u304c\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n\n\n\n
bundle exec rails s<\/code><\/pre><\/div>\n\n\n\n\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306fhttp:\/\/localhost:3000<\/code>\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068rails\u306e\u30da\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u308b\u3068\u601d\u3044\u307e\u3059\u3002\u3042\u3068\u306fDB\u306e\u8a2d\u5b9a\u3084\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u306e\u8a2d\u5b9a\u3092\u3059\u308b\u3053\u3068\u3067\u3001\u958b\u767a\u3092\u59cb\u3081\u3089\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<\/span>\u307e\u3068\u3081<\/span><\/h2>\n\n\n\n\u5b9f\u969b\u306f\u5225\u306brbenv\u3092\u4f7f\u3063\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u5fc5\u8981\u306f\u306a\u304f\u3066\u3001Mac\u306b\u6a19\u6e96\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308bgem<\/code>\u3092\u4f7f\u3063\u3066\u3044\u304d\u306a\u308agem install rails<\/code>\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002\u305f\u3060\u3001gem<\/code>\u306e\u7ba1\u7406\u3084\u69d8\u3005\u306aruby\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u958b\u767a\u3057\u305f\u3044\u3068\u304d\u7c21\u5358\u306b\u5207\u308a\u66ff\u3048\u3067\u304d\u305f\u307b\u3046\u304c\u4fbf\u5229\u306a\u306e\u3067\u3001Mac\u4e0a\u306b\u76f4\u63a5\u3001\u958b\u767a\u74b0\u5883\u3092\u69cb\u7bc9\u3059\u308b\u969b\u306frbenv\u3092\u304a\u3059\u3059\u3081\u3057\u307e\u3059\u3002<\/p>\n\n\n\n\u6700\u8fd1\u306fDocker\u4e0a\u3067\u74b0\u5883\u3092\u6574\u3048\u308b\u3053\u3068\u306e\u307b\u3046\u304c\u591a\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u306d\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"
Ruby on Rails\u306f\u6570\u591a\u304f\u306e\u30b5\u30fc\u30d3\u30b9\u306b\u5229\u7528\u3055\u308c\u3066\u3044\u3066\u3001Web\u958b\u767a\u8005\u3067\u3042\u308c\u3070\u3001\u4e00\u5ea6\u306f\u540d\u524d\u3092\u8033\u306b\u3057\u305f\u3053\u3068\u304c\u3042\u308b\u3067\u3042\u308d\u3046\u3001\u30b9\u30bf\u30f3\u30c0\u30fc\u30c9\u306a\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002 \u4eca\u56de\u306f\u3001\u521d\u5b66\u8005\u306e\u65b9\u306e\u305f\u3081\u306b\u3001Docker\u7b49\u306f\u4f7f\u308f\u305a […]<\/p>\n","protected":false},"author":1,"featured_media":208564,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[5,53],"tags":[46,140,50,40],"class_list":["post-3537","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-program","category-ruby","tag-for-beginner","tag-rails","tag-ruby","tag-web"],"aioseo_notices":[],"jetpack_featured_media_url":"http:\/\/cms.inter-arteq.com\/wp-content\/uploads\/2022\/04\/how-to-build-rails-env-on-mac.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/posts\/3537"}],"collection":[{"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/comments?post=3537"}],"version-history":[{"count":3,"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/posts\/3537\/revisions"}],"predecessor-version":[{"id":208565,"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/posts\/3537\/revisions\/208565"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/media\/208564"}],"wp:attachment":[{"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/media?parent=3537"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/categories?post=3537"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/tags?post=3537"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}