のしメモ アプリ開発ブログ

Unityアプリとかロボットとか作ってるときに困ったこととかメモ

elasticbeanstalkのdbをmysqlに変更した際にエラー

elasticbeanstalk(rails2.0)のproduction環境をmysqlに変更し、デプロイ時にエラーがでたのでメモ

エラー内容

[Instance: i-0e01735f21d78e0a0] Command failed on instance. Return code: 1 Output: (TRUNCATED)...undle. Add it to Gemfile. /var/app/ondeck/config/environment.rb:5:in `<top (required)>' /opt/rubies/ruby-2.2.5/bin/bundle:23:in `load' /opt/rubies/ruby-2.2.5/bin/bundle:23:in `<main>' Tasks: TOP => environment (See full trace by running task with --trace). Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/11_asset_compilation.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.

対処

eb sshで接続して原因を調べる

eb ssh

eb-activity.logを見る

vi /var/log/eb-activity.log

Gem::LoadError: Specified 'mysql2' for database adapter, but the gem is not loaded. Add `gem 'mysql2'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).
  /var/app/ondeck/config/environment.rb:5:in `<top (required)>'
  /opt/rubies/ruby-2.2.5/bin/bundle:23:in `load'
  /opt/rubies/ruby-2.2.5/bin/bundle:23:in `<main>'
  Gem::LoadError: mysql2 is not part of the bundle. Add it to Gemfile.
  /var/app/ondeck/config/environment.rb:5:in `<top (required)>'
  /opt/rubies/ruby-2.2.5/bin/bundle:23:in `load'
  /opt/rubies/ruby-2.2.5/bin/bundle:23:in `<main>'
  Tasks: TOP => environment
  (See full trace by running task with --trace) (Executor::NonZeroExitStatus)

Gemが足りていないみたいなので記載する

Gemfileにgem 'mysql2'を追記しデプロイ

なおる!

A-FrameでTextureがcross-originエラーで取得できないときの対処メモ

a-frameを使用した際にTextureの取得箇所でエラーがでた時の対処メモ

こんなエラー

Uncaught SecurityError: Failed to execute 'texImage2D' on 'WebGLRenderingContext': The cross-origin image at http: {Texture URL}

原因

異なるドメインのファイル取得する際にエラーがでてしまう

対策

対処としては微妙だが、a-frame側をいじってしまう
こちらからa-frameのminifyしてない方をダウンロード(現時点でver0.2.0)

a-frame.jsのここを

if ( loader.setCrossOrigin ) loader.setCrossOrigin( this.crossOrigin );

コメントアウトする

// NOTE: cross domainの対処
// if ( loader.setCrossOrigin ) loader.setCrossOrigin( this.crossOrigin );

画像がとれるようになる

CV1のカメラが認識しなくなった時のメモ

Windowsの更新のタイミングで、CV1のカメラが認識されなくなったのでどう対処したかメモ。

カメラが認識しないとデバイスマネージャー上ではこんな状態になります。

OculusHomeでもセンサーが見つからないとエラーがでます。

対処方法

ネット見てると、USB2.0に差し替えたりすると直るとかの情報もあったのですが、直らなかったので再インストールすることに。

1. 下記からOculusSetup.exeをダウンロード

https://www3.oculus.com/en-us/setup/

2. OculusHomeの再インストール

OculusSetup.exeを実行し、Uninstallし、もう一度OculusSetup.exeを実行してインストールする
※ Repairでは直らなかったです。アプリも再インストールすることになるが仕方なし

3. インストールを待つ

これでなんとか直りました