Help us understand the problem. What is going on with this article?

Rails6対応のCentOS7をvagrant up一発で構築するVagrantfile


# -*- coding: utf-8 -*-

use_ruby_version = "2.6.6"
use_node_version = "12.13.0"

Vagrant.configure("2") do |config| = "centos/7" "forwarded_port", guest: 3000, host: 3000, host_ip: ""
  config.vm.provider "virtualbox" do |vb|
  #   # Display the VirtualBox GUI when booting the machine
  #   vb.gui = true
  #   # Customize the amount of memory on the VM:
  #   vb.memory = "1024"
  #   vb.customize ["modifyvm", :id, "--memory", "2048", "--cpus", "4", "--ioapic", "on"]

  # システムのアップデート&必要パッケージのインストール
  config.vm.provision "shell", inline: <<-SHELL
    yum -y update &>/dev/null
    yum -y install gcc gcc-c++ make git openssl-devel readline-devel zlib-devel
    yum -y install automake libtool bzip2-devel sqlite-devel

    # install sqlite3.29
    curl | tar zx -C /opt
    cd /opt/sqlite-autoconf-3290000 && ./configure --prefix=/opt/sqlite/sqlite3 && make -j4 && make install
  config.vm.provision "shell", privileged: false, inline: <<-SHELL
    if ! type anyenv &>/dev/null;then
      git clone ~/.anyenv
      echo 'export PATH="$HOME/.anyenv/bin:$PATH"' >> ~/.bash_profile
      echo 'eval "$(anyenv init -)"' >> ~/.bash_profile
      source ~/.bash_profile
      mkdir -p $(anyenv root)/plugins
      git clone $(anyenv root)/plugins/anyenv-update
      anyenv install --force-init
    if ! type rbenv nodenv &> /dev/null;then
      anyenv install rbenv --skip-existing
      anyenv install nodenv --skip-existing
      source ~/.bash_profile
      touch $(nodenv root)/default-packages
    if ! type ruby &> /dev/null || ruby -e "exit RUBY_VERSION != '#{use_ruby_version}'";then
      anyenv update rbenv
      rbenv install #{use_ruby_version} --skip-existing
      rbenv global #{use_ruby_version}
    if ! type node &> /dev/null || [ $(node -v) != "v#{use_node_version}" ];then
      anyenv update nodenv
      touch $(nodenv root)/default-packages
      nodenv install #{use_node_version} --skip-existing
      nodenv global #{use_node_version}
    gem update --system --no-document
    gem install --no-document --force bundler
    gem install --no-document rails pry

    # install yarn for rails6
    curl -o- -L | bash

    # configuration
    echo 'export BINDING=' >> ~/.bash_profile
    bundle config build.sqlite3 --with-sqlite3-lib=/opt/sqlite/sqlite3/lib
    rbenv rehash


【Rails 6.0.0.rc2】rails s したら RAILS_ENV=development environment is not defined in config/webpacker.yml, falling back to production environment Exiting で怒られた。
CentOS環境でRails6.0をSQLite3 (>=3.8)で動かす

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away