Using authlogic 2.1.3, and authlogic-oid 1.0.4 I receive the following error as soon as rails hits a controller making a request to an OpenID provider:
uninitialized constant OpenIdAuthentication::InvalidOpenId
I also have the following installed:
rack-openid (0.2.1)
ruby-openid (2.1.7)
rails/open_id_authentication plugin
Gems in environment.rb are configured as such:
config.gem "authlogic"
config.gem "authlogic-oid", :lib => "authlogic_openid"
config.gem "ruby-openid", :lib => "openid"
Any suggestions would be appreciated, thank you.
rails/open_id_authentication plugin has been updated a few days ago and it breaks compatibility with the authlogic_openid gem (v=1.0.4).
Youl'll have to wait until someone fix the authlogic_openid gem (the issue)
I resolved that issue in my authlogic_openid fork, feel free to grab this commit: http://github.com/mreinsch/authlogic_openid/commit/9b802c347f5addebcbce945af3b5f80b3ee7b214
I was having the same trouble and I really wanted open-id with authlogic, so I copied an old version of plugin from one of Ryan Bates' railscasts apps.
Here's the link git#github.com:senthilnambi/open-id.git. Install it like normally and you should be fine.
Hope this helps. :)
Just like senthil provided, but with no # at URL:
script/plugin install git://github.com/senthilnambi/open-id.git
Then I erase the old (plugin/gem) who does not work
Going through the railscast 170. Troubleshooting lead me here. I tried authlogic_openid fork from last poster (mreinsch). This thankfully corrected openid_identifier error long enough for the regular login system to work, but not openid.
It's giving me an name error on the save method as identified in the block. This is apparently used to allow openid to get me to login.
Error Dump:
NameError in User sessionsController#create
uninitialized constant Rack::OpenID
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:443:in `load_missing_constant'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in `const_missing'
/Sites/authlogic_b/vendor/plugins/authlogic_openid/lib/authlogic_openid/session.rb:72:in `save'
/Sites/authlogic_b/app/controllers/user_sessions_controller.rb:8:in `create'
Related
I've been using the yaml_db gem for a long time to dump the database to yaml and then reload it later if needed. On a fresh project, though, on rake db:load I got the error message:
NoMethodError: undefined method `load_documents' for Psych:Module
Did you mean? load_stream
/Users/user/.rvm/gems/ruby-2.5.0/gems/yaml_db-0.6.0/lib/yaml_db.rb:61:in `load_documents'
I am submitting the solution I finally came up with as an answer, but I'm not really happy with it. If anyone has a better solution or a suggestion of something better than the yaml_db gem for dumping and reloading the database, I'd be happy to listen.
I'm running Rails 5.1.4 on Ruby 2.5.0
The solution I came up with was to put the 'psych' gem in my Gemfile before yaml_db and set it to an earlier release:
gem 'psych', '~> 2.2.1'
gem 'yaml_db'
This issue is caused by load_documents being deprecated in Psych and finally removed in ruby 2.5. There's an open PR on yaml_db that fixes this issue, so hopefully future versions will not require you to use this work-around.
Your current solution is probably the easiest for now (short of downgrading your ruby version, which is probably a worse idea).
I get this error: /LiveToChallenge/config/initializers/gibbon.rb:1:in '<top (required)>': uninitialized constant Gibbon::Request (NameError) when I try to start the server rails server.
app/config/initializers/gibbon.rb
require 'gibbon'
Gibbon::Request.api_key = "24e4a2233cd34debb76ed083dc3f8b5379-us8"
Gibbon::Request.timeout = 15
I followed gibbon gem instructions, which seemed simple enough. Maybe I'm missing something besides just gem install gibbon and adding api_key to initializer?
The gem is installed as gibbon (2.2.2, 2.2.1, 1.2.1)
And as added measure I put gem gibbon in the gemfile and ran bundle install
This problem is part of a larger problem I've been working on solving.
I experienced same issue with gibbon 2.0 version as it has updated some methods for initializations then i tried a previous version & it worked but first You should try it this way :
gibbon = Gibbon::Request.new(api_key: "MailChimp_API_Key")
gibbon.timeout = 10
If no luck with this in app/config/initializers/gibbon.rb then you can try to do this direct in the controller just before using gibbon to retrieve or add list stuff for testing.
You should add the gem to the rails Gemfile. Then rails will take care of the require 'gibbon' for you.
Edit: gem install gibbon will just install the gem on your system. Rails won't know that it is needed unless you add it to the Gemfile.
Hi I'm trying to read a pfd in RoR 3.2.8, for that I did:
gem install pdf-toolkit
I added the gem to the Gemfile: gem "pdf-toolkit", "0.5.0"
After i did a bundle install and everything was working, bur now when I try to execute my program I get this error: NoMethodError: undefined method class_inheritable_accessor’ for PDF::Toolkit:Class
I was looking for a solution, but unfortunately I couldn’t solve it, any ideas? Thanks!
Here is a pice of my code:
require 'rubygems'
require 'pdf/toolkit'
class Terminations
def initialize
#seperator = " "
##extract_file = "/uploads/Test and rates.pdf"
end
..
...
end
The method class_inheritable_accessor was removed from ActiveSupport in Rails 3.2. The version of pdf-toolkit you are attempting to use was released in 2006 and it doesn't look like it's even being maintained anymore. There is a 1.0 release candidate that was published in Feb. 2012 that you could try, but I wouldn't recommend depending on an abandoned gem for production use. The github README says the following:
This is a prerelease 1.0.0.rc1 version on an almost abandonned
project. The main difference (broken API) with the 0.5.0 branch is
that support for ActiveRecord has been entirely removed (mostly
because the implementation was ugly so far). If you use pdf-toolkit
and would like activerecord to be included in 1.0.0, please just tell
us and we'll add it. If you upgrade from 0.5.0 to 1.0.0.rc1 and
something else goes wrong, please report the issue on github.
I create rails app deployed on Heroku.
also, exception_notification gem enabled.
when it is on development setup ActionMailer to Gmail,
everything is fine and sends a notification from Gmail address.
but when it comes to production environment on Heroku,
I get following error when server trying to send a email.
ActionView::Template::Error (code converter not found (UTF-8 to UTF-16))
Could anyone tell me what's happening here?
The issue was raised on the main repository (see here), but so far was not addressed.
You might want to take a look at this fork to the exception_notification gem, specifically this commit which tries to deal with the problem:
https://github.com/alanjds/exception_notification/commit/048fc6be972189e62ca3b9453d19233ec5773016
To use this fork I pointed the gem to it, like so:
Gemfile:
gem 'exception_notification', git: 'git://github.com/alanjds/exception_notification.git'
This solved the issue for me.
Quick adjustment to solution by hananamar, otherwise you'll get an error:
gem 'exception_notification', :git => 'git://github.com/alanjds/exception_notification.git', :require => 'exception_notifier'
I know this is an old post but since I got the same issue some days ago, I wanted to share here that I solved it by forcing the latest version of the gem on my Heroku app.
gem 'exception_notification', '3.0.1'
I guess the problem was with version 3.0.0 and it is fixed on 3.0.1.
Has any one come across this error?
NoMethodError (undefined method `new' for LinkedIn:Module)
I think it's related to omniauth and linkedin. Here's my Gemfile:
gem 'omniauth'
gem 'linkedin', :git => "git://github.com/redbeard-tech/linkedin.git", :branch => 'jsapi'
I'm using:
ruby 1.8.7 (2010-01-10 patchlevel 249)
rails 3.0.5
What might be the reason for it?
Check what version of omniauth you are using. We recently ran into this and it was from our dev environment having omniauth 0.3.x and the new environment getting the new 1.0 release. On the omniauth github site it says:
OmniAuth 1.0 has several breaking changes from version 0.x. You can set the dependency to ~> 0.3.2 if you do not wish to make the more difficult upgrade. See the wiki for more information.
I suspect you're being bitten by that.
From the error message it looks like you are calling LinkedIn.new(...), but looking at the documentation it seems like it should be LinkedIn::Client.new('your_consumer_key', 'your_consumer_secret'). LinkedIn is a module, not a class and therefore doesn't have a new method. However, there seems to be class called Client defined within this module, which you have to instantiate.