LoginSignup
6
5

More than 5 years have passed since last update.

sinatra-activerecordでproduction環境にrake db:createする

Last updated at Posted at 2015-07-25

SinatraでActiverecordを使うにあたってsinatra-activerecordというgemを使う際のメモです。

このgemが提供しているrakeファイルを用いてproduction環境にdb:createする方法がわからずにハマってしまいました。
検索して出てくるのはRails環境下でのActiverecordの情報が多いので注意が必要ですね…

それぞれ以下のように環境を指定します。

Rails

rake db:create RAILS_ENV=production

sinatra-activerecord

rake db:create RACK_ENV=production

ちなみに指定しない場合はデフォルトでdevelopmentが選択されます。

6
5
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
6
5