Rails和Foundation文件未找到或不可读

时间:2015-07-06 22:11:01

标签: ruby-on-rails zurb-foundation gemfile compass

所以我试图让zurb foundation 5与我的Ruby on Rails应用程序一起工作。有很多类似的问题,但我已经尝试了一切,似乎没有任何工作。大多数处理基础4,所以我觉得其他答案已经过时了。

我收到语法错误,并显示错误消息“要导入的文件未找到或不可读:基础/功能。”

这是我的Gemfile:



    source 'https://rubygems.org'


    # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
    gem 'rails', '4.2.0'

    group :development, :test do
        # Use sqlite3 as the database for Active Record
        gem 'sqlite3'
    end

    group :production do
        gem 'pg'
    end

    group :assets do
        # Use SCSS for stylesheets
        gem 'sass-rails'
        # Use Uglifier as compressor for JavaScript assets
        gem 'uglifier', '>= 1.3.0'
        # Use CoffeeScript for .coffee assets and views
        gem 'coffee-rails', '~> 4.1.0'
        # Foundation
        gem 'foundation-rails'
        # Compass
        gem 'compass-rails'

    end 
    # See https://github.com/sstephenson/execjs#readme for more supported runtimes
    # gem 'therubyracer', platforms: :ruby

    # Use jquery as the JavaScript library
    gem 'jquery-rails'
    # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
    gem 'turbolinks'
    # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
    gem 'jbuilder', '~> 2.0'
    # bundle exec rake doc:rails generates the API under doc/api.
    gem 'sdoc', '~> 0.4.0', group: :doc

    # Use ActiveModel has_secure_password
    # gem 'bcrypt', '~> 3.1.7'

    # Use Unicorn as the app server
    # gem 'unicorn'

    # Use Capistrano for deployment
    # gem 'capistrano-rails', group: :development

    group :development, :test do
      # Call 'byebug' anywhere in the code to stop execution and get a debugger console
      gem 'byebug'

      # Access an IRB console on exception pages or by using  in views
      gem 'web-console', '~> 2.0'

      # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
      gem 'spring'
    end

我有两个版本的基础,但我卸载了旧版本。我不知道问题还有什么,我感谢社区给予的任何帮助!

1 个答案:

答案 0 :(得分:1)

看起来它可能是基础Github repo上每this item路径设置的问题。如果你进入app / assets / stylesheets / foundation_and_overrides.scss并编辑@import行来阅读:

@import 'foundation';

而不是:

@import 'foundation/functions';

这有用吗? (来自this link的信息)

旁注:我认为资产组已在Rails4(Why did Rails4 drop support for "assets" group in the Gemfile)中删除。我猜这不会影响你得到的错误,但可能值得清理代码。