Vagrant+CentOS7でWordPressをローカル環境を整えていたのですが、Ruby on Railsの環境もつくりたなと思い実行。
いろいろ設定を弄り、取り合えずトップは表示できるようになったので、メモ。
Contents
追加でやったこと
vagrantでvirtualhost(test.vagrant.testやsub.vagrant.testなど)のサブドメインの設定をしているので、そのほかにやったことをリストアップ。Railsのチュートリアルサイトに合わせていきたいのでRailsは5.1.6になるように。 Ruby on Rails チュートリアル
Warning: some directories may be inaccessible by the web server!
The web server typically runs under a separate user account for security
reasons. That user must be able to access the Phusion Passenger files.
However, it appears that some directories have too strict permissions. This
may prevent the web server user from accessing Phusion Passenger files.
It is recommended that you relax permissions as follows:
sudo chmod o+x "/home/vagrant"
Press Ctrl-C to return to the shell. (Recommended)
After relaxing permissions, re-run this installer.
-OR-
Press Enter to continue anyway.
っていわれるけど進む。
Checking for required software...
* Checking for C compiler...
Found: yes
Location: /usr/bin/cc
* Checking for C++ compiler...
Found: yes
Location: /usr/bin/c++
* Checking for Curl development headers with SSL support...
Found: no
Error: Cannot find the `curl-config` command.
* Checking for Zlib development headers...
Found: yes
Location: true
* Checking for Apache 2...
Found: yes
Location of httpd: /usr/sbin/httpd
Apache version: 2.4.6
* Checking for Rake (associated with /home/vagrant/.rbenv/versions/2.6.1/bin/ruby)...
Found: yes
Location: /home/vagrant/.rbenv/versions/2.6.1/bin/ruby /home/vagrant/.rbenv/versions/2.6.1/bin/rake
* Checking for OpenSSL support for Ruby...
Found: yes
* Checking for RubyGems...
Found: yes
* Checking for Ruby development headers...
Found: yes
Location: /home/vagrant/.rbenv/versions/2.6.1/include/ruby-2.6.0/ruby.h
* Checking for rack...
Found: yes
* Checking for OpenSSL development headers...
Found: yes
Location: true
* Checking for Apache 2 development headers...
Found: no
* Checking for Apache Portable Runtime (APR) development headers...
Found: no
* Checking for Apache Portable Runtime Utility (APU) development headers...
Found: no
Some required software is not installed.
But don't worry, this installer will tell you how to install them.
Press Enter to continue, or Ctrl-C to abort.
っていわれても進む。
Installation instructions for required software
* To install Curl development headers with SSL support:
Please install it with yum install libcurl-devel
* To install Apache 2 development headers:
Please install it with yum install httpd-devel
* To install Apache Portable Runtime (APR) development headers:
Please install it with yum install apr-devel
* To install Apache Portable Runtime Utility (APU) development headers:
Please install it with yum install apr-util-devel
If the aforementioned instructions didn't solve your problem, then please take
a look at our documentation for troubleshooting tips:
<VirtualHost *:80>
DocumentRoot /var/www/vhost/_rails.vagrant.test/hello_app/public
RailsEnv development
PassengerEnabled on
ServerName rails.vagrant.test
ErrorLog /var/www/vhost/_rails.vagrant.test/error_log
CustomLog /var/www/vhost/_rails.vagrant.test/access_log combined
AddDefaultCharset UTF-8
<Directory /var/www/vhost/_rails.vagrant.test/hello_app/public>
AllowOverride all
Require all granted
Options -MultiViews
</Directory>
</VirtualHost>
<Directory /var/www/vhost/_rails.vagrant.test/hello_app/public>のところは、$ rails _5.1.6_ new hello_app で作成しているRailsのpublicを指定する。
ブラウザアクセス
apachectl 再起動してブラウザアクセスしてみる。
エラー….。
Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
/home/vagrant/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/execjs-2.7.0/lib/execjs/runtimes.rb:58:in `autodetect’
Specified ‘sqlite3’ for database adapter, but the gem is not loaded. Add `gem ‘sqlite3’` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord). (Gem::LoadError)
コメント