I am building a new app from scratch. Just started last week learning RoR. I've been following tutorials that work perfect except:
I was trying to install Bootstrap when the Error came out.
SO:
Windows 10
Versions of the enviroment I am working are:
Ruby 2.2.4 Rails 4.2.5.1
Followed the instructions of https://github.com/twbs/bootstrap-sass
step by step. (Installed gems, put the @import
lines, etc)
The error I get is the following:
ExecJS::ProgramError...
...application.html.erb where line #5 raised:
TypeError: Object doesn't support this property or method
Googled and found a solution:
If I change to 'default' from 'application' in application.html.erb the Error disappears, but I do not get the bootstrap styling. Everything just goes back to normal.
Files:
Gemfile
source 'https://rubygems.org'
gem 'rails', '4.2.5.1'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
group :development, :test do
gem 'sqlite3'
gem 'byebug'
end
group :development do
gem 'web-console', '~> 2.0'
end
group :test do
gem 'minitest-reporters'
gem 'mini_backtrace'
gem 'guard-minitest'
end
group :production do
gem 'pg'
gem 'rails_12factor'
end
application.css.scss
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
* compiled file so the styles you add here take precedence over styles defined in any styles
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
* file per style scope.
*
*/
@import "bootstrap-sprockets";
@import "bootstrap";
application.js
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file.
//
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require bootstrap-sprockets
application.html.erb
<%= stylesheet_link_tag 'application', :media => "all" %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %> ...
Another issue that I encounter:
When using link_to
for the action of destroy
, nothing seems to change.
Googling, I found that if I change to button_to
, the destroy
action works perfectly, but it is an issue I think that should be corrected.