Issues with foundation-rails gem - ruby-on-rails

I've generated a brand new rails app. I am using ruby version 2.3.3 and rails version 5.1.0 rc. Following the instructions on github:
1) I've added the foundation-rails gem to the gemfile
2) I've run the bundle install command
3) Run the rails g foundation:install command
4) Added the following import to my application.scss file:
#import "foundation_and_overrides";
5) Added the following statement to my application.js file:
//= require foundation
and the following statement to the my application.js file which is automatically generated by the install process:
$(function(){ $(document).foundation(); });
6) After generating a simple home controller with the index action to start building the application I run the server and I get the following error:
Any help ? I'm trying and trying. Cannot sort out the issue.

I don't know which foundation gem you are using but I would suggest to fetch this kind of gems from rails-assets.org
You can check the below url for the installation and usage of zurb-foundation v6 gem.
https://rails-assets.org/#/components/zurb--foundation-sites
I hope it helps.

Related

Add angular-chart.js to Rails application.js file

I'm trying to setup angular-chart.js in an Angular on Rails application, per github instructions. But the documentation is not specifically for Rails so I'm running into errors.
Installation instruction: http://jtblin.github.io/angular-chart.js/
For reference,
installed via bower, bower install angular-chart.js --save
added as dependency, angular.module('myModule', ['chart.js']);.
Documentation then recommends then adding <script src="bower_components/angular-chart.js/dist/angular-chart.js"></script>, but this file is not found if I add this line (think because using Rails).
Since the application is Angular ontop of Rails, I assume it needs to be added to Rails application.js file. As otherwise there is an angular no module error.
But I'm not sure exactly what needs to be added to application.js. I've tried:
chart.js
angular-chart.js
angular-chart
(prefaced by //= require)
But everything results in a Rails error,
Sprockets::FileNotFound in Boards#index
couldn't find file 'chart.js' with type 'application/javascript'
Is there a way to find out exactly what needs to be added to application.js? Or some other way to solve this?
(Apologies if this is difficult to follow.)
You can use (as you mentioned in discussion) gem browserify-rails to easily pick-up bower/node.js packages. Include gem into Gemfile, bundle install, and then install npm/bower package into app.
gem 'browserify-rails'

Add rb-grib gem to Rails application

I'm new to Rails and I got a problem.
My new project requires rb-grib gem (link to ruby gems: https://rubygems.org/gems/rb-grib/versions/0.2.2). This gem requires GRIB API library, I installed it using brew install grib-api. It works in irb and .rb scripts. I need to use it in my Rails app, but I get an error LoadError: cannot load such file -- numru/grib. What I need to do to make it work and deploy to Heroku in future?
You need to add
require 'numru/grib'

Bootstrap not working after Rails migration to 4.1

I have a working Rails 4.0 + Bootstrap 2.3 application. Now I want to update to Rails 4.1.
After updating the gems and starting the server, I receive this message:
Sass::SyntaxError - File to import not found or unreadable: bootstrap-responsive.
It point to a line in bootstrap_and_overrides.css.scss where I have this:
#import "bootstrap";
#import "bootstrap-responsive";
Both files are in the assets/stylesheets folder. When I remove the last import, the application starts, but I miss a lot of styling. What is going wrong here, any ideas?
I made 2 mistakes with this: first I did a bundle update instead of bundle update rails, so that all gems where updated, also the bootstrap and sass related gems. The second error was that I didn't have specific version numbers for the bootstrap and sass related gems in my Gemfile.
The solution was simple: remove the branch, create a new one, check Gemfile.lock for the current versions of all bootstrap and sass related gems and add these to Gemfile. Then do a bundle update rails and sit back and enjoy!

is twitter-bootstrap-rails compatible with rails 4?

Is twitter-bootstrap-rails compatible with rails 4 and ruby 2.0. I was having tons of trouble installing this on my rails app after going through two railscast and the readme on its github page. Sorry I couldn't find a straight forward answer both in the repo's issues and from googling online.
on the repo page it says
Twitter Bootstrap for Rails 3.1 Asset Pipeline
To get bootstrap in Rail 4.
Add gem 'bootstrap-sass' to your Gemfile.
and then add #import "bootstrap-sprockets";
and #import "bootstrap";
to the top of your application.scss file. Don't forget to run bundle install.

formtastic-bootstrap installation

I just installed the formatastic-bootstrap gem for Ruby on Rails and Twitter Bootstrap. Per the readme file, I added *= require formtastic-bootstrap to application.css, I created a file called config/initializers/formtastic.rb whose contents are Formtastic::Helpers::FormHelper.builder = FormtasticBootstrap::FormBuilder, and I ran bundle install. When I try to start my rails server now, I get the following error.
/Users/wrightgd/.rvm/gems/ruby-1.9.3-p0/gems/formtastic-bootstrap-1.1.1/lib/formtastic-bootstrap/helpers/buttons_helper.rb:5:in
`': cannot load such file --
formtastic/helpers/buttons_helper (LoadError)
What am I doing wrong here? Thank you in advance for the help!
According to this latest version of formtastic is not compatible with formtastic-bootstrap. Try older version gem 'formtastic', " ~> 2.1.1"

Resources