I am having a very hard time displaying any Glyphicons in my Rails app. I can't display any of the BS 2.3 doc icon sets anywhere in my app. I actually downloaded a gem with some icons and those work great but I want to use the BS ones. What are some possible reaosns for this? This is my gemfile:
source 'https://rubygems.org'
ruby '2.0.0'
gem 'rails', '4.0.0'
gem 'sass-rails', '~> 4.0.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'bootstrap-sass', '~> 2.3.2.0'
gem 'bcrypt-ruby', '= 3.0.1'
gem 'twilio-ruby'
gem 'will_paginate'
gem 'bootstrap-will_paginate'
gem 'font-icons-rails', :git=> 'git://github.com/shorelabs/font-icons-rails.git'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 1.2'
group :doc do
gem 'sdoc', require: false
end
group :development do
gem 'quiet_assets'
gem 'pry'
gem 'sqlite3'
end
group :production do
gem 'pg'
gem 'rails_12factor'
end
For example, this line of code wont produce any icons in my Nav partial:
<li>
<%= link_to(new_category_path) do %>
<i class="icon-plus"></i>
New Category
<% end %>
</li>
Related
i'm trying to test using minitest but when running this file with
bin/rails test test/controllers/api/v1/blogs_api_controller_test.rb
But it gives this error
.rvm/gems/ruby-2.3.1/gems/railties-5.1.1/lib/rails/railtie/configuration.rb:95:in
method_missing': undefined methodweb_console' for
(NoMethodError) Did you mean? console
require 'test_helper'
class BlogsApiControllerTest < ActiveSupport::TestCase
test 'Get all Blogs' do
assert false
end
end
Rails version 5.1.1 Ruby 2.3.1
Gem File
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.1.1'
# Use Puma as the app server
gem 'puma', '~> 3.8.2'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 3.2.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails', '~> 4.1.1'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.6'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 3.0'
gem 'kaminari', '~> 0.17.0'
gem 'bootsy', '~> 2.4'
gem 'searchkick', '~> 3.0.2'
gem 'devise', '~> 4.3.0'
gem 'omniauth-facebook', '~> 3.0.0'
gem 'omniauth-google-oauth2', '~> 0.4.1'
gem 'cancancan', '~> 1.15.0'
gem 'paperclip', '~> 5.0.0'
gem 'sitemap_generator', '~> 5.1.0'
gem 'jwt'
gem 'simple_command'
gem 'rack-cors', require: 'rack/cors'
# For admin panel ----------------
gem 'activeadmin', '~> 1.0.0'
# Below are for rails 5
# gem 'inherited_resources', github: 'activeadmin/inherited_resources'
# gem 'ransack', github: 'activerecord-hackery/ransack'
gem 'draper', '~> 3.0.1'
# ---------------------
group :development, :test do
gem 'pry'
# Use mysql as the database for Active Record
gem 'mysql2', '~> 0.4.6'
end
group :development do
gem 'wdm', '>= 0.1.0' if Gem.win_platform?
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
gem 'web-console'
gem 'listen', '~> 3.0.8'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.1'
end
group :production do
gem 'pg', '~> 0.18.4'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
Please put gem 'web-console' into your Gemfile's test section. You can change the following lines
group :development, :test do
gem 'pry'
# Use mysql as the database for Active Record
gem 'mysql2', '~> 0.4.6'
end
with following
group :development, :test do
gem 'pry'
gem 'web-console'
# Use mysql as the database for Active Record
gem 'mysql2', '~> 0.4.6'
end
And remove web-console from following lines
group :development do
gem 'wdm', '>= 0.1.0' if Gem.win_platform?
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
gem 'web-console' # remove this
Now run following command to update bundles
bundle install
I'm trying to install active admin which I was partly successful with. However, I want to use the '0-6-stable' and not the "1.0.0.pre2" version. When I changed my gem file to reflect my change, I get the following error message:
Resolving dependencies...
Bundler could not find compatible versions for gem "formtastic":
In Gemfile:
activeadmin (>= 0) ruby depends on
formtastic (~> 2.0) ruby
formtastic (3.2.0.pre)
Now, I've gotten this message before and I would just delete my Gemfile.lock but it doesn't seem like that is working.
Copy of my gem file:
source 'http://rubygems.org'
ruby '2.2.1'
gem 'ransack', github: 'activerecord-hackery/ransack'
gem 'inherited_resources', github: 'josevalim/inherited_resources'
gem 'formtastic', github: 'justinfrench/formtastic'
gem 'rails', '~> 4.2', '>= 4.2.5'
gem 'railties', '~> 4.2', '>= 4.2.5'
gem 'sqlite3', group: :development
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails', '~> 4.0', '>= 4.0.5'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'rails_12factor', group: :production
gem 'pg', group: :production
gem 'activeadmin', github: 'activeadmin', branch: '0-6-stable'
#gem 'will_paginate', '~> 3.0'
#gem 'will_paginate-bootstrap'
gem 'carrierwave'
gem "fog"
gem "figaro"
gem 'execjs'
gem 'tzinfo-data', platforms: [:mingw, :mswin]
gem "mini_magick"
gem 'devise'
gem 'searchkick'
group :development, :test do
gem 'rspec-rails', '~> 3.0'
end
The reason I want to use the most stable version of active admin is because I'm getting "NoMethodError in Admin::AdminUsersController#index" when I select "Admin Users" I hoping that using the stable version will correct this issue.
EDIT: The ActiveAdmin Issue: https://github.com/activeadmin/activeadmin/issues/4249
You can't use the 0-6-stable branch, if you use rails >= 4.x, 0-6-stable works only with rails <= 3.x.
This mean's your Gemfile need to look like this:
source 'http://rubygems.org'
ruby '2.2.1'
gem 'rails', '~> 4.2', '>= 4.2.5'
gem 'railties', '~> 4.2', '>= 4.2.5'
gem 'sqlite3', group: :development
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails', '~> 4.0', '>= 4.0.5'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'rails_12factor', group: :production
gem 'pg', group: :production
gem 'activeadmin', github: 'activeadmin'
#gem 'will_paginate', '~> 3.0'
#gem 'will_paginate-bootstrap'
gem 'carrierwave'
gem "fog"
gem "figaro"
gem 'execjs'
gem 'tzinfo-data', platforms: [:mingw, :mswin]
gem "mini_magick"
gem 'devise'
gem 'searchkick'
group :development, :test do
gem 'rspec-rails', '~> 3.0'
end
From the ActiveAdmin point of view there is no need to use ransack, inherited_resources and formtastic from github.
1: remove Gemfile.lock
2: Add gem 'jquery-rails'
3: add gem 'formtastic'
4: Run bundle install
Still if you have any issue in bundle Github Active Admin ,I would like to say go with rails 3.2.
Hope this help you !!!
After commenting out normalize-scss in my Gemfile and running rails -s, I get:
bin/rails:6: warning: already initialized constant APP_PATH
/Users/ItsMe/foo/bar/bin/rails:6: warning: previous definition of APP_PATH was here
Adding the gem back in lets me run the server.
...why? I've already checked bin/rails:6, and APP_PATH looks totally fine.
Gemfile:
source 'https://rubygems.org'
gem 'rails', '4.2.4'
gem 'pg', '~> 0.18.3'
gem 'sass-rails', '~> 5.0'
gem 'compass-rails', '~> 2.0', '>= 2.0.5'
# gem 'normalize-scss', '~> 3.0', '>= 3.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
# gem 'therubyracer', platforms: :ruby
gem 'jquery-rails'
# gem 'bootstrap-sass', '~> 3.3', '>= 3.3.5.1'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'figaro', '~> 1.1', '>= 1.1.1'
gem 'susy', '~> 2.2', '>= 2.2.6'
gem 'breakpoint', '~> 2.5'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
group :development, :test do
gem 'byebug'
gem 'web-console', '~> 2.0'
gem 'spring'
end
group :test do
gem 'minitest-reporters', '1.0.5'
gem 'mini_backtrace', '0.1.3'
gem 'guard-minitest', '2.3.1'
end
group :production do
gem 'rails_12factor', '~> 0.0.3'
end
Solved it. I had required the gem in config/application.rb. Removed it, and solved.
I'm trying to push my rails app to Heroku, but I got this error:
"couldn't find file 'turbolinks' - however 'turbolinks" is in my gemfile (attached).
source 'https://rubygems.org'
gem 'rails', '4.0.0'
gem 'jquery-rails'
group :production do
gem 'pg'
end
group :development, :test do
gem 'sqlite3'
end
group :assets do
gem 'sass-rails', '~> 4.0.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'turbolinks'
gem 'jbuilder', '~> 1.2'
end
group :doc do
gem 'sdoc', require: false
end
Rails 4 doesn't use the :assets group anymore. See http://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html#upgrading-from-rails-3-2-to-rails-4-0 and discussion from SO here: Why did Rails4 drop support for "assets" group in the Gemfile.
/home/eduardo/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/compass-h5bp-0.1.1/lib/compass/h5bp.rb:5:in `<module:H5bp>': uninitialized constant Compass::Frameworks (NameError)
This is my Gemfile:
source 'https://rubygems.org'
gem 'rails', '4.0.0.beta1'
gem 'sqlite3'
gem 'turbolinks'
gem 'jbuilder', '~> 1.0.1'
group :test, :development do
gem 'rspec-rails', '~> 2.0'
end
group :assets do
gem 'sass-rails', '~> 4.0.0.beta1'
gem 'coffee-rails', '~> 4.0.0.beta1'
gem 'haml-rails'
gem 'uglifier', '>= 1.0.3'
gem 'compass-h5bp'
end
gem 'html5-rails'
gem 'jquery-rails'
group :test do
gem 'capybara'
end
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# Use unicorn as the app server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano', group: :development
# To use debugger
I don't know what is causing this error. I get the error when I try to run:
rails generate html5:install
Here is the project: https://github.com/sporkd/html5-rails
I have tried a couple of things that I found on Google but none have really worked.
With compass-rails before compass-h5bp it works (rails 3.2.13, ruby 2.0)
group :assets do
gem 'sass-rails'
gem 'coffee-rails'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier'
gem 'compass-rails'
gem 'compass-h5bp'
end
Adding the compass-rails gem to the assets group fixed the problem for me.