2017-01-01から1年間の記事一覧

constantizeした時にactive_support/inflector/methods.rb:268:in `const_get': uninitialized constant Hoge (NameError)と怒られる問題[Rails]

h = 'Hoge'.constantize h.create(fuga: 'fuga') した時に active_support/inflector/methods.rb:268:in `const_get': uninitialized constant Hoge (NameError) とHogeという定数、クラスがなかったため怒られてしまった。 safe_constantizeで回避 safe_con…

rake taskの中断はreturnではなくnextだった[Rails]

task :test do puts 'hoge' return puts 'moge' end 実行する rake aborted! LocalJumpError: unexpected return 怒られた… rake taskの中断はreturnじゃなくてnextとのこと task :test do puts 'hoge' next puts 'moge' end 以下の場合はreturnとのこと tas…

brew updateしたら/usr/local/Library/brew.sh: line 32: /usr/local/Library/ENV/scm/git: No such file or directoryと怒られる問題

brew update brew update したら $ brew update /usr/local/Library/brew.sh: line 32: /usr/local/Library/ENV/scm/git: No such file or directory /usr/local/Library/brew.sh: line 32: /usr/local/Library/ENV/scm/git: No such file or directory /usr…

getCurrentPosition() and watchPosition() no longer work on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.

GoogleMapAPIを使って現在地情報を取得しようとしたところ Chromeで getCurrentPosition() and watchPosition() no longer work on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HT…