cannot load such file -- bootstrap/sass - ruby-on-rails

I am getting
cannot load such file -- bootstrap/sass
I have installed bootstrap-sass-2.0.3.1, sass-3.1.18, sass-rails-3.2.5, coffee-rails-3.2.2 and uglifier-1.2.4
Why would I be getting this error?

I was being a bit ahead of myself, appears I hadn't run gem install bootstrap-sass yet...
Oops.

put bootstrap-sass in the assets group of the Gemfile
group :assets do
gem 'sass-rails', '~> 3.2.5'
gem 'coffee-rails', '~> 3.2.2'
gem 'uglifier', '>= 1.2.4'
gem 'bootstrap-sass', '~> 2.0.3.1'
end

Related

Rails Griddler-ses causing dependancy issues

I added the griddler and griddler-ses gem to my rails project and now I am getting this error. When I remove the griddler-ses gem the error goes away.
stack.rb:108:in `assert_index': No such middleware to insert before: ActionDispatch::ParamsParser (RuntimeError)
here is my Gemfile
gem 'rails', '~> 5.0.1'
gem 'sinatra', '2.0.0.beta2'
gem 'puma', '~> 3.0'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.2'
gem 'jquery-rails', '~> 4.2.2'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'
gem 'spree', '~> 3.2.0.beta'
gem 'spree_auth_devise', '~> 3.2.0.beta'
gem 'spree_gateway', '~> 3.2.0.beta'
gem 'mysql2'
gem 'faker'
gem 'carrierwave', '~> 1.0'
gem 'stripe'
gem 'skeleton-rails'
gem 'griddler'
gem 'griddler-ses'
Does anyone have an idea of what is causing this error?
Judging by the pull requests and issues on the griddler-ses GitHub page, it currently doesn't support Rails 5.
You may want to log this as an issue there, as the gem will need to be updated to account for the change to ParamsParser in Rails 5.

Gemfile syntax error: when trying bundle install

source 'https://rubygems.org'
gem 'rails', '4.0.0'
gem 'sass-rails', '~> 4.0.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 1.2'
gem 'bootstrap-sass', '~> 3.0.3.0'
group :development, :test do
gem 'sqlite3'
end
group :production do
gem 'pg'
gem 'rails_12factor'
end
group :doc do
gem 'sdoc', require: false
end
// When I try to bundle install --without production I get an error message.
This line looks a bit wrong gem 'bootstrap-sass', '~> 3.0.3.0'
Usually you would expect the semantic versioning to go to three levels only
I suspect the problem isn't being picked up when bundling locally.
The bundle install command installs the gems based on the Gemfile.lock file in your project. Try running a bundle update instead - this may resolve any version conflicts you may be having in your Gemfile (depending on if you've made any updates).

twitter-bootstrap-rails not working on heroku

I am working on ROR app, the app is working fine on local host but when on heroku "http://niveshi.herokuapp.com/portfolio/create" bootstrap is not working and even javascript code is not working. This is my gem file :
source 'https://rubygems.org'
gem 'rails', '3.2.12'
gem "mongoid", "~> 3.1.0"
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.1.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'less-rails'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
gem 'delayed_job_mongoid'
gem 'rb-readline', '~> 0.4.2'
gem 'mechanize'
gem 'debugger'
gem 'twitter-bootstrap-rails'
Any guesses where I am wrong.
Use this on production.rb
config.assets.compile = true
If it is not work Then do the following things.
rake assets:precompile it will generate assets file in your public folder, commit all those file then push the code into heroku server.
Try rake assets:precompile and then upload again to Heroku.
Done , actually this should be out of assets
gem 'sass-rails', '~> 3.1.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'less-rails'
I got the same problem fixed with adding
a. gem 'rails_12factor'
b. bundle exec rake assets:precompile

Rails: Stack level too deep (SystemStackError) with Cucumber 1.2.4 in Windows Command Prompt 64bit

As I'm following railstutorial.org to learn cucumber, the test program keeps crashing.
When I type in: bundle exec cucumber features/ to run signing_in.feature, the command line complains that:
stack level too deep (SystemStackError)
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1.gems/cucumber-1.2.4/lib/cucumber/parser/gherkin_builder.rb:100
Below is copied from my gemfile:
source 'https://rubygems.org'
gem 'rails', '3.2.13'
gem "bootstrap-sass", "~> 2.3.1.0"
gem 'bcrypt-ruby', '~> 3.0.1'
group :development, :test do
gem 'rspec-rails'
end
group :development do
gem 'annotate', '~> 2.5.0'
end
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
gem 'pg', '0.12.2'
group :test do
gem 'capybara', '1.1.2'
gem 'factory_girl_rails', '~> 4.1.0'
gem 'cucumber-rails', '1. :require=>false
gem 'database_cleaner', '0.7.0'
end
I am new to cucumber and have recently experienced this problem myself. I solved this problem by editing gherkin_builder.rb (see the file path that you quoted). In my case ENV['CUCUMBER_FORWARD_SLASH_PATHS'] was empty. I needed forward slashes so I commented out everything in the file method except #path. If you are using backward slashes you will need #path.gsub(///, '\') in the previous line. I hope this helps!
Francois
I faced this problem as well. I reverted to Ruby 1.9.3 first which did not solve the problem. Then, I reverted to cucumber 1.2.3. It worked.

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