タグ : ruby

[CircleCI] Ruby のバージョン指定について

CircleCI の公式ドキュメントに書いてある ruby のバージョンのみ対応しています。

CircleCI

続きを読む

[RVM] Empty path passed to certificates update, functions stack: requirements_osx_update_openssl_cert_run …

rvm で Ruby version 2.1.3 をインストールすると Empty path passed to certificates update 的なエラーが発生しました。

% rvm install 2.1.3
 
Searching for binary rubies, this might take some time.
Found remote file https://rubies.travis-ci.org/osx/10.9/x86_64/ruby-2.1.3.tar.bz2
Checking requirements for osx_brew.
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.
ruby-2.1.3 - #configure
ruby-2.1.3 - #download
ruby-2.1.3 - #validate archive
ruby-2.1.3 - #extract
ruby-2.1.3 - #validate binary
ruby-2.1.3 - #setup
ruby-2.1.3 - #gemset created /Users/bakorer/.rvm/gems/[email protected]
ruby-2.1.3 - #importing gemset /Users/bakorer/.rvm/gemsets/global.gems......................................................................
ruby-2.1.3 - #generating global wrappers..............
ruby-2.1.3 - #gemset created /Users/bakorer/.rvm/gems/ruby-2.1.3
ruby-2.1.3 - #importing gemsetfile /Users/bakorer/.rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.1.3 - #generating default wrappers..............
/Users/bakorer/.rvm/scripts/functions/support: line 490: 56810 Trace/BPT trap: 5       "$ruby_path" -rrbconfig -e '\
    File.open("'"$config_path"'","w") { |file|
      RbConfig::CONFIG.sort.each{|key,value|
        file.write("#{key.gsub(/\.|-/,"_")}=\"#{value.gsub("$","\\$")}\"\n")
      }
    }
  ' > /dev/null 2>&1
Empty path passed to certificates update, functions stack: requirements_osx_update_openssl_cert_run rvm_requiremnts_fail_or_run_action __rvm_osx_ssl_certs_ensure_for_ruby __rvm_osx_ssl_certs_ensure_for_ruby_except_jruby external_import_setup external_import main

Ruby 2.1.3 を使おうとすると dyld: Library not loaded: /usr/local/lib/libgmp.10.dylib という libgmp が読み込めないというメッセージが表示されてしまいます。

% rvm use 2.1.3
 
Using /Users/bakorer/.rvm/gems/ruby-2.1.3
dyld: Library not loaded: /usr/local/lib/libgmp.10.dylib
  Referenced from: /Users/bakorer/.rvm/rubies/ruby-2.1.3/bin/ruby
  Reason: Incompatible library version: ruby requires version 13.0.0 or later, but libgmp.10.dylib provides version 12.0.0

下記のように disable-binary フラグを付けて再インストールをすると直るようです。

% rvm reinstall 2.1.3 --disable-binary
 
ruby-2.1.3 - #removing rubies/ruby-2.1.3 - please wait
Checking requirements for osx_brew.
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/bakorer/.rvm/rubies/ruby-2.1.3, this may take a while depending on your cpu(s)...
ruby-2.1.3 - #downloading ruby-2.1.3, this may take a while depending on your connection...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 11.4M  100 11.4M    0     0  5118k      0  0:00:02  0:00:02 --:--:-- 5118k
ruby-2.1.3 - #extracting ruby-2.1.3 to /Users/bakorer/.rvm/src/ruby-2.1.3 - please wait
ruby-2.1.3 - #configuring - please wait
ruby-2.1.3 - #post-configuration - please wait
ruby-2.1.3 - #compiling - please wait
ruby-2.1.3 - #installing - please wait
ruby-2.1.3 - #making binaries executable - please wait
Rubygems 2.2.2 already available in installed ruby, skipping installation, use --force to reinstall.
ruby-2.1.3 - #gemset created /Users/bakorer/.rvm/gems/[email protected]
ruby-2.1.3 - #importing gemset /Users/bakorer/.rvm/gemsets/global.gems - please wait
ruby-2.1.3 - #generating global wrappers - please wait
ruby-2.1.3 - #gemset created /Users/bakorer/.rvm/gems/ruby-2.1.3
ruby-2.1.3 - #importing gemsetfile /Users/bakorer/.rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.1.3 - #generating default wrappers - please wait
ruby-2.1.3 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
Install of ruby-2.1.3 - #complete 
Ruby was built without documentation, to build it run: rvm docs generate-ri
Making gemset ruby-2.1.3 pristine - please wait
Making gemset ruby-2.1.3@global pristine - please wait

以上です。


参考情報

osx – Error when installing Ruby 2.1.3 with RVM – Stack Overflow

[Heroku] Ruby on Rails 4 + Mongoid + MongoHQ で「500 Internal Server Error」

Ruby on Rails 4 + Mongoid + MongoHQ on Heroku という環境で、1stデプロイしたら初っ端から「500 Internal Server Error」に遭遇しました。

エラーログ

 app/web.1:  I, [2014-02-11T01:13:25.785412 #2]  INFO -- : Started GET "/" for 223.132.104.209 at 2014-02-11 01:13:25 +0000 
 app/web.1:  I, [2014-02-11T01:13:25.790612 #2]  INFO -- : Processing by VideosController#index as HTML 
 app/web.1:  I, [2014-02-11T01:13:25.817544 #2]  INFO -- :   Rendered videos/index.html.haml within layouts/application (3.9ms) 
 app/web.1:  I, [2014-02-11T01:13:25.817786 #2]  INFO -- : Completed 500 Internal Server Error in 27ms 
 app/web.1:  F, [2014-02-11T01:13:25.819195 #2] FATAL -- :  
 app/web.1:  ActionView::Template::Error (:consistency is an unknown option. Valid options  :max_retries, :pool_size, :retry_interval, :refresh_interval, :down_interval, :ssl, :timeout, :instrumenter, :auto_discover.): 
 app/web.1:       9:     %th 
 app/web.1:      10:     %th 
 app/web.1:      11:  
 app/web.1:      12:   - @videos.each do |video| 
 app/web.1:      13:     %tr 
 app/web.1:      14:       %td= video.name 
 app/web.1:      15:       %td= video.url 
 app/web.1:    app/views/videos/index.html.haml:12:in `_app_views_videos_index_html_haml___1990342454341184297_70073653532820'

どうやら、conf/mongoid.yml の書き方が良くなかったみたいです。

MongoHQ 向けの動かない conf/mongoid.yml

production:
  sessions:
    default:
      uri: <%= ENV['MONGOHQ_URL'] %>
      options:
        consistency: :strong
        max_retries: 1
        retry_interval: 0

↓ 修正

MongoHQ 向けの正常動作する conf/mongoid.yml

production:
  sessions:
    default:
      uri: <%= ENV['MONGOHQ_URL'] %>

options の何がダメだったのか詳しく追ってないので、時間を見付けて最適なオプションを調べたいです。


参考情報

500 Internal Server Error using MongoLab + Rails 4 + Mongoid on Heroku – Stack Overflow

[MacOS] Homebrew で PostgreSQL をインストールする手順

Mac に Homebrew で postgresql をインストールしたので手順をご紹介します。

PostgreSQL

続きを読む