2016年9月27日火曜日

rubyのバージョンをあげたらrails consoleが起動しなくなった件

rubyのバージョンを2.1.3から2.3.1にあげることになったので、バージョンアップをしたところ、
bundle exec rails cでエラーが出るようになりました。
$ bundle exec rails c
/Users/xxx/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- bundler/setup (LoadError)
 from /Users/xxx/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
 from /Users/xxx/Documents/github/test/vendor/bundle/ruby/2.3.0/gems/spring-1.1.3/lib/spring/commands.rb:33:in `'
 from /Users/xxx/Documents/github/test/vendor/bundle/ruby/2.3.0/gems/spring-1.1.3/lib/spring/commands.rb:4:in `'
 from /Users/xxx/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
 from /Users/xxx/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
 from /Users/xxx/Documents/github/test/vendor/bundle/ruby/2.3.0/gems/spring-1.1.3/lib/spring/application.rb:77:in `preload'
 from /Users/xxx/Documents/github/test/vendor/bundle/ruby/2.3.0/gems/spring-1.1.3/lib/spring/xxx.rb:140:in `serve'
 from /Users/xxx/Documents/github/test/vendor/bundle/ruby/2.3.0/gems/spring-1.1.3/lib/spring/application.rb:128:in `block in run'
 from /Users/xxx/Documents/github/test/vendor/bundle/ruby/2.3.0/gems/spring-1.1.3/lib/spring/application.rb:122:in `loop'
 from /Users/xxx/Documents/github/test/vendor/bundle/ruby/2.3.0/gems/spring-1.1.3/lib/spring/application.rb:122:in `run'
 from /Users/xxx/Documents/github/test/vendor/bundle/ruby/2.3.0/gems/spring-1.1.3/lib/spring/application/boot.rb:18:in `'
 from /Users/xxx/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
 from /Users/xxx/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
 from -e:1:in `
'

調べてみると、bundle installでvendor/bundle配下に入れた時に、
springがvendor/bundleのbundlerを読み込もうとしてないよってエラーになっているようです。

更に調べてみると、springの1.6.3で直っているようです。

元のspringのバージョンが以下
$ bundle exec gem list|grep spring
spring (1.1.3)
spring-commands-rspec (1.0.2)

springのバージョンを最新にする
$ bundle update spring
$ bundle exec gem list|grep spring
spring (1.7.2)
spring-commands-rspec (1.0.2)

springを停止してからrails cをしてみると、いろいろメッセージでるけど、ちゃんと起動しました
$ bundle exec bin/spring stop
Spring stopped.
$ bundle exec rails c
Resque::Helpers will be gone with no replacement in Resque 2.0.0.
Running via Spring preloader in process 8207
Loading development environment (Rails 4.1.6)
irb: warn: can't alias context from irb_context.
Cannot read termcap database;
using dumb terminal settings.
irb(main):001:0> 


参考URL
http://qiita.com/koshigoe/items/2304ec081a9f036e8941

2016年8月17日水曜日

apache httpd serverがバージョンアップで起動しなくなった

apacheのhttpd serverがバージョンアップしたら起動しなくなったので調べました。
バージョンアップは意図して行ったのではなく、AWSのautoscaleで起動したインスタンスが
セキュリティアップデートでhttpd serverがバージョンアップしてしまった感じです。

バージョンアップ前のバージョン : 2.4.16-1.63.amzn1
バージョンアップ後のバージョン : 2.4.23-1.66.amzn1

バージョンアップ後、apacheが起動しないのでerror_logには以下の内容が残っていました。
[Tue Aug 16 19:16:23.815996 2016] [suexec:notice] [pid 3157] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Tue Aug 16 19:16:23.816582 2016] [proxy_hcheck:crit] [pid 3157] AH03262: mod_watchdog is required
AH00016: Configuration Failed

いろいろ調べてみたところ、mod_watchdog.soをloadする必要がありそうです。
元々の設定では読み込んでませんでした。
$ grep watchdog /etc/httpd/conf.modules.d/00-base.conf
#LoadModule watchdog_module modules/mod_watchdog.so

rpmに含まれているるconfでは読み込まれているようです。
$ grep watchdog /etc/httpd/conf.modules.d/00-base.conf.rpmnew 
LoadModule watchdog_module modules/mod_watchdog.so

mod_watchdog.soをloadするようにすると、無事に起動しました。


参考URL
http://forums.fedoraforum.org/showthread.php?t=310826