Fulcrum + Herokuセットアップ

More than 5 years have passed since last update.



ローカルセットアップ

git clone git://github.com/malclocke/fulcrum.git

cd fulcrum

bundle install

bundle exec rake fulcrum:setup db:setup

rails server


JavaScriptエラー回避

vendor/assets/javascripts/bootstrap-twipsy.js


  • プロジェクトページを開いた時に「Uncaught TypeError: Cannot read property 'webkit' of undefined」エラー(Chrome)

エラー発生箇所コメントアウト

    // set CSS transition event type

if ( $.support.transition ) {
transitionEnd = "TransitionEnd"
// if ( $.browser.webkit ) {
transitionEnd = "webkitTransitionEnd"
// } else if ( $.browser.mozilla ) {
// transitionEnd = "transitionend"
// } else if ( $.browser.opera ) {
// transitionEnd = "oTransitionEnd"
// }
}


  • プロジェクトページを開いた時に「Uncaught TypeError: Object [object Object] has no method 'live'」エラー(Chrome)

エラー発生箇所コメントアウト/記述変更行追加

    if (options.trigger != 'manual') {

// binder = options.live ? 'live' : 'bind'
binder = 'bind' // ★↑コメントアウトしこの行を追加
eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus'
eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur'
this[binder](eventIn, enter)[binder](eventOut, leave)
}


Herokuセットアップ


  • SSL設定有効化

config/environments/production.rb

  # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.

config.force_ssl = true

heroku create test-fulcrum

heroku config:set APP_HOST=test-fulcrum.herokuapp.com


  • Define where the user emails will be coming from(This email address does not need to exist)

heroku config:set MAILER_SENDER=noreply@example.org

heroku addons:add sendgrid:starter

git push heroku master

heroku run rake db:setup

heroku open


BASIC認証

app/controllers/application_controller.rb

  http_basic_authenticate_with name: "test-fulcrum", password: ENV['BASIC_AUTHENTICATE_PASS'] unless Rails.env.development?

heroku config:set BASIC_AUTHENTICATE_PASS=password