2015年5月6日水曜日

vagrant upに失敗する

vagrant upすると起動できなくなった。
$ vagrant up
The provider 'virtualbox' that was requested to back the machine
'default' is reporting that it isn't usable on this system. The
reason is shown below:

VirtualBox is complaining that the kernel module is not loaded. Please
run `VBoxManage --version` or open the VirtualBox GUI to see the error
message which should contain instructions on how to fix this error.
カーネルモジュールがロードされてないっぽい。

言われるままに実行。
$ VBoxManage --version
WARNING: The vboxdrv kernel module is not loaded. Either there is no module
         available for the current kernel (3.13.0-52-generic) or it failed to
         load. Please recompile the kernel module and install it by

           sudo /etc/init.d/vboxdrv setup

         You will not be able to start VMs until this problem is fixed.
4.3.26r98988
なんかWARNINGでた。

言われるままに実行、再。
$ sudo /etc/init.d/vboxdrv setup
Stopping VirtualBox kernel modules ...done.
Uninstalling old VirtualBox DKMS kernel modulesError! Could not locate dkms.conf file.
File:  does not exist.
 ...done.
Trying to register the VirtualBox kernel modules using DKMSError! DKMS tree already contains: vboxhost-4.3.26
You cannot add the same module/version combo more than once.
 ...failed!
  (Failed, trying without DKMS)
Recompiling VirtualBox kernel modules ...done.
Starting VirtualBox kernel modules ...done.
カーネルモジュールをリコンパイルしてスタートdone。

これで、vagrant upできるようになた。

[Rails]InheritedResources::Baseを継承したコントローラーになってしまう

scaffoldしたコントローラーがInheritedResources::Baseを継承したものになってたので原因調査。

結論としては、activeadminの依存で入ったgem inherited_resourcesの影響。
ActiveAdmin's use of Inherited Resources overrides `rails g scaffold my_articles` #3114
config.app_generators.scaffold_controller = :scaffold_controller
をconfig/application.rbに追加しろとのこと。

やりたいことを簡単に実現できる反面何してるのか良く理解できていないことが多い。
Rails 奥が深い。

2015年5月5日火曜日

[Rails]rake db:resetとrake db:migrate:reset

Ruby on Rails チュートリアルで知ったrake db:resetを何の疑問も持たずに使っていたが、activeadminを使っていて少々困ったので調べてみた。

2015年4月21日火曜日

[railstutorial] uninitialized constant RelationshipsController (NameError)

Rails Tutorialがまだ終わっていない。なんだかんだ2ヶ月くらい時が経っている。
時間あったので写経を再開してたら、なんかエラーがデター。
relationships_controller_spec.rb:3:in `': uninitialized constant RelationshipsController (NameError)

2015年4月5日日曜日

MySQL5.7インストールしてみる

最近mysqlの進歩には全く着いていけてないので、UbuntuにMySQL5.7を入れて遊んでみる。

2015年3月29日日曜日

久しぶりにRails勉強再開

未だにrails tutorial終わってない。で、rails console開こうとしたらこんなエラーが・・・。
There is a version mismatch between the spring client and the server. 
You should restart the server and make sure to use the same version. 

CLIENT: 1.3.3, SERVER: 1.3.2

2015年3月17日火曜日

[読書]フリー ―<無料>からお金を生みだす新戦略


フリー ―<無料>からお金を生みだす新戦略』読了。なんだか最近読書のペースは落ちている。
勉強会やセミナーイベント行ったり、ruby on rails勉強してたりするから仕方ない。

フリーの仕組みについてはまぁまぁ理解が深まったので良かったかな。
巻末付録の「潤沢さに根ざした思考法の10原則」も「フリーを利用した50のビジネスモデル」も参考になった。
ここに載せたいくらいだが、やり過ぎなのでやめておく。これは気になったときには読み返すことにしよう。