foundation 3 sass not compiling - ruby-on-rails

Up until recently my SaSS has been compiling without a hitch, earlier tonight I started to get the following errors.
I have tried rejigging my Gemfile, but I can not for the live of me workout how to get the files to compile and serve the correct css.
Started GET "/assets/application.css" for 127.0.0.1 at 2013-03-11 21:27:35 +1100
Error compiling asset application.css:
Sass::SyntaxError: File to import not found or unreadable: foundation/common/ratios.
Load paths:
Sass::Rails::Importer(/Users/paulmcguane/Sites/Rails/teammngt/app/assets/stylesheets/app.css.scss)
/Users/paulmcguane/Sites/Rails/teammngt/app/assets/stylesheets
/Users/paulmcguane/.rvm/gems/ruby-1.9.3-p125/gems/compass-0.12.2/frameworks/blueprint/stylesheets
/Users/paulmcguane/.rvm/gems/ruby-1.9.3-p125/gems/compass-0.12.2/frameworks/compass/stylesheets
Compass::SpriteImporter
(in /Users/paulmcguane/Sites/Rails/teammngt/app/assets/stylesheets/app.css.scss)
Served asset /application.css - 500 Internal Server Error
gem file
source 'https://rubygems.org'
gem 'rails', '3.2.3'
gem 'therubyracer', :platform => :ruby
gem 'better_errors'
# Database Gems
gem 'yaml_db'
gem 'thin'
gem 'pg'
gem 'rb-readline'
#Application Processing
gem 'haml'
gem 'json'
gem 'spreadsheet'
gem 'paperclip'
#Phone conversion
gem 'countries'
gem 'phony'
gem 'phony_rails'
#Application required gems
gem 'zurb-foundation'
gem 'twilio-ruby'
gem 'simple-navigation', '~> 3.7.0'
gem 'kaminari'
gem 'client_side_validations'
gem 'event-calendar', :require => 'event_calendar'
gem 'watu_table_builder', :require => 'table_builder'
gem 'best_in_place'
gem 'to_xls', :git => 'https://github.com/dblock/to_xls.git', :branch => 'to-xls-on-models'
#Auth and Management
gem 'devise'
gem 'cancan'
gem 'switch_user'
gem 'paper_trail', '~> 2'
gem 'omniauth-facebook'
gem 'bcrypt-ruby', '~> 3.0.0'
gem 'fb_graph'
#gem 'announcements'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'uglifier', '>= 1.0.3'
# Add these gems
gem 'compass-rails'
gem 'zurb-foundation'
end
gem 'jquery-rails'
gem 'compass'

Judging from the look of your gemfile, you're not specifying a version of zurb-foundation.
The short answer is, specify gem 'zurb-foundation', '= 3.2.5' in your gemfile instead.
Otherwise, if you've run a bundle update anytime recently, your zurb-foundation gem has upgraded to 4.x which does not include a path to foundation/common/ratios anymore.
I was banging my head against the wall with this on Heroku, which I talk about in Avoid a Headache: Precompiling Zurb (Foundation) on Heroku

Related

how to fix ruby bundle install error?

Everytime I try to run bundle install inside a local copy of this RoR project directory, I get an error. I have rvm installed with ruby 2.1.2 and 2.2.2, rails is installed as well. I am running via vagrant on this box, Ubuntu 14.04 with 1gb of ram tho I don't think any of this is relevant? I can't seem to find the missing file the error is pointing to as well?
Update: Here is the Gemfile
source 'https://rubygems.org'
ruby '2.2.2'
gem 'rails', '~> 4.1.6'
#gem 'catarse_api', path: '~/code/catarse_api'
gem 'catarse_api', github: 'catarse/catarse_api'
gem 'protected_attributes'
gem 'rails-observers'
gem 'sidekiq', '~> 3.1.3'
# Turns every field on a editable one
gem "best_in_place", :git => "git://github.com/bernat/best_in_place", ref: "ee95961e639022e6aa528704b8cb4789596ea61b"
# State machine for attributes on models
gem 'state_machine', require: 'state_machine/core'
# Database and data related
gem 'pg', '0.17.1'
gem 'dbhero', '>= 1.1.6'
gem 'postgres-copy'
gem 'pg_search'
gem 'i18n_alchemy'
gem 'schema_plus'
gem 'chartkick'
gem 'catarse_settings_db', '>= 0.1.0'
# Notifications
gem 'user_notifier', '~> 0.0.5'
# Mixpanel for backend tracking
gem 'mixpanel-ruby'
gem 'mixpanel_client'
# Payment engines
gem 'catarse_moip', '~> 3.2.0'
gem 'catarse_pagarme', '2.6.8'
#gem 'catarse_pagarme', path: '../catarse_pagarme'
# Decorators
gem 'draper'
# Frontend stuff
gem 'slim-rails'
gem 'jquery-rails'
gem 'browser'
gem "cocoon"
# Static pages
gem 'high_voltage'
# Authentication and Authorization
gem 'omniauth'
gem 'omniauth-twitter'
gem 'omniauth-facebook'
gem 'devise'
gem 'ezcrypto'
gem 'pundit'
# Email marketing
gem 'catarse_monkeymail', '>= 0.1.6'
# HTML manipulation and formatting
gem 'simple_form'
gem 'mail_form'
gem "auto_html"
gem 'kaminari'
gem 'redactor-rails', github: 'catarse/redactor-rails'
# Uploads
gem 'carrierwave', '~> 0.10.0'
gem "mini_magick"
# Other Tools
gem 'to_xls'
gem 'ranked-model'
gem 'feedjira'
gem 'inherited_resources'
gem 'has_scope', '>= 0.6.0.rc'
gem 'spectator-validates_email', require: 'validates_email'
gem 'video_info', '>= 1.1.1'
gem 'httparty', '~> 0.6.1' # this version is required by moip gem, otherwise payment confirmation will break
# Translations
gem 'http_accept_language'
gem 'routing-filter', '~> 0.4.0.pre'
# Payment
gem 'moip', github: 'catarse/moip-ruby', ref: 'c0225ad71645cd1df35dafa1e45c9f092b3abb9e'
gem 'httpclient', '>= 2.2.5'
group :production do
# Gem used to handle image uploading
gem 'fog', '>= 1.3.1'
# Workers, forks and all that jazz
gem 'unicorn'
# Enabling Gzip on Heroku
# If you don't use Heroku, please comment the line below.
gem 'heroku-deflater', '>= 0.4.1'
# Make heroku serve static assets and loggin with stdout
#gem 'rails_on_heroku'
gem 'rails_12factor'
# Monitoring with the new new relic
gem 'newrelic_rpm'
# Using dalli and memcachier have not presented significative performance gains
# Probably this is due to our pattern of cache usage
# + the lack of concurrent procs in our deploy
#gem 'memcachier'
#gem 'dalli'
end
group :development do
gem "letter_opener"
gem 'foreman'
gem 'better_errors'
gem 'binding_of_caller'
gem 'thin'
# Uncomment only for optimization, should be commented on master branch
# gem 'rack-mini-profiler'
# gem 'ruby-prof'
end
group :test, :development do
gem 'rspec-rails', '~> 3.1'
gem 'rspec-mocks'
gem 'rspec-its'
gem 'rspec-collection_matchers'
gem 'pry'
gem 'jasmine-rails'
end
group :test do
gem 'zonebie'
gem 'fakeweb'
gem 'poltergeist'
gem 'launchy'
gem 'database_cleaner'
gem 'shoulda'
gem 'factory_girl_rails'
gem 'capybara', '~> 2.2.0'
gem 'selenium-webdriver'
end
gem 'sass-rails'
gem 'coffee-rails'
gem 'compass-rails'
gem 'uglifier'
gem 'compass-960-plugin'
gem 'sprockets'
# FIXME: Not-anymore-on-development
# Gems that are with 1 or more years on the vacuum
gem 'weekdays'
ps: please point out any relevant info i should provide as well to help determine the cause.
Apparently there was an issue with bundler, here's how this worked out for me:
cleanup by running gem cleanup bundler
reinstall bundler via gem install bundler

Why am I getting this simple error when using `acts_as_taggable_on`?

I wanted to set up ActsAsTaggableOn.strict_case_match = true
According to http://5minutenpause.com/blog/2012/11/20/careful-where-you-get-your-gems-from/, it seems I have to download the gem from github. So I made it that way and tried to run App.
However, it returns this error:(
Error message: (I've tried bundle install but still the same error message!)
git://github.com/mbleigh/acts-as-taggable-on.git (at master) is not checked out. Please run `bundle install` (Bundler::GitError)
Exception class:
PhusionPassenger::UnknownError
Here are my codes!
config/initializer/tag_list.rb
ActsAsTaggableOn.delimiter = ','
ActsAsTaggableOn.remove_unused_tags = true
ActsAsTaggableOn.strict_case_match = true
Gemfile
gem 'acts-as-taggable-on', git: 'git://github.com/mbleigh/acts-as-taggable-on.git'
I made a try to change the source to download the gem directly from to rubyorg, not from the Github. It's just like this.
gem 'acts-as-taggable-on', '2.3.3'
Now it returns this error:(
Error message:
undefined method `strict_case_match=' for ActsAsTaggableOn:Module
How can I solve this?
UPDATE:
Gemfile
source 'https://rubygems.org'
gem 'rails', '3.2.11'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'mysql2'
gem 'execjs'
gem 'therubyracer'
gem 'devise', '2.0.1'
gem 'recaptcha', :require => 'recaptcha/rails'
gem 'paperclip', "~> 3.0"
gem "cocaine"
gem 'mailboxer', '0.7.0'
gem 'sunspot_rails'
gem 'sunspot_solr'
group :development do
gem 'better_errors'
gem 'binding_of_caller'
#gem 'rack-mini-profiler'
end
gem 'progress_bar'
gem 'kaminari', '0.14.0'
gem "sunspot_with_kaminari", '~> 0.1'
gem 'i18n_generators'
gem 'ancestry'
gem 'acts-as-taggable-on', '2.3.3'
gem 'acts_as_commentable_with_threading'
gem 'twitter-bootstrap-rails'
gem "less-rails"
gem 'crummy', '~> 1.6.0'
gem 'rails3_acts_as_paranoid'
gem 'galetahub-simple_captcha', :require => 'simple_captcha'
gem "acts_as_follower"
gem "jpmobile"
gem "rqrcode-rails3"
gem 'acts_as_votable', '~> 0.4.0'
gem 'rails3-jquery-autocomplete'
gem "cancan"
gem 'rinku', '1.5.1'
gem 'dalli'
gem "auto_html", '1.6.0'
gem "rails_autolink"
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
gem 'jquery-ui-rails'
end
gem 'jquery-rails'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the app server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'debugger'
The problem is that the version 2.3.3 from acts-as-taggable-on was released 9 months ago and doesn't include the strict_case_match feature.
Your Gemfile has too look this this:
gem 'acts-as-taggable-on', git: 'git://github.com/mbleigh/acts-as-taggable-on.git'
the same way you had, and run:
bundle update acts-as-taggable-on
if that doesn't work, just delete your Gemfile.lock and run bundle install and bundle update
notice that its a development version of the gem, not ready for production, but you can take the risk and be a an alpha user of the gem and report any issue you find :)

Mercury: SyntaxError: cannot return a value from a constructor

Working on a fresh install of rails 3.2.8 and getting an error when compiling after adding Mercury:
SyntaxError: cannot return a value from a constructor: "this.element" in class Button
(in /home/*********/**************/vendor/bundle/ruby/1.8/bundler/gems/mercury-0c048033cd79/app/assets/javascripts/mercury/toolbar.button.js.coffee)
I've successfully installed Mercury using Rails 3.2.3, but haven't been able to figure why this wouldn't be working.
Any ideas?
source 'https://rubygems.org'
gem 'rails', '3.2.8'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'mysql2'
gem 'bootstrap-sass'
gem 'simple_form'
gem 'json'
gem 'ckeditor'
gem 'mercury-rails', :git => 'https://github.com/jejacks0n/mercury.git'
gem 'jquery-rails'
# gem 'jquery-ui-rails'
gem "paperclip", "~> 2.7"
# To use ActiveModel has_secure_password
gem 'bcrypt-ruby', '~> 3.0.0'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'therubyracer', '0.10.2', :platforms => :ruby
gem 'libv8', '~> 3.3.10'
gem 'execjs'
gem 'uglifier', '>= 1.0.3'
end
https://github.com/jejacks0n/mercury/issues/349
i guess you need to lock into coffeescript 1.4.0
this fixed my issue.
Apparently, there is a fix, which is in the github repo, but not on rubygems, yet. If you don't want to downgrade coffee-script, just specify the repository in the Gemfile:
# Gemfile
# ...
gem 'mercury-rails', git: 'git://github.com/jejacks0n/mercury'
and run bundle update mercury-rails, afterwards. This fixed this problem for me without the need to downgrade coffee-script.
Here's what you actually need to type into your gemfile:
gem 'coffee-script-source', '1.4.0'

Could not find bootstrap-sass-2.2.2.0

I'm trying to get Rails up and running. I'm able to run bundle install successfully, but when I attempt to start the server using rails s I get the following message:
Could not find bootstrap-sass-2.2.2.0
Run `bundle install` to install missing gems.
Here's my Gemfile:
source 'https://rubygems.org'
gem 'rails', '3.2.9'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'pg'
gem 'rails_admin'
gem 'devise'
gem 'cancan'
gem 'simple_form'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
# The following three gems are used for Bootstrap
# See: https://github.com/seyhunak/twitter-bootstrap-rails
#NOTE: For therubyracer, run "gem install libv8" and "gem install therubyracer -v '0.11.0'"
end
gem 'therubyracer', '0.11.0beta8'
gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-bootstrap-rails.git'
gem "less-rails"
gem 'bootstrap-sass', '~> 2.2.2.0'
gem 'jquery-rails'
I made a mistake by adding a gem into the gem file with a capital letter before running bundle install. Look over that you dont have any capital letters with the gems you are adding.
Should look like this:
gem 'bootstrap-sass'
Should not look like this:
gem 'Bootstrap-sass'

Backbone JS and Rails 3.2 Error in Production Server

I got an issue here. I'm working on an app built with Rails and Backbone. In my development environment, everything's run well, but when I deployed it to the production server, this error showed in my firebug :
TypeError: this._reset is not a function
...;return a.success=function(d,e,f){ba.add?"add":"reset",c&&c(b,...
Could anyone help me on this?
Revision 1
I've precompiled the assets and this is my Gemfile :
source 'https://rubygems.org'
gem 'rails', '3.2.0'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'mysql2'
gem 'devise', '1.5.3'
gem 'friendly_id'
gem 'pry'
gem "paperclip", "~> 2.5.0"
gem "kaminari"
#gem "ckeditor", "3.7.0.rc3"
gem "tinymce-rails"
gem "puma"
gem "tlsmail"
gem "rails-erd"
gem "juggernaut"
gem "thin"
#gem 'execjs'
#gem 'therubyracer'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
Anyway, I got this new fact. I tried run the app in production mode in my local machine and it ran well, but not in my server. Is there anything that I forgot to install in my server?
It seems that you install backbone manually.
I recommend using something like backbone-rails gem to help integrating rails and backbone gracefully. Something like https://github.com/codebrew/backbone-rails (there are also other gem around, but codebrew implementation is one of the most popular).
This is to ensure consistent dependency across machines.
Don't forget to read about asset pipeline, most of my problem with js and rails in production comes from my lack of understanding regarding rails 3 asset pipeline: http://guides.rubyonrails.org/asset_pipeline.html
And if you're serious about integrating backbone and rails, https://learn.thoughtbot.com/products/1-backbone-js-on-rails is an indispensable resource (at US$ 49)
EDITED:
This is my typical Gemfile when creating backbone.js & rails app:
group :assets do
gem 'haml-rails', '~> 0.3.4'
gem 'sass-rails', '~> 3.2.5'
gem 'bootstrap-sass', '~> 2.0.3.1'
gem 'compass', '~> 0.12.1'
gem 'compass-rails', '~> 1.0.2'
gem 'coffee-rails', '~> 3.2.2'
gem 'jquery-rails', '~> 2.0.2'
gem 'jquery-ui-rails', '~> 1.1.0'
gem 'handlebars_assets', '~> 0.4.4'
gem 'rails-backbone', '~> 0.7.2'
# javascript
gem 'haml_coffee_assets', '~> 1.2.0'
gem 'execjs', '~> 1.4.0'
gem 'therubyracer', '~> 0.10.1'
gem 'uglifier', '~> 1.2.4'
gem 'yajl-ruby', '~> 1.1.0'
end

Resources