0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

spring の実行がエラーになったので入れなおした(2014/1)

Last updated at Posted at 2014-01-26

発生したエラー

こんなんでた

環境

  • ruby 2.1.0p0
  • Rails 3.2.16
% rails -v
/Users/dany/.rbenv/versions/2.1.0/lib/ruby/2.1.0/rubygems/requirement.rb:18: stack level too deep (SystemStackError)

原因になりそうなこと

  • ruby を 2.1.0p0 にあげていたのは割りと最近 (rbenv 利用)
  • 前日に Rails 4.1 のプロジェクトで長時間遊んでいた
    • Rails 4.1 から bin/rails あるけど、関係ないよね。。
  • そんなこんなで spring も ruby のバージョン上げたとこでさらに上げたりしてた

で入れなおし

手順

  • gem install
  • binstub 作成
  • direnv の設定(結果そのまま)

gem install

% gem install spring spring-commands-rspec
Successfully installed spring-1.1.0
Successfully installed spring-commands-rspec-1.0.1
2 gems installed

おお、バージョンあがったのか。

binstub 作成

% rm -r bin # 既存のを削除
% % spring binstub rspec rails rake # とりあえず必要なやつだけ。必要なら --all でいける
* bin/rspec: generated with spring
* bin/rails: spring inserted
* bin/rake: generated with spring

direnv 設定

binstub は bin の下に作られるので、rails プロジェクトに入った時だけそこをパスに入れて欲しい。
spring 公式 にもそうしろってなってたと思うが、未だにこれであってるのかよくわからない。。

$ cd railsプロジェクト
$ export EDITOR=vim # EDITOR が最初からあればいらないです
$ direnv edit .

.envrcというファイルが開かれるので、カレントをパスに加える

.envrc
export PATH=$PWD/bin:$PATH

とりあえず上手くいったのでよしとします。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?