I installed rails admin and am getting an error when trying to access /admin:
My Gemfile:
source 'https://rubygems.org'
gem 'rails', '3.2.11'
gem 'devise'
gem 'rails_admin'
gem 'pg'
gem 'haml'
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'therubyracer'
gem 'less-rails'
gem 'coffee-script'
gem 'uglifier', '>= 1.0.3'
end
I have custom less styles in app/assets/stylesheets/*
Turned out to be twitter bootstrap & rails admin incompatibility.
Rails admin tried to load the bootstrap.less located in app/assets/stylesheets.
Solution: Rename bootstrap.less to bootstrap-mine.less.
Related
I am upgrading my Rails app to use Ruby 2.1 and am updating my gems. However, when I run bundle update it is taking an incredibly long time to complete (3+ hours on the last run).
Any suggestions for fixing this would be greatly appreciated.
Here is my current gemfile:
source 'http://rubygems.org'
gem 'rails', '~> 3.2.11'
gem 'mysql2', '~>0.3.10'
gem 'json', '1.7.7'
gem 'will_paginate', '~> 3.0'
gem 'carrierwave'
gem "fog", "~> 1.3.1"
gem 'gibbon'
gem 'nokogiri'
gem 'premailer-rails3'
gem 'pg'
gem 'aws-s3'
gem 'amazon-ec2'
# Use unicorn as the app server
gem 'unicorn'
gem 'sidekiq'
gem 'rufus-scheduler'
gem 'exception_notification'
gem 'haml', '>= 4.0.0.rc.1'
gem 'html2haml'
gem 'state_machine'
gem 'garb', :git => 'git://github.com/Sija/garb.git'
gem "activerecord-import", ">= 0.2.0"
gem "hashie"
gem 'draper', '~> 1.0'
gem 'dotenv-rails', :groups => [:development, :test]
gem 'airbrake'
gem 'newrelic_rpm'
gem 'devise', '~> 2.2.4'
gem 'acts_as_tenant', :git => 'git://github.com/ErwinM/acts_as_tenant.git'
gem 'bourbon'
gem 'sass'
gem 'neat'
gem 'bitters'
gem 'middleman'
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'handlebars_assets', :git => 'git://github.com/leshill/handlebars_assets.git'
gem 'jquery-rails', '~> 2.0.1'
gem 'uglifier', '>= 1.0.3'
end
group :test do
#gem 'webmock'
gem 'vcr'
gem 'launchy'
gem 'database_cleaner'
gem 'capybara', '2.0.0'
gem 'shoulda'
end
group :development, :test do
gem 'faker'
gem "rspec-rails", "2.14.0"
gem "factory_girl_rails", "~> 4.0", :require => false
gem 'spork', '~> 1.0rc'
gem 'guard-livereload'
gem 'guard-jasmine'
gem 'guard-spork'
gem 'guard-rspec'
gem 'jasminerice', :git => 'git://github.com/bradphelan/jasminerice.git'
end
group :development do
gem 'rb-inotify', :require => false
gem 'rb-fsevent', :require => false
gem 'rb-fchange', :require => false
gem 'pry'
end
Here is the last result I received:
Bundler could not find compatible versions for gem "thor":
In Gemfile:
rails (~> 3.2.11) ruby depends on
railties (= 3.2.11) ruby depends on
thor (< 2.0, >= 0.14.6) ruby
jquery-rails (~> 2.0.1) ruby depends on
thor (0.14.0)
You're including gems with incompatible dependencies. You cannot have both jquery-rails ~> 2.0.1 and rails ~> 3.2.11 as they have mutually exclusive requirements for versions of the Thor gem.
I would recommend removing the explicit version requirement for jquery-rails let Rails choose the version it needs based on its dependencies.
I have been using Kaminari since a while. I use to paginate generic arrays using the following line.
Kaminari.paginate_array([1,2,3]).page(1).per(1)
That use to work before but I noticed that since yesterday this show the error
undefined method `page' for #<Kaminari::PaginatableArray:0x007f8e5d10fde0>
However calling page on ActiveRecord relation is working fine. something like this is working
User.page(1).per(1)
My Gem file
source 'https://rubygems.org'
ruby '1.9.3'
gem 'rails', '3.2.8'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'mysql2'
gem 'pg'
# Ok lets try out the heroku business
gem 'heroku'
# 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'
end
gem 'jquery-fileupload-rails'
gem 'jquery-rails'
gem 'jquery-ui-rails'
# Twitter Boostrap and Upgrade dependencies
gem 'therubyracer'
gem 'less-rails'
gem 'twitter-bootstrap-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'
gem 'cap_bootstrap', github: 'benrs44/cap_bootstrap'
gem 'awesome_print'
group :test, :development do
gem 'rspec-rails', '>= 2.0.1'
gem "capybara-webkit"
gem 'capybara'
gem 'launchy'
gem 'selenium-webdriver'
gem 'shoulda-matchers'
gem 'ci_reporter'
gem "factory_girl_rails", "~> 4.0"
# DRb server RSpec
gem "spork-rails"
# To use debugger
gem 'debugger'
end
group :test do
gem "guard-rspec"
gem 'rb-fsevent', '~> 0.9.1'
gem 'database_cleaner'
gem 'fuubar'
end
#Image Uploader
gem 'carrierwave'
#Image Processor
gem "rmagick"
#Video Processor
gem 'video_info'
gem 'hpricot'
#Authenitcation
gem 'omniauth-facebook', '1.4.0'
#Messaging
gem 'mailboxer', github: 'rralston/mailboxer'
gem 'haml-rails'
gem 'simple_form'
#Gelocation
gem 'geocoder'
#Search
gem 'ransack'
# For easily making nouns possessive
gem 'possessive'
#Pagination
gem "kaminari"
gem 'will_paginate', '~> 3.0'
#Web App Monitoring
gem 'newrelic_rpm'
#FB Style Newsfeeds
gem 'public_activity'
# Heroku CDN Link to AWS
gem "asset_sync"
# Carrier Wave link to AWS S#
gem 'fog', '~> 1.12.1'
gem 'cancan'
# client side validtions
gem 'client_side_validations'
# tagging
gem 'acts-as-taggable-on'
# remote file uploads
gem "remotipart", "~> 1.2.1"
# social sharing
gem 'social-share-button'
gem 'devise', "~> 2.2.3"
gem 'omniauth'
gem 'devise-async'
running bundle show bundle show kaminari gives /Users/***/.rvm/gems/ruby-1.9.3-p448/gems/kaminari-0.14.1
Turned out to be that my colleague has added a configuration file for Kaminari and changed this page function with this line.
config.page_method_name = :kaminari_page
So instead of using Kaminari.paginate_array([1,2,3]).page(1).per(1) I should now use
Kaminari.paginate_array([1,2,3]).kaminari_page(1).per(1)
I have devise already set up in my application. I want to add omniauth-facebook gem (for facebook authentication). The set up works fine in development and staging environments, but given me the following error in my production environment:
Could not load 'omniauth'. Please ensure you have the omniauth gem >= 1.0.0 installed and listed in your Gemfile.
/home/slaxman/apps/itextbook/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- omniauth (LoadError)
This warning seems to originate from this devise file.
My Gemfile
source 'https://rubygems.org'
gem 'rails', '3.2.11'
group :production do
gem 'pg', '0.14.1'
gem 'therubyracer','0.11.4'
gem 'execjs', '1.4.0'
end
group :assets do
gem 'sass-rails', '~> 3.2.6'
gem 'jquery-rails', '~> 2.2.1'
gem 'coffee-rails', '~> 3.2.2'
gem 'uglifier', '~> 1.3.0'
gem 'bootstrap-sass', '~> 2.3.1.2'
gem 'bootswatch-rails', '~> 0.5.0'
end
gem 'unicorn', '~> 4.6.2'
gem 'capistrano', '~> 2.14.2'
gem "multi_json", "~> 1.2.0"
gem 'devise' , '~> 2.2.4'
gem 'omniauth-facebook', '1.4.0'
gem 'cancan', '~> 1.6.8'
gem 'omniauth', '>= 1.0.0'
user.rb
class User < ActiveRecord::Base
devise :database_authenticatable, :registerable, :omniauthable,
:recoverable, :rememberable, :trackable, :validatable
end
In devise.rb
config.omniauth :facebook, OMNIAUTH_VAR['FACEBOOK_APP_ID'], OMNIAUTH_VAR['FACEBOOK_APP_SECRET'], scope: 'email'
Adding the following to devise.rb also does not work
require 'omniauth-facebook'
require 'omniauth'
Any help will be greatly appreciated. Thanks!
Solved it! Apparently, it's a unicorn issue. Restarting unicorn doesn't help. It is necessary to stop and restart unicorn manually using the following commands:
/etc/init.d/unicorn_appname stop
/etc/init.d/unicorn_appname start
you can also do:
sudo service unicorn_appname stop
sudo service unicorn_appname start
replace 'appname' with the name of your app.
Answer Credit
It's probably not in the right order, here's an example of my Gemfile that works. Hope this helps.
source 'https://rubygems.org'
gem 'rails', '3.2.3'
gem 'pg'
gem 'jquery-rails'
gem 'devise'
gem 'omniauth-facebook'
gem 'acts_as_votable'
gem 'gibbon'
gem 'foreman'
gem 'ruby-sendhub'
gem 'bitly'
gem 'rack-rewrite'
gem 'twitter'
gem 'hpricot'
gem 'premailer-rails3'
gem 'kaminari'
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'therubyracer', :platform => :ruby
gem 'uglifier', '>= 1.0.3'
end
group :test, :development do
gem "foreman"
gem "rspec-rails"
gem "factory_girl_rails"
gem "capybara"
gem "guard-rspec"
gem "spork"
gem "guard-spork"
gem "launchy"
gem "database_cleaner"
end
I am trying to upload image with paperclip, but got this error:
[paperclip] An error was received while processing: #<Paperclip::Errors::NotIden tifiedByImageMagickError: Paperclip::Errors::NotIdentifiedByImageMagickError>
I found several similar cases with mine. This and this. But I didn't use gem cocaine and my image file name is 01.png (without colons).
I don't know what the problem is. Anyone?
By the way, this is my Gemfile :
gem 'rails', '3.1.3'
gem 'sass'
gem 'coffee-script'
gem 'uglifier'
gem 'devise', '2.1.2'
gem 'omniauth'
gem 'omniauth-facebook'
gem 'paperclip'
gem 'aws-s3'
gem 'aws-sdk'
gem 's3_swf_upload'
gem 'rails-i18n', '0.7.3'
group :development, :test do
gem 'sqlite3'
gem 'sqlite3-ruby', '1.3.2', :require => 'sqlite3'
gem 'better_errors'
gem 'binding_of_caller'
end
group :production do
gem 'pg'
end
gem "will_paginate", "~> 3.0.pre2"
gem "haml"
gem 'acts-as-taggable-on'
gem "friendly_id", "~> 3.2.1"
gem "simple_form"
gem 'web-app-theme', '>= 0.6.2'
gem "mobile-fu"
gem 'inherited_resources'
gem 'settingslogic'
gem 'recaptcha', :require => 'recaptcha/rails'
gem 'mechanize'
gem 'nokogiri'
EDIT
It works without style in paperclip config.
It works now. The problem is, I have not intalled Imagemagick in my pc. Now since I installed and gave the path. It works like a charm :)
I am unable to get growl notifications when i run $guard
Do i need any particular version for growl_notify?
Growl version = 1.2
Here is my gem file.
gem 'rails', '3.1.3'
gem 'sqlite3'
group :development, :test do
gem 'rspec-rails'
gem 'capybara', :git => 'git://github.com/jnicklas/capybara.git'
gem 'launchy'
gem 'database_cleaner'
gem 'rb-fsevent', :require => false if RUBY_PLATFORM =~ /darwin/i
gem 'guard-rspec'
gem 'guard-livereload'
end
gem 'growl'
group :test do
gem 'guard-spork'
end
Error message when i install/ pub growl_notify in gemfile
JP:guard2 jayparteek$ guard
/Users/jayparteek/.rvm/gems/ruby-1.9.2-head#guard2/gems/rb-appscript-0.6.1/lib/appscript.rb:542:in `_send_command': CommandError (Appscript::CommandError)
OSERROR: -10000
MESSAGE: Apple event handler failed.
COMMAND: app("/Library/PreferencePanes/Growl.prefPane/Contents/Resources/GrowlHelperApp.app").register({:all_notifications=>["success", "pending", "failed", "notify"], :as_application=>"Guard", :default_notifications=>"notify"})
from /Users/jayparteek/.rvm/gems/ruby-1.9.2-head#guard2/gems/rb-appscript-0.6.1/lib/appscript.rb:642:in `method_missing'
Make sure you are running Growl 1.3.xx
In your Gemfile remove gem 'growl' and in your :test group add gem 'ruby_gntp' then run
$ gem uninstall growl_notify
$ bundle install
Should use following gemfile, with rails 3.1.3 & Growl ver 1.3.1
gem 'rails', '3.1.3'
gem 'sqlite3'
group :development, :test do
gem 'rspec-rails'
gem 'capybara', :git => 'git://github.com/jnicklas/capybara.git'
gem 'launchy'
gem 'database_cleaner'
gem 'rb-fsevent', :require => false if RUBY_PLATFORM =~ /darwin/i
gem 'guard-rspec'
# gem 'guard-livereload'
end
group :test do
gem 'guard-spork'
gem 'ruby_gntp'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.1.5'
gem 'coffee-rails', '~> 3.1.1'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'