/var/log/messages

Apr 5, 2014 - 1 minute read - Comments - rails

nginx+unicorn+rails な環境

以下に沿ってすすめてみる。別途 ansible で云々も試す。本当は某もくもく会で、って思っていたのですが、優先度上がったみたいなのでとりあえず。

素のうぶんつだと ruby が make できない、ってことで以下のパケジを入れてます。

sudo apt-get -y install build-essential openssl libreadline6 \
libreadline6-dev zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 \
libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev \
ncurses-dev automake libtool bison subversion

あと、git clone した後に bundler 入れてないことに気づくなど。

$ gem i bundler --no-ri --no-rdoc
$ rbenv rehash
$ bundle install

あと mysql 関連で

An error occurred while installing mysql2 (0.3.13), and Bundler cannot continue.
Make sure that `gem install mysql2 -v '0.3.13'` succeeds before bundling.

って叱られるな。何だこれは。libmysqlclient-dev が必要なのかな。

$ sudo apt-get instlal -fy libmysqlclient-dev

あ、もしかして heroku 向けに pg なソレが入ってたのが駄目だったのかどうかorz

続き

DB の用意をして

$ mysql -u root
> create database hoge

あとは migrate かな

$ RAILS_ENV=production bundle exec rake db:migrate

で、あとは参考ドキュメントの通り、で何とかなりました。別途もっかいイチからヤッてみて自動化検討か。

Ubuntu 12.04 に postfix で 諸々備忘

comments powered by Disqus