1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

(5)EC2にrails起動テスト|EC2でgit+RonR+unicorn+nginx+capistrano+Jenkins

Last updated at Posted at 2013-03-02

##これまでの目次

  1. EC2+gitリモートサーバ構築#1
  2. (2)EC2+gitリモートサーバ構築#2
  3. (3)EC2にrvm+rubyインストール
  4. (4)EC2にrailsインストール

##その5|railsアプリ起動テスト

###1.railsプロジェクト作成

sudo su -
mkdir /work
cd /work
rails new sample

エラーその1
openSSLがないと。
You must recompile Ruby with OpenSSL support or change the sources in your Gemfile from 'https' to 'http'. Instructions for compiling with OpenSSL using RVM are available at rvm.io/packages/openssl.

もう慣れましたね。

cd /usr/local/rvm/src/ruby-1.9.3-p385/ext/openssl
ruby extconf.rb
make
make install

エラーその2
sqlite3がないと。
An error occurred while installing sqlite3 (1.3.7), and Bundler cannot continue. Make sure that gem install sqlite3 -v '1.3.7' succeeds before bundling.

sqlite3ではないところがミソ

yum install sqlite-devel
gem install sqlite3 -v '1.3.7'

###2.railsアプリ起動

cd sample
rails s

エラー3
JavascriptRuntimeがない。

execjsとtherubyracer

Gemfileをviで開いて、下記を追記

gem 'execjs'
gem 'therubyracer'

rails s

起動しました。3000ポートでブラウザから閲覧できれば良しです。

http://address:3000

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?