Related
Im trying to add ActiveAdmin to a (massive) application. I follow all the steps here:
https://activeadmin.info/0-installation.html#setting-up-active-admin
The installation process was fine. My problem here is with the assets. When I tried to run:
http://localhost:3000/admin/login/
I got an error:
Showing /Users/fmaymone/.rvm/gems/ruby-2.3.0/gems/activeadmin-
1.1.0/app/views/layouts/active_admin_logged_out.html.erb where line #9 raised:
couldn't find file 'jquery3' with type 'application/javascript'
Checked in these paths:
This application is kind of tricky. Its running webpack together with the rails server. I never worked with this kind of configuration.
Theres not a application.js where I can add a require//
I tried doing a npm i jquery too.
Should I put directly inside the webpack the jquery.js?
This is my GemFile
gem 'rails', '4.2.2'
# This needs to be declared earlier than alphabetical order to load properly re: the app.
gem 'paperclip', '~> 5.0.0'
gem 'activeadmin', '~> 1.4', '>= 1.4.3'
gem 'actionpack-action_caching'
gem 'active_model-errors_details'
gem 'active_model_serializers', '~> 0.10.0'
gem 'activerecord-rescue_from_duplicate'
gem 'activerecord-sqlserver-adapter', '~> 4.2.0'
gem 'addressable'
gem 'ahoy_email'
gem 'ahoy_matey'
gem 'airbrake', '~>6.2'
gem 'ajax-datatables-rails'
gem 'asset_sync'
gem 'attachment_on_the_fly'
gem 'aws-sdk', '~> 2.0'
gem 'axlsx', '2.1.0.pre'
gem 'axlsx_rails'
gem 'blazer'
gem 'bootstrap-generators', '~> 3.3.4'
gem 'bootstrap-sass', '~> 3.3.4'
gem 'browser-timezone-rails'
gem 'chronic'
gem 'coffee-rails', '~> 4.1.0'
gem 'countries'
gem 'daemons'
gem 'data_migrate', '~>5.0'
gem 'delayed_job', '~>4.1.5'
gem 'delayed_job_active_record'
gem 'devise'
gem 'dotenv-rails', :groups => [:development, :test]
gem 'double-bag-ftps'
gem 'faraday'
gem 'fog-aws'
gem 'font-awesome-sass', '~> 4.7.0'
gem 'geocoder', '~> 1.5.1'
gem 'hashdiff'
gem 'hashformer'
gem 'hashie'
gem 'htmlentities'
gem 'httparty'
gem 'hubspot-ruby', '~> 0.4.0'
gem 'jbuilder', '~> 2.0'
gem 'jira-ruby'
gem 'jquery-datatables-rails', github: "rweng/jquery-datatables-rails", branch: "master"
gem 'jquery-rails'
gem 'json-schema'
gem 'kaminari'
gem 'libv8', '6.7.288.46.1'
gem 'mailgun-ruby', '~>1.1.6'
gem 'marketingcloudsdk', '~> 1.0'
gem 'mini_racer', '0.2.3', platforms: :ruby
gem 'mjml-rails'
gem 'money-rails', '~>1'
gem 'multipart-post'
gem 'net-scp'
gem 'newrelic_rpm'
gem 'oj'
gem 'oj_mimic_json'
gem 'pg'
gem 'progress_bar'
gem 'rack-cors', :require => 'rack/cors'
gem 'rails-observers', '~> 0.1.2'
gem 'rails_admin', '~> 1.2.0'
gem 'ransack'
gem 'react_on_rails', '~>6'
gem 'rest-client'
gem 'retriable', '~> 3.1'
gem 'roo', '~> 2.7.0'
gem 'roo-xls'
gem 'rubyzip', '~> 1.1.0'
gem 'sass-rails', '~> 5.0.6'
gem 'savon', '~> 2.2.0'
gem 'schema_plus_pg_indexes'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'seed_dump'
gem 'simple_form'
gem 'slither', :git => 'https://github.com/Programatica/slither.git'
gem 'stripe'
gem 'sunspot_rails', '~> 2.2.5'
gem 'sunspot_solr', '~> 2.2.5'# optional pre-packaged Solr distribution for use in development
gem 'taxjar-ruby', require: 'taxjar'
gem 'thin'
gem 'tiny_tds'
gem 'twitter-typeahead-rails'
gem 'uglifier', '>= 1.3.0'
gem 'validates_timeliness', '~> 4.0'
gem 'wannabe_bool'
gem 'whenever', :require => false
gem 'wisper', '~> 2.0.0'
gem 'wisper-rspec', require: false, groups: [:development, :test]
gem 'workflow'
gem "graphql"
gem "graphql-errors"
gem "graphql-batch"
gem "graphql-guard"
gem "nokogiri"
group :production, :staging do
gem 'sprockets-redirect'
end
group :test do
gem 'shoulda-matchers', '~> 3.1', '>= 3.1.1'
gem 'shoulda-callback-matchers', '~> 1.1.1'
gem 'simplecov', :require => false
gem "vcr"
end
group :development do
gem 'web-console', '~> 2.0'
end
group :development, :test do
gem "pry"
gem 'pry-byebug'
gem "guard-rspec"
gem 'spring-commands-rspec'
gem 'graphiql-rails'
gem "puma"
gem 'byebug'
gem 'spring'
gem 'faker'
gem 'rspec'
gem 'rspec-rails'
gem 'rspec_candy'
gem 'factory_bot_rails'
gem 'capybara'
gem 'database_cleaner'
gem 'ffaker'
gem 'to_factory'
gem 'timecop'
gem 'test_after_commit', :group => :test
gem 'webmock'
end
Thanks
You are probably using an old version of jquery-rails which turn out to raise an error. jquery3 is required in the base javascript file, and the support for it was not available before the rails 4.2.0 version in jquery-rails gem. Therefore, I recommend you to check the versions of jquery-rails with rails and activeadmin gem.
after upgrading and bundle install, I get this on deploy
Could not detect rake tasks
remote: ! ensure you can run `$ bundle exec rake -P` against your app
remote: ! and using the production group of your Gemfile.
remote: ! rake aborted!
remote: ! LoadError: cannot load such file -- polyamorous/activerecord_5.2.2_ruby_2/join_association
gemfile OLD
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.2.5'
gem 'rails', '~> 5.2.1'
gem 'mysql2'
gem 'puma', '~> 3.11'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.2'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'
gem 'bootsnap', '>= 1.1.0', require: false
gem 'nondestructive_migrations'
gem 'acts_as_paranoid', '~> 0.6.0'
gem 'sendgrid-ruby'
gem 'activerecord-session_store'
group :development, :test do
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end
group :development do
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
# gem 'spring'
# gem 'spring-watcher-listen', '~> 2.0.0'
end
group :test do
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '>= 2.15'
gem 'selenium-webdriver'
gem 'chromedriver-helper'
end
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem 'solidus', '2.7.0'
gem 'solidus_auth_devise'
gem 'solidus_print_invoice' , github: 'solidusio-contrib/solidus_print_invoice'
gem 'solidus_gateway'
gemfile NEW (causes crash)
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.2.5'
gem 'rails', '~> 5.2.2'
gem 'mysql2'
gem 'puma', '~> 3.11'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.2'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'
gem 'bootsnap', '>= 1.1.0', require: false
gem 'nondestructive_migrations'
gem 'acts_as_paranoid', '~> 0.6.0'
gem 'sendgrid-ruby'
gem 'activerecord-session_store'
group :development, :test do
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end
group :development do
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
# gem 'spring'
# gem 'spring-watcher-listen', '~> 2.0.0'
end
group :test do
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '>= 2.15'
gem 'selenium-webdriver'
gem 'chromedriver-helper'
end
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem 'solidus', '2.7.0'
gem 'solidus_auth_devise'
gem 'solidus_print_invoice' , github: 'solidusio-contrib/solidus_print_invoice'
gem 'solidus_gateway'
this is fixed by bumping Solidus 2.7.0 to Solidus 2.7.1
This is my first major upgrade of Rails (v4 to v5). I've done minor upgrades, like 4.1.1 to 4.2 etc...
I've upgraded to 5.1.1, and I'm getting this dependency error in the console
Bundler could not find compatible versions for gem "actionmailer":
In Gemfile:
mail_form (= 1.7.0) was resolved to 1.7.0, which depends on
actionmailer (< 5.2, >= 3.2)
rails (>= 5.1.1, ~> 5.1) was resolved to 5.1.1, which depends on
actionmailer (= 5.1.1)
however, I have actionmailer 5.1.1 installed. That looks like what it's asking for. These seems like an noob question, but it looks like rails MUST have actionmailer 5.1.1 and mail_form can have version less than 5.2 or equal/greater than 3.2. 5.1.1 satisfies both these conditions....so what's going on?
It also says this further down
Could not find gem 'rails (>= 5.1.1, ~> 5.1)' in any of the sources.
But I've uninstalled and reinstalled rails 5.1.1 to make sure.
I also tried doing this with 5.0.0 and had the same issue.
This is just one of many, many "Bundler could not find compatible versions for gem " errors in this bundle.
ruby '2.3.1'
source 'https://rubygems.org'
gem 'rails', '~> 5.1', '>= 5.1.1'
gem 'pg'
gem 'sass-rails', '~> 5.0', '>= 5.0.6'
gem 'uglifier', '>= 1.3.0'
gem 'yui-compressor'
# gem 'coffee-rails', '~> 4.1.0'
gem 'twitter-bootstrap-rails', '= 3.2.2'
gem 'bootstrap-sass', '>= 3.3.6'
gem 'draper', '= 3.0.1'
gem 'jquery-rails', '~> 4.1', '>= 4.1.1'
gem "jquery-ui-rails"
gem 'sidekiq', '~> 4.2', '>= 4.2.2'
gem 'redis'
gem 'redis-namespace'
# gem 'turbolinks'
gem 'jbuilder', '= 2.7.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'devise', '= 4.4.0'
gem 'omniauth', '~> 1.3', '>= 1.3.1'
gem 'omniauth-facebook'
gem 'omniauth-google-oauth2', '~> 0.3.0'
gem 'omniauth-twitter'
gem 'omniauth-eventbrite', '~> 0.0.6'
gem 'twitter' #for posting to twitter
gem 'koala' #for posting to facebook
gem 'sprockets-rails', '= 3.2.1'
gem 'sprockets', '~> 3.7', '>= 3.7.1'
gem 'geoip', '~> 1.6', '>= 1.6.1'
gem 'jsTimezoneDetect-rails'
gem 'simple_form'
# gem 'client_side_validations', '= 4.2.12' #todo check validations NO RAILS 5
# gem 'client_side_validations-simple_form', '= 3.4.0'
gem 'acts_as_commentable'
gem 'attr_encrypted', '~> 3.0', '>= 3.0.3'
gem 'httparty', '~> 0.14.0'
gem "skylight"
gem 'braintree'
gem 'bitly', '~> 1.1', '>= 1.1.1'
# gem 'ahoy_email', '~> 0.2.3'
# gem 'compass-rails' #needed for chosen
# gem 'chosen-rails', '~> 1.5', '>= 1.5.2'
gem 'bootstrap-table-rails', '~> 1.11'
# gem 'chartjs-ror'
gem 'chartkick', '~> 2.2', '>= 2.2.3'
gem 'groupdate', '= 3.2.0'
gem 'hightop', '~> 0.2.0'
gem 'active_median', '~> 0.1.4'
gem 'bootstrap-tagsinput-rails'
gem 'faker'
gem 'slim'
# gem 'less-rails', '>= 2.8'
# gem 'less-rails', github: 'metaskills/less-rails', branch: 'depends_only_on_less_files'
# gem 'less-rails', git: 'https://github.com/Genkilabs/less-rails' #fix for deprecated Sprockets ImportProcessor
gem 'less-rails-bootstrap'
gem 'therubyracer'
gem 'american_date'
gem 'mail_form', '= 1.7.0'
# gem 'cancancan'
gem 'kaminari', '= 1.1.1'
gem 'bootstrap-kaminari-views', '~> 0.0.5'
gem 'aws-sdk', '~> 2'
gem 'carrierwave-aws'
gem 'carrierwave'
gem 'carrierwave-base64'
gem 'rmagick', '~> 2.16'
gem 'simple_form_fancy_uploads', '~> 0.2.0'
gem 'remotipart', '~> 1.2.1'
gem 'wysiwyg-rails', '= 2.7.3'
gem 'wicked'
gem 'meta-tags', '= 2.7.0'
gem 'acts-as-taggable-on', '~> 4.0'
gem 'acts_as_list', '~> 0.7.2'
gem 'factory_girl_rails'
gem 'friendly_id', '~> 5.1.0'
gem 'paranoia', '~> 2.2', '>= 2.2.1'
gem 'google-analytics-rails', '~> 1.1'
gem 'responders', '= 2.4.0'
gem 'cocoon', '~> 1.2', '>= 1.2.9'
gem 'momentjs-rails', '>= 2.9.0'
gem 'bootstrap3-datetimepicker-rails', '~> 4.17.42'
gem 'tzinfo', '~> 1.2', '>= 1.2.3'
gem 'tzinfo-data'
# gem 'temporal-rails', '~> 0.2.4' #railties dependency
gem 'geocoder', '~> 1.3', '>= 1.3.1'
gem 'timezone', '~> 1.1'
gem 'browser'
gem 'jquery-datatables-rails', '~> 3.4'
gem 'hashie', '~> 3.4', '>= 3.4.4'
# Sinatra - might be required for the Sidekiq web UI?
gem 'sinatra', '~> 1.2'
gem 'paypal-sdk-permissions'
gem 'paypal-sdk-rest' #maybe use
# gem 'paypal-sdk-invoice'
# gem 'resque', '~> 1.26'
# gem 'resque-scheduler', '~> 4.1'
# gem 'active_scheduler', '~> 0.0.3'
gem 'wicked_pdf'
gem 'wkhtmltopdf-binary'
gem 'gon', '~> 6.0', '>= 6.0.1'
gem 'puma'
gem 'rack-timeout'
gem 'rest-client'
gem 'airbrake', '~> 5.6', '>= 5.6.1'
# gem 'rack-cache', '~> 1.6', '>= 1.6.1'
gem 'rack-attack', '~> 5.0', '>= 5.0.1'
gem 'rack-cors', '~> 0.4.0'
gem 'puma_worker_killer', '~> 0.0.7'
gem 'local-subdomain'
gem 'scout_apm'
gem 'concerned_with', '~> 0.1.0'
# gem 'elasticsearch-rails', git: 'git://github.com/elasticsearch/elasticsearch-rails.git'
# gem 'elasticsearch-model', git: 'git://github.com/elasticsearch/elasticsearch-rails.git'
gem 'pusher', '~> 1.3.1'
group :development do
gem 'better_errors'
# gem 'quiet_assets'
gem 'foreman'
gem 'guard-rspec', require: false
# gem 'bullet', '~> 5.0'
gem 'rake', '~> 11.1', '>= 11.1.1'
gem 'web-console', '>= 2.3.0'
# gem 'derailed_benchmarks', '~> 1.3', '>= 1.3.1'
# gem 'rack-mini-profiler', '~> 0.10.1'
end
group :development, :test do
gem 'rspec-rails','= 3.7.2'
gem 'byebug'
gem 'spring'
gem 'spring-commands-rspec'
gem 'mailcatcher', '~> 0.6.4'
gem 'capybara', '~> 2.7', '>= 2.7.1'
gem 'capybara-screenshot', '~> 1.0', '>= 1.0.13'
gem 'database_cleaner'
gem "email_spec"
gem 'shoulda-matchers'
gem 'rspec-activejob'
gem 'awesome_print'
gem 'lol_dba', '~> 2.1', '>= 2.1.1'
gem 'rb-readline'
# gem 'invoice_samples', :git => "https://github.com/paypal/invoice-sdk-ruby.git"
end
group :test do
gem 'poltergeist'
gem 'selenium-webdriver'
gem 'launchy'
gem 'db-query-matchers'
gem 'timecop'
gem 'codeclimate-test-reporter'
gem 'webmock', '~> 2.1'
end
group :production do
gem 'rails_12factor'
gem 'newrelic_rpm'
gem 'keen'
end
I ended up rebuilding the gem file line by line starting with just rails and pg and then pasting and bundle installing each new line.
I found I was hanging on "Sinatra".
None of the errors I found in bundling the complete gem file appeared in the line-by-line bundle. Sigh.
Before you bundle install, are you making sure to have RVM set to the ruby version you need (rvm use 2.3.1p112)?
You might also try bundle update before install and see if that helps.
I was working on a GoRails refile gem course and trying to implement it into my app. When I tried to do bundle install, I kept running into an error message in my console saying that bundle could not find compatible versions for my gem "rack" (screenshot of error below).
I tried looking at these Stackoverflow questions - Bundler could not find compatible versions for gem "rack": In Gemfile: and Bundler could not find compatible versions for gem "rack": without success. I tried multiple approaches - 1. putting rack in my Gemfile, 2. uninstalling all previous rack and then installing rack versions. None seemed to work. I would greatly appreciate any help on this issue. Thank you so much.
Gemfile
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.1', '>= 5.1.3'
gem 'sqlite3'
gem 'puma', '~> 3.0'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.2'
gem 'jquery-rails'
gem 'jquery-ui-sass-rails', '~> 4.0', '>= 4.0.3.0'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'
gem 'bootstrap-sass', '~> 3.3', '>= 3.3.7'
gem 'devise', '~> 4.3'
gem 'omniauth-facebook'
gem 'paperclip', '~> 5.1'
gem 'redis'
gem "font-awesome-rails"
gem "twemoji"
gem 'koala', '~> 2.5'
gem 'chosen-rails'
gem 'devise-bootstrap-views', '~> 0.0.9'
gem 'pry', '~> 0.10.4'
gem 'bootstrap-modal-rails', '~> 2.2', '>= 2.2.5'
gem 'better_errors', '~> 2.3'
gem 'selectize-rails', '~> 0.12.4'
gem 'ransack', '~> 1.8', '>= 1.8.2'
gem 'searchkick', '~> 2.3', '>= 2.3.1'
gem 'jquery-fileupload-rails', '~> 0.4.7'
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platform: :mri
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
gem 'web-console'
gem 'listen', '~> 3.0.5'
# 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.0'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
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 !!!