adauth 2.0.0 errors with Rails 3.1 - ruby-on-rails-3.1

I'm currently testing an upgrade to Rails 3.1 for my app and as part of that my adauth gem was upgraded to 2.0.0 (from 1.2.1)
I followed the config changes mentioned in the adauth migration wiki. Specifically, my user model (called Analyst), now has this:
include Adauth::Rails::ModelBridge
and it has the new AdauthMappings and AdauthSearchField mappings defined, etc.
The problem I'm having is with this line in my sessions_controller#create:
analyst = Analyst.return_and_create_with_adauth(ldap_user)
which craps out with:
Following are details of the error:
Message:undefined method `return_and_create_with_adauth' for #<Class:0x0000000cc41dd0>
Stack Trace: /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.1.12/lib/active_record/base.rb:1099:in `method_missing'
/apps/automatix/trunk/automatix/app/controllers/sessions_controller.rb:13:in `create'
/usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.1.12/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
/usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.1.12/lib/abstract_controller/base.rb:167:in `process_action'
/usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.1.12/lib/action_controller/metal/rendering.rb:10:in `process_action'
Has anyone encountered this?
Of course, I don't have to migrate to 2.0.0 and downgrading to 1.2.1 works just fine.. but this is just out of curiosity.
Thanks
P.S. I tried to tag this with adauth, hoping to keep it more focused but apparently that tag doesn't exist and I can't create it.

I had the same problem, after inspecting the code there was a slight change between 1.2.1 and 2.0.X.
You need to change the method name from return_and_create_with_adauth to return_and_create_from_adauth. The correction would be:
analyst = Analyst.return_and_create_from_adauth(ldap_user)
Here's a link to the new model:
https://github.com/Arcath/Adauth/blob/master/lib/adauth/rails/model_bridge.rb

Related

Unable to execute PHPUnit Tests in Adobe Commerce (Magento 2)

I’m running a local Docker instance of Adobe Commerce (Magento 2) with the following versions:
Magento Enterprise version 2.4.3-p3
phpunit/phpunit version 9.5.28
doctrine/annotations version 2.0.0
allure-framework/allure-php-api version 1.4.0
I’m unable to run PHPUnit tests in PhpStorm (Build #PS-223.8214.64)
The error I’m getting is the following:
Call to undefined method Doctrine\Common\Annotations\AnnotationRegistry::registerUniqueLoader()
Searching for registerUniqueLoader in the vendor directory, I’m seeing the following in Yandex\Allure\Adapter\Annotation\AnnotationProvider:: registerAnnotationNamespaces()
public static function registerAnnotationNamespaces()
{
AnnotationRegistry::registerUniqueLoader('class_exists');
}
However, class Doctrine\Common\Annotations\AnnotationRegistry only has methods reset() and loadAnnotationClass().
Is there a set of module versions I need to be at in order to be able to run PHPUnit tests? Thanks in advance for the help.
Try to change doctrine/annotations version to 1.14.2 in composer.json. It works for me.

Ruby on Rail running apache show index of when accessing the site

I have recently updated to Apache 2.4, and I am using Ruby on Rail to run my application. Following the upgrade, the site shows a content as seen in the image below, and the error on the log file shows this error message. I have tried using the 'Bundle Install' and checked the permission but that hasn't helped. Any advice would be greatly appreciated. Thanks
[ 2022-02-07 07:47:24.5559 8104/7efc89c8f700 age/Cor/App/Implementation.cpp:304 ]: Could not spawn process for application /home/adminuser/hroot: An error occured while starting up the preloader.
Error ID: ba7e6074
Error details saved to: /tmp/passenger-error-RA01E9.html
Message from application: libmysqlclient.so.18: cannot open shared object file: No such file or directory - /usr/local/rvm/gems/ruby-2.0.0-p353#hroot/gems/mysql2-0.3.14/lib/mysql2/mysql2.so (LoadError)
PassengerRuby /usr/local/rvm/gems/ruby-2.0.0-p353#hroot/wrappers/ruby
SetEnv GEM_HOME /root/.gem/ruby/1.9.1
This error shows a problem with the shared objects. You probably updated MySQL/MariaDB libraries with Apache and new libraries are incompatible with your mysql2 gem build. The solution is simple:
First, ensure you are using the ruby-2.0.0-p353#hroot RVM environment.
Then, execute the following command:
gem install mysql2 --version 0.3.14
This should rebuild your mysql2 gem for the new MySQL/MariaDB client libraries on your system.
this isn't the answer anyway but another method to run ruby (in my case Windows 10 ; if you use another OS try to find out how to modify inside index.php the ruby starter)
i post here an alternative method to use apache + php +... and ruby
https://stackoverflow.com/a/71733656/5781320

Compatible Ruby and Cocoapods versions

I am developing a Flutter app for Android and iOS. The app is in a stable state of development on the Android simulator so I thought I would try to run it on the iOS simulator. The Flutter installation process on Macos requires installing Cocoapods. After trying to use the Macos installation of Ruby and encountering permission errors, I decided to try asdf, the latest version of Ruby (Ruby 3.0.3p157 (2021-11-24 revision 3fb7d2cadc) [x86_64-darwin21]), and Cocoapods (1.11.2). The installation appeared to be successful, but running pod results in the following error:
Error loading the plugin cocoapods-plugins-1.0.0.
NoMethodError - undefined method activate' for #<Gem::StubSpecification:0x00007f963819f4f8 #extension_dir=nil, #full_gem_path="/Users/xyz/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0/gems/cocoapods-plugins-1.0.0", #gem_dir=nil, #ignored=nil, #loaded_from="/Users/kevin/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0/specifications/cocoapods-plugins-1.0.0.gemspec", #data=#<Gem::StubSpecification::StubLine:0x00007f9638194850 #name="cocoapods-plugins", #version=#<Gem::Version "1.0.0">, #platform="ruby", #extensions=[], #full_name="cocoapods-plugins-1.0.0", #require_paths=["lib"]>, #name=nil, #spec=#<Gem::Specification:0x00007f96381cc278 #extension_dir=nil, #full_gem_path="/Users/kevin/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0/gems/cocoapods-plugins-1.0.0", #gem_dir=nil, #ignored=nil, #bin_dir=nil, #cache_dir=nil, #cache_file=nil, #doc_dir=nil, #ri_dir=nil, #spec_dir=nil, #spec_file=nil, #gems_dir="/Users/kevin/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0/gems", #base_dir="/Users/kevin/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0", #loaded=true, #activated=true, #loaded_from="/Users/kevin/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0/specifications/cocoapods-plugins-1.0.0.gemspec", #original_platform=nil, #installed_by_version=#<Gem::Version "3.3.2">, #autorequire=nil, #date=2016-05-10 00:00:00 UTC, #description=" This CocoaPods plugin shows information about all available CocoaPods plugins\n (yes, this is very meta!).\n This CP plugin adds the \"pod plugins\" command to CocoaPods so that you can list\n all plugins (registered in the reference JSON hosted at CocoaPods/cocoapods-plugins)\n", #email=nil, #homepage="https://github.com/cocoapods/cocoapods-plugins", #name="cocoapods-plugins", #post_install_message=nil, #signing_key=nil, #summary="CocoaPods plugin which shows info about available CocoaPods plugins.", #version=#<Gem::Version "1.0.0">, #authors=["David Grandinetti", "Olivier Halligon"], #bindir="bin", #cert_chain=[], #dependencies=[<Gem::Dependency type=:runtime name="nap" requirements=">= 0">, <Gem::Dependency type=:development name="bundler" requirements="~> 1.3">, <Gem::Dependency type=:development name="rake" requirements=">= 0">], #executables=[], #extensions=[], #extra_rdoc_files=[], #files=[], #licenses=["MIT"], #metadata={}, #platform="ruby", #rdoc_options=[], #require_paths=["lib"], #required_ruby_version=#<Gem::Requirement:0x00007f96381d7b28 #requirements=[[">=", #<Gem::Version "2.0.0">]]>, #required_rubygems_version=#<Gem::Requirement:0x00007f96381d7ee8 #requirements=[[">=", #<Gem::Version "0">]]>, #requirements=[], #rubygems_version="3.3.2", #specification_version=4, #test_files=[], #new_platform="ruby", #full_name="cocoapods-plugins-1.0.0", #full_require_paths=["/Users/kevin/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0/gems/cocoapods-plugins-1.0.0/lib"] cocoapods-plugins-1.0.0>, #base_dir="/Users/kevin/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0", #gems_dir="/Users/kevin/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0/gems", #default_gem=false, #activated=true> Did you mean? activated? /Users/xyz/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0/gems/claide-1.0.3/lib/claide/command/plugin_manager.rb:93:in safe_activate_and_require'
/Users/xyz/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0/gems/claide-1.0.3/lib/claide/command/plugin_manager.rb:31:in block in load_plugins' /Users/xyz/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0/gems/claide-1.0.3/lib/claide/command/plugin_manager.rb:30:in map'
/Users/xyz/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0/gems/claide-1.0.3/lib/claide/command/plugin_manager.rb:30:in load_plugins' /Users/xyz/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0/gems/claide-1.0.3/lib/claide/command.rb:326:in block in run'
/Users/xyz/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0/gems/claide-1.0.3/lib/claide/command.rb:325:in each' /Users/xyz/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0/gems/claide-1.0.3/lib/claide/command.rb:325:in run'
/Users/xyz/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:52:in run' /Users/xyz/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0/gems/cocoapods-1.11.2/bin/pod:55:in <top (required)>'
/Users/xyz/.asdf/installs/ruby/3.0.3/bin/pod:25:in load' /Users/xyz/.asdf/installs/ruby/3.0.3/bin/pod:25:in '
I do not need a fix. I just want to know versions of Ruby and Cocoapods that are compatible and allow me to make progress on developing my Flutter app on Macos.
After I posted the above issue, others encountered the same problem as reported here: https://github.com/CocoaPods/CocoaPods/issues/11134
The workaround for the problem is to use Ruby 2.7.5. After installing that version, I found Cocoapods 1.11.2 is compatible with Ruby 2.7.5.
brew install ruby#2.7
export PATH="/usr/local/opt/ruby#2.7/bin:$PATH"

Xcode Project Navigator, Cannot access Project

I am struggling a lot with this. And I know that the answer is staring me in the face somewhere but no matter what I search or look up and try, nothing works.
My schemes are all pointing to my pod frameworks and I cannot select the project target, even if I try and add a new scheme or edit an old one.
My project navigator starts with a folder as shown above, and I have NO idea how to revert back to whatever I had done to get it like this.
If anyone has any suggestions please help.
I cannot access target build settings or project build settings, Is there a way to access them without going through the project navigator ?
I cannot build properly as shown from the schemes, is there an easy fix to this ? Have I somehow changed the target path to an incorrect file location? How to revert back ?
I'm stuck :(
UPDATE:
deleting the .xcworkspace file and reinstalling the podfile gives below error code.
```
RuntimeError - [Xcodeproj] Unknown object version.
/Applications/CocoaPods.app/Contents/Resources/bundle/lib/ruby/gems/2.2.0/gems/xcodeproj-1.5.8/lib/xcodeproj/project.rb:218:in `initialize_from_file'
/Applications/CocoaPods.app/Contents/Resources/bundle/lib/ruby/gems/2.2.0/gems/xcodeproj-1.5.8/lib/xcodeproj/project.rb:103:in `open'
/Applications/CocoaPods.app/Contents/Resources/bundle/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.2/lib/cocoapods/installer/analyzer.rb:918:in `block (2 levels) in inspect_targets_to_integrate'
/Applications/CocoaPods.app/Contents/Resources/bundle/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.2/lib/cocoapods/installer/analyzer.rb:917:in `each'
/Applications/CocoaPods.app/Contents/Resources/bundle/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.2/lib/cocoapods/installer/analyzer.rb:917:in `block in inspect_targets_to_integrate'
/Applications/CocoaPods.app/Contents/Resources/bundle/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.2/lib/cocoapods/user_interface.rb:64:in `section'
/Applications/CocoaPods.app/Contents/Resources/bundle/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.2/lib/cocoapods/installer/analyzer.rb:912:in `inspect_targets_to_integrate'
/Applications/CocoaPods.app/Contents/Resources/bundle/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.2/lib/cocoapods/installer/analyzer.rb:78:in `analyze'
/Applications/CocoaPods.app/Contents/Resources/bundle/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.2/lib/cocoapods/installer.rb:243:in `analyze'
/Applications/CocoaPods.app/Contents/Resources/bundle/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.2/lib/cocoapods/installer.rb:154:in `block in resolve_dependencies'
/Applications/CocoaPods.app/Contents/Resources/bundle/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.2/lib/cocoapods/user_interface.rb:64:in `section'
/Applications/CocoaPods.app/Contents/Resources/bundle/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.2/lib/cocoapods/installer.rb:153:in `resolve_dependencies'
/Applications/CocoaPods.app/Contents/Resources/bundle/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.2/lib/cocoapods/installer.rb:116:in `install!'
/Applications/CocoaPods.app/Contents/Resources/bundle/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.2/lib/cocoapods/command/install.rb:41:in `run'
/Applications/CocoaPods.app/Contents/Resources/bundle/lib/ruby/gems/2.2.0/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
/Applications/CocoaPods.app/Contents/Resources/bundle/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.2/lib/cocoapods/command.rb:52:in `run'
/Applications/CocoaPods.app/Contents/Resources/bundle/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.2/bin/pod:55:in `<top (required)>'
/Applications/CocoaPods.app/Contents/Resources/bundle/bin/pod:22:in `load'
/Applications/CocoaPods.app/Contents/Resources/bundle/bin/pod:22:in `<main>'
```
――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
[!] Oh no, an error occurred.
Search for existing GitHub issues similar to yours:
https://github.com/CocoaPods/CocoaPods/search?q=%5BXcodeproj%5D+Unknown+object+version.&type=Issues
If none exists, create a ticket, with the template displayed above, on:
https://github.com/CocoaPods/CocoaPods/issues/new
Be sure to first read the contributing guide for details on how to properly submit a ticket:
https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md
Don't forget to anonymize any private data!
Looking for related issues on cocoapods/cocoapods...
- RuntimeError - [Xcodeproj] Unknown object version.
https://github.com/CocoaPods/CocoaPods/issues/6992 [closed] [16 comments]
31 Jan 2019
- - ERROR | [iOS] unknown: Encountered an unknown error (Malformed version number string ) during validation.
https://github.com/CocoaPods/CocoaPods/issues/8240 [closed] [16 comments]
12 hours ago
- Xcodeproj doesn't know about the following attributes {"inputFileListPaths"=>[], "outputFileListPaths"=>[]} for the 'PBXShellScriptBuildPhase' isa
https://github.com/CocoaPods/CocoaPods/issues/7835 [closed] [46 comments]
2 hours ago
and 44 more at:
https://github.com/cocoapods/cocoapods/search?q=%5BXcodeproj%5D%20Unknown%20object%20version.&type=Issues&ut
SOLUTION:
To my particularly specific problem, I had permission issues with the RUBYGEMS that is installed by default on all MAC devices.
I was not able to rebase my project to its original state as I did not have "write privileges". I had to install homebrew and rbenv which allowed me to (after deleting my cocoapods out of the project entirely) rebase my project to its original state before whatever I had done to rebase the file target to something else.
After installing Homebrew and Rbenv I installed a newer version of RubyGem which gave me admin permissions on the new install. Then I reinstalled cocoapods to the project and VOILA. Problem solved.

Getting error while migrating db in ruby on rails project on windows 7, with ruby 2.3.3 and rails 4.2.5.2

I am getting below errors on prelauch project on github. I have install postgres db but i am not getting which gem is having PGconn , PGresult and PGerror.
The PGconn, PGresult, and PGError constants are deprecated, and will be
removed as of version 1.0.
 
You should use PG::Connection, PG::Result, and PG::Errenter code hereor instead, respectively.enter code here
Called from C:/Ruby23/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5.2/lib/active_support/dependencies.rb:240:in `load_dependency
'
== 20130127063936 DeviseCreateAdminUsers: migrating ===========================
-- create_table(:admin_users)
   -> 0.2293s
-- add_index(:admin_users, :email, {:unique=>true})
   -> 0.0638s
-- add_index(:admin_users, :reset_password_token, {:unique=>true})
   -> 0.0658s
== 20130127063936 DeviseCreateAdminUsers: migrated (0.3603s) ==================
 
rake aborted!
LoadError: cannot load such file -- bcrypt_ext
D:/Projects/prelaunchr/db/migrate/20130127063936_devise_create_admin_users.rb:5:in `migrate'
C:in `migrate'
LoadError: cannot load such file -- 2.3/bcrypt_ext
D:/Projects/prelaunchr/db/migrate/20130127063936_devise_create_admin_users.rb:5:in migrate'
C:in migrate'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
Ruby version: 2.3.3
Rails version : 4.2.5.2
According to this issue: https://github.com/rails/rails/issues/29521, lock your pg version to 0.20 will stop the warning message.
However, your LoadError seems another issue, which you may need to place the file in right place.

Resources