Active admin install with Rails 4 - activeadmin

I got this error when installing active admin on Rails 4
Bundler could not find compatible versions for gem "actionpack":
In Gemfile:
meta_search (>= 1.1.0.pre) ruby depends on
actionpack (~> 3.1.0.alpha) ruby
rails (= 4.0.0.rc1) ruby depends on
actionpack (4.0.0.rc1)
I follow this instruction:
http://www.activeadmin.info/docs/documentation.html
Anyone help please.

Apr 20, 2015 update
For Rails 4 (according to the official github page) use either master:
gem 'activeadmin', github: 'activeadmin'
Or rubygems:
gem 'activeadmin', '~> 1.0.0.pre1'
Feb 14, 2015 update
For Rails 4 (according to the official github page) use:
gem 'activeadmin', github: 'activeadmin'
Sept 4, 2014 update
For Rails 4.0 and 4.1 (according to the official github page) use:
gem 'activeadmin', github: 'activeadmin'
April 24, 2014 update
For Rails 4.1 and 4.0 use master:
gem 'activeadmin', github: 'gregbell/active_admin'
April 13, 2014 update
For Rails 4.1 use master and the following dependency branches:
gem 'activeadmin', github: 'gregbell/active_admin'
gem 'polyamorous', github: 'activerecord-hackery/polyamorous'
gem 'ransack', github: 'activerecord-hackery/ransack'
gem 'formtastic', github: 'justinfrench/formtastic'
For Rails 4.0.X just use master and you should be good to go:
gem 'activeadmin', github: 'gregbell/active_admin'
Note: There's an issue with adding comments to the index page in Rails 4.1. This issue is being tracked here.
September 29, 2013 update
The Rails 4 branch has been merged into master. Now all you need to do is specify:
gem 'activeadmin', github: 'gregbell/active_admin'
August 28, 2013 Updated answer
Was able to build a new rails 4 app up and running with AA just using:
gem 'activeadmin', github: 'gregbell/active_admin', branch: 'rails4'
Please disregard the older answer. Just add this line to your new rails 4 app Gemfile, run bundle install, run rails g active_admin:install, run rake db:migrate, run bundle exec rails s, go to /admin, and log in with admin#example.com/password and you're good to go! See ActiveAdmin Documentation for more details.
June 30, 2013 Updated answer
Much progress has been made on getting ActiveAdmin and the gems it depends on ready for Rails 4. Please use the following gemfile settings and disregard the bit regarding downgrading jquery-rails to 2.3.0:
gem 'devise', github: 'plataformatec/devise'
gem 'responders', github: 'plataformatec/responders'
gem 'inherited_resources', github: 'josevalim/inherited_resources'
gem 'ransack', github: 'ernie/ransack'
gem 'activeadmin', github: 'gregbell/active_admin', branch: 'rails4'
gem 'formtastic', github: 'justinfrench/formtastic'
just bundle install (or bundle update, if necessary) and run rails generate active_admin:install (if necessary) to install
Original Answer
I used the following to get ActiveAdmin on my Rails 4.0.0.rc1/JRuby/Puma app up and running on Heroku.
After checking out the following links from the ActiveAdmin github:
Re: Rails 4 problems - Issue #1963
Rails 4 Hacks, Fixes - Pull Request #2120
I added the following to my gemfile:
gem 'devise', github: 'plataformatec/devise', branch: 'rails4'
gem 'responders', github: 'plataformatec/responders'
gem 'inherited_resources', github: 'josevalim/inherited_resources'
gem 'ransack', github: 'ernie/ransack'
gem 'activeadmin', github: 'akashkamboj/active_admin', branch: 'rails4'
gem 'formtastic', github: 'justinfrench/formtastic', branch: 'rails4beta'
replace:
gem 'jquery-rails', '3.0.0'
with:
gem 'jquery-rails', '2.3.0'
and bundle install and run the rails generate active_admin:install to install.
Fire up the server, go to root_url/admin and you should see the admin login.

January 11, 2016 Updated answer
ActiveAdmin has now Rails 4 full support :
1.0.0 Version, full support of Rails 4) :
gem 'activeadmin', github: 'activeadmin'
0.6 Stable version (may not properly support Rails 4) :
gem 'activeadmin', github: 'activeadmin', branch: '0-6-stable'

I have switched to Ubuntu, and that resolved the issue I was having. For some reason, Windows chokes when trying to get a gem that is not on the Ruby source.

Thanks for the help, Marc and Oto Brglez. A quick update for the rails 4 implementation. You do not need to use branch '0-6-stable' (that is the current branch as of today), you can instead just use the master branch as noted int he documentation on gregbell's github. https://github.com/gregbell/active_admin

Just edit your Gemfile.
This all what you need to your ActiveAdmin 1.0.0 works properly with Rails 4.1
Add following lines:
gem 'activeadmin', github: 'gregbell/active_admin' # ActiveAdmin backend framework for Rails administration interface
gem 'polyamorous', github: 'activerecord-hackery/polyamorous' # Require for ActiveAdmin to work with Rails 4.1
gem 'ransack', github: 'activerecord-hackery/ransack' # Require for ActiveAdmin to work with Rails 4.1
gem 'formtastic', github: 'justinfrench/formtastic' # Require for ActiveAdmin to work with Rails 4.1
gem 'devise' # Authentication

Related

CentOS .NET Core 6.0 installs wrong runtime version

These are 2 commands I ran trying to install .net core 6.0 on CentOS 8 Stream:
sudo dnf install dotnet-runtime-6.0
Last metadata expiration check: 0:12:04 ago on Tue 23 Nov 2021 17:38:47 UTC.
. . .
Installed:
dotnet-host-6.0.0-0.6.28be3e9a006d90d8c6e87d4353b77882829df718.el8.x86_64
dotnet-hostfxr-6.0-6.0.0-0.6.28be3e9a006d90d8c6e87d4353b77882829df718.el8.x86_64
dotnet-runtime-6.0-6.0.0-0.6.28be3e9a006d90d8c6e87d4353b77882829df718.el8.x86_64
lttng-ust-2.8.1-11.el8.x86_64
userspace-rcu-0.10.1-4.el8.x86_64
Complete!
[/usr/local/bin]$ dotnet --list-runtimes
Microsoft.NETCore.App 6.0.0-rc.2.21470.23 [/usr/lib64/dotnet/shared/Microsoft.NETCore.App]
Install says it installed 6.0.0-0.6 but the actual version is 6.0.0-rc.2.21470.23 and my app is failing with error:
It was not possible to find any compatible framework version
The framework 'Microsoft.NETCore.App', version '6.0.0' (x64) was not found.
- The following frameworks were found:
6.0.0-rc.2.21470.23 at [/usr/lib64/dotnet/shared/Microsoft.NETCore.App]
Can it be fixed without manual .net install ?
SOLUTION (worked)
add repo to the OS:
sudo rpm -Uvh https://packages.microsoft.com/config/centos/8/packages-microsoft-prod.rpm
change it priority to preceed the OS:
echo 'priority=50' | sudo tee -a /etc/yum.repos.d/microsoft-prod.repo
install
sudo dnf install dotnet-runtime-6.0
reboot the machine
CentOS 8 Stream seems to have an out-of-date version of .NET 6.
That the version is old is kind of my fault; I need to update the package in CentOS Stream 8 (which really copies what's in RHEL 8.6 and that's the one I will fix).
The version showed by dotnet --info is correct.
The RPM package versioning is a workaround in that CentOS (and RHEL and Fedora until recently) don't have a way of reflecting pre-release versions of an upstream that is about to a release 6.0. We are forced to use a version "6.0" and Release with "0.X" to say "this is a pre-release of 6.0". I could have called it "6.0-0.6.rc2", but this build isn't even exact "6.0 RC2", it was a pre-RC2 snaphost (commit 28be3e9a006d90d8c6e87d4353b77882829df718 from dotnet/installer repository).
If you urgently need .NET 6, here are some options to consider:
If you need a container, try out registry.access.redhat.com/ubi8/dotnet-60-runtime.
Use a manual (not package) install of .NET 6: https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#manual-install
Add the Microsoft RPM repository (repo file) and then use solution 3 to make sure it take precedence over the CentOS repository.

Could not start rails server on Ubuntu 20.04

I can't start my rails app after installing Ubuntu 20.04
There is traceback.
Also, I have the same errors:
...rbenv/versions/2.6.3/lib/ruby/2.6.0/x86_64-linux/etc.so: warning: already initialized constant Etc::...
then I've checked my rails version.
After reinstall my OS via erase, I have restored my backup of /home from Ubuntu 18.04
and checked my version of ruby rails and nodejs. Ruby and rails were the same, but I have to install nodejs and some postgres packages. Now, after that I've tried to run rails s in my project folder and there errors from traceback were appeared. Also, the command
yarn install --check-files
can't finish successfully, cause
info There appears to be trouble with your network connection. Retrying... error.
What should I do to start my app successfully?
My gemfile:
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.6.3'
gem "rails_12factor"
# gem "hashid-rails", "~> 1.0"
gem 'dotenv-rails', groups: [:development, :test]
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.0.2', '>= 6.0.2.2'
# Use postgresql as the database for Active Record
gem 'pg', '>= 0.18', '< 2.0'
# Use Puma as the app server
gem 'puma', '~> 4.1'
# Use SCSS for stylesheets
# gem 'sass-rails', '>= 6'
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
gem 'webpacker', '~> 4.0'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.7'
# Use Redis adapter to run Action Cable in production
gem 'redis', '~> 4.0'
# Use Active Model has_secure_password
# gem 'bcrypt', '~> 3.1.7'
gem 'pry'
# Use Active Storage variant
# gem 'image_processing', '~> 1.2'
# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.4.2', require: false
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
gem 'rspec-rails'
gem 'database_cleaner'
gem 'selenium-webdriver'
end
group :development do
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
end
gem 'minitest-rails'
group :test do
gem 'minitest-rails-capybara'
gem 'capybara', '>= 2.15'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem "active_model_serializers"
Ruby: ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux]
Rails: Rails 6.0.2.2
Nodejs: v10.19.0
run `gem uninstall etc`
and then gem update etc --default
Okey, after post of #Bodh1004 I have an idea to do the same action with ffi gem, and this is works! Thanks for the idea!
Anyway, i have the same already initialized constant errors:
/home/procy/.rbenv/versions/2.6.3/lib/ruby/2.6.0/forwardable.rb:116: warning: already initialized constant Forwardable::VERSION
/home/procy/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/forwardable-1.3.1/lib/forwardable/version.rb:3: warning: previous definition of VERSION was here
/home/procy/.rbenv/versions/2.6.3/lib/ruby/2.6.0/forwardable.rb:117: warning: already initialized constant Forwardable::FORWARDABLE_VERSION
/home/procy/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/forwardable-1.3.1/lib/forwardable/version.rb:4: warning: previous definition of FORWARDABLE_VERSION was here
I'll try to solve them.
Remove yarn.lock and log errors
And repeat

Jekyll via Bash on Windows 10: `jekyll new blog` returns error `Bundler: ruby: No such file or directory.`

I followed the instruction from the jekyll for Windows page, but cannot manage to get jekyll to work on my windows system.
After finishing the installation process (which requires separate handling of the nokogiri gem), trying to create a new jekyll page returns the error:
root#LAPTOP-79P42G17:/mnt/c/Users/Stan# jekyll new asdf
Running bundle install in /mnt/c/Users/Stan/asdf...
Bundler: ruby: No such file or directory -- /usr/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/exe/bundle (LoadError)
I've reinstalled all gems to no avail. jekyll -v returns jekyll 3.7.2, ruby -v returns ruby 2.3.6p384 (2017-12-14 revision 61254) [x86_64-linux-gnu]
Any help?
Solution
Contrary to what the instruction say install the most recent version of ruby, otherwise conflicts will emerge, since all other components needed for jekyll are of the most recent version.
In my case the most recent stable version of ruby is 2.5, such that
sudo apt-add-repository ppa:brightbox/ruby-ng
sudo apt-get update
sudo apt-get install ruby2.5 ruby2.5-dev build-essential dh-autoreconf
was needed. The rest of the installation steps remain unchainged.

jruby/cucumber: Bundle install doesn't install any gem

I'm on Windows 10 x64 and I've installed JRuby 1.7.8 (I tried the files for x64 and 32bits with the same problem) and JRE 7.
I was trying to have my Cucumber Test Framework running on a different machine. I downloaded my current branch (which is working fine in other computers, with all the settings: env.rb, Gemfile, etc) and then I installed successfully these 2 gems:
gem install bundler
gem install cucumber
The Gemfile I have contains loads of gems, similar to:
source 'https://rubygems.org'
gem "httpclient"
gem "watir-webdriver"
but when I execute:
bundle install
I just get this line and nothing gets installed, it finishes almost immediately. No Gemfile.lock is created, etc.
D:\project>bundle install
io/console not supported; tty will not be manipulated
D:\project>
Any idea what could be wrong and what I could try please?
Not quite sure if the issue has anything to do with the line above (which I had never seen in the other machines that are working). If it's not related and you've got an idea about both problems, please let me know and I'll have a look as well...
I've been trying for a few more hours and still not success, adding further info in case someone can spot something pls. Even 'bundle -v' doesn't work on this machine?!
D:\project>gem list
io/console not supported; tty will not be manipulated
*** LOCAL GEMS ***
builder (3.2.2)
bundler (1.13.2)
cucumber (2.4.0)
cucumber-core (1.5.0)
cucumber-wire (0.0.1)
diff-lcs (1.2.5)
gherkin (4.0.0)
jruby-win32ole (0.8.5)
multi_json (1.12.1)
multi_test (0.1.2)
rake (10.1.0)
D:\project>bundle -v
io/console not supported; tty will not be manipulated
D:\project>
Cheers!!
You have the latest version of bundler 1.13.2 installed and I have seen it cause different types of issues depending on the jruby version and some other gems. Bundler 1.10.6 works everytime for my Jruby 1.7.x.
Try these:
gem uninstall bundler
and
gem install bundler -v 1.10.6
Although I am not particularly familiar with jruby, it appears to be a bug, which is resolved in JRuby 1.7.24.
I would verify that the other computers this is working on are still on that version of jruby (assuming they are windows boxes).

Installing foreman on Ubuntu from source

I'm working locally on a NodeJS Heroku app, and I'd like to use foreman to run my app. It apparently didn't install with the Heroku toolbelt (has anyone else had this problem?).
Is there a way to re-install the Heroku toolbelt to get foreman? Or could I get foreman from git? I saw the instructions here but after getting the repo and executing:
git submodule init
git submodule update
It still says that the "foreman" command is not found. What can I do to get foreman to work?
Thanks
Edit: I'm using Ubuntu
Your best bet is to probably install it with Rubygems. You don't mention which OS your on, but we'll assume your not on something mental like Windows (;))
gem -v
if you've got a version back, skip the next bit. You should only need to install RubyGems on Ubuntu (OS X has it in most recent versions)
Ubuntu only
sudo apt-get install rubygems
then
gem install foreman
The project you linked to, http://theforeman.org/projects/foreman, is not Heroku's foreman.
Heroku's foreman is a Ruby gem, and must be installed as a Ruby gem:
$ [sudo] gem install foreman
Whether you need to use sudo depends on your environment, how you installed ruby and rubygems, etc.
I just wanted to amend #Neil's answer. You need to install ruby, not rubygems.
sudo apt-get install ruby
When Ruby is installed you can then install foreman.
gem install foreman --no-rdoc --no-ri
(You don't need --no-rdoc --no-ri but I like to install gems without the documentation on production boxes)
Also take a look at rvm if you're a Ruby person. You might not want to use Ubuntu/Debian's version of Ruby.

Resources