CodeKitでGumbyを使う際のコンパイルエラーについて


http://gumbyframework.com/customize
で、若干のカスタマイズを行いダウンロード、それからCodekitでコンパイルを行ったところ、エラーが発生しました。
CodeKit内蔵のsassとcompassが
Sass 3.3.7 (Maptastic Maple)
Compass 1.0.0.alpha.19
なので、マシンに既にインストールしていたsassとcompassをいったんアンインストール後、CodeKit内蔵のsassとcompassにバージョンを合わせて再インストールしました。しかし、やはりエラーは発生します。

http://q.hatena.ne.jp/1382598482
を参照に、config.rb内の記述を見直してみましたが、やはりエラーが発生します。具体的なエラーの内容はコメントで後述いたします(質問文が長すぎて記入できなかったので)。

現状は以下の通りです。
ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-darwin12]
Sass 3.3.7 (Maptastic Maple)
Compass 1.0.0.alpha.19
modular-scale-2.0.5
CodeKit 2.0.6(17018)
Rubyには詳しくないので、苦戦しております。よい解決方法をご存知の方がいらっしゃいましたら、ご教授お願いいたします。

回答の条件
  • 1人5回まで
  • 登録:
  • 終了:2014/06/28 00:30:05
※ 有料アンケート・ポイント付き質問機能は2023年2月28日に終了しました。
id:graphico

【テスト1-1】

compassのプラグインmodular-scaleを、gemでインストールしたものを読みにいくようにすればいいのかも?と思い、modular-scaleをインストール後config.rb内の記述を下記のように修正後、試しに_custom.scssを修正してみました。

=====

# Require any additional compass plugins here.

# Tell compass where to find local extensions

# If you followed directions and ran 'gem install modular-scale' comment the next two lines out:

# extensions_dir = "sass/extensions"

# Compass::Frameworks.register('modular-scale', :path => File.expand_path("#{extensions_dir}/modular-scale"))

# Uncomment these to use regular Ruby gems.

require 'modular-scale'

# require 'sassy-math'

・・・

=====

が、やはり下記のようなエラーが出てしまいました。

/////

gumby.scss

Compass was unable to compile one or more files in the project:

LoadError on line ["55"] of /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb: cannot load such file -- modular-scale

Run with --trace to see the full backtrace

/////

回答0件)

回答はまだありません

  • id:graphico
    補足の続きです。

    【テスト1-2】
    CodeKitの設定変更も試してみました。
    =====
    Preferences>OTHER TOOLS>Compassから
    Use the Compass executable at this path:
    /usr/bin/compass
    =====
    またまたエラーが・・・。
    /////
    gumby.scss
    Compass was unable to compile one or more files in the project:

    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: illegal switch in RUBYOPT: -E (RuntimeError)
    /////
  • id:graphico
    【テスト2】
    extensionsフォルダ内のmodular-scaleを読みに行くような記述も試してみました。
    =====
    # Require any additional compass plugins here.

    # Tell compass where to find local extensions
    # If you followed directions and ran 'gem install modular-scale' comment the next two lines out:
    extensions_dir = "sass/extensions"

    Compass::Frameworks.register('modular-scale', :path => File.expand_path("#{extensions_dir}/modular-scale"))

    # Uncomment these to use regular Ruby gems.
    # require 'modular-scale'
    # require 'sassy-math'
    ・・・
    =====
    やはりエラーが出てしまいました。
    /////
    gumby.scss
    Compass was unable to compile one or more files in the project:

    RuntimeError on line ["122"] of /***(ルートフォルダ)/sass/extensions/modular-scale/lib/modular-scale.rb: can't modify frozen Array
    Run with --trace to see the full backtrace
    /////
  • id:fiwa
    自分で試したわけじゃないですがこんな投稿が。
    https://plus.googleapis.com/wm/4/109732184634989520264/posts/QJgz2ZTUZkQ
  • id:graphico
    コメントいただき、ありがとうございます。
    こちらの方法を試してみたのですが、やはりエラーが出てしまいました。
    config.rbの記述変更も合わせて、質問終了までもう少しいろいろ試してみます!
  • id:fiwa
    実際にCodekitをダウンロードして試してみました。
    確かにGumbyからダウンロードしたプロジェクトをそのままコンパイルすると同様のエラーが出るのですが、上のコメントで書いた記事通りの処理( _modular-scale.scss の $base-size を $ms-base に置換、$ratio を $ms-ratio に置換)を加えたところエラーは発生せずコンパイルできました。
    私の場合、Sass, Compass, modular-scale はgemからインストールしたものではなく、すべてCodekit内蔵のものを使用しました(gemからすべてアンインストールしてCodekitを動かした)。
    これだと何か問題があるのでしょうか?
  • id:fiwa
    すみません、ちょっと訂正です。
    Codekitの操作をミスしていたようで、_modular-scale.scss でテキストの置換を行わなくても、エラーが起きずコンパイルできることが判りました。
    つまり、私の環境ではgemからすべてアンインストールしてCodekit内蔵のコンパイラを使用すれば大丈夫だったということです。大変失礼しました。
  • id:graphico
    詳細なコメントを頂き、ありがとうございました。
    fiwaさんの環境では、_modular-scale.scss でテキストの置換を行わなくてもコンパイル可能だったのですね。

    私のほうは、いただいたコメントの
    https://plus.google.com/109732184634989520264/posts/QJgz2ZTUZkQ
    を参考にしながら、/sass/extensions/modular-scale/stylesheets/_modular-scale.scss内を
    ---------------
    $base-size

    $ms-base
    ---------------
    $ratio

    $ms-ratio
    ---------------
    上記のように置換、

    さらにconfig.rbを下記のように変更(Gumby内蔵のmodule-scaleを読みに行くように?変更)したところ、コンパイルできました!!
    # Require any additional compass plugins here.

    # Tell compass where to find local extensions
    # If you followed directions and ran 'gem install modular-scale' comment the next two lines out:
    extensions_dir = "sass/extensions"

    Compass::Frameworks.register('modular-scale', :path => File.expand_path("#{extensions_dir}/modular-scale"))

    # Uncomment these to use regular Ruby gems.
    # require 'modular-scale'
    # require 'sassy-math'
  • id:graphico
    fiwaさん、問題解決につながるアドバイスありがとうございました。
    つきましては、fiwaさんにポイントを差し上げたいのですが、コメントしていただいた方にポイントを配分することはできないようでして・・・。回答欄への入力いただいたユーザーにポイントが配分できるようです(間違っていたらすみません)。お手数ですが、いったんご回答欄にご入力いただければポイントを配分させていただきます。
    よろしくお願いいたします。
  • id:fiwa
    解決とのことで何よりです。
    ポイントにつきましてはお気になさらず。質問は1週間経過した時点で回答がついていなければ自動的にキャンセルされます(空気読めない回答者が突っこんでこなければですが)。手動でキャンセルもできるそうですが、回答がついていない状態で手動キャンセルの場合は質問自体が消えてなくなるようです。その辺はご随意に。
  • id:graphico
    ポイントの件、承知いたしました。
    この質問については、もしかしたら他の方の参考になるかもしれませんので、できるだけ残したいと思っております。ですので自動的に終了になるまでこのままにしておこうと思います。
    質問についての回答は、締め切らせていただきます。

    fiwaさん、ありがとうございました。

この質問への反応(ブックマークコメント)

「あの人に答えてほしい」「この質問はあの人が答えられそう」というときに、回答リクエストを送ってみてましょう。

これ以上回答リクエストを送信することはできません。制限について

回答リクエストを送信したユーザーはいません