ActiveRecord 5.2.0.rc1 & Representable Error - ruby-on-rails

I updated the application and received an error with Representable:
activerecord-5.2.0.rc1/lib/active_record/coders/yaml_column.rb:24:in
load': undefined methodnew' for Representable::JSON:Module
(NoMethodError)
Can anybody help me with it?

This issue has been reported here: https://github.com/trailblazer/representable/issues/224
It was a Rails 5.2 RC1 issue and has been fixed: https://github.com/rails/rails/pull/31855

Related

I am getting error when using hook in Rails application

Can some explain what these two line is used for in the application.html.haml file. I am using Rails 6
= hook(:stylesheet_includes, self) do
#{yield :stylesheet_includes}
I am getting the following error
undefined method `hook' for #<#<Class:0x000000000bb090b8>:0x0000000007886f10>

undefined method `+' for nil:NilClass in sample saml application

Trying to follow the setup here to create a simple SAML application (full project I got here).
I went through and did the setup
bundle install
rails s
This went fine, but when I navigate to
http://localhost:3000/
I get hit with
NoMethodError in SamlController#init
undefined method `+' for nil:NilClass
Extracted source (around line #9):
def init
request = OneLogin::RubySaml::Authrequest.new
direct_to(request.create(saml_settings))
end
def consume
I added some logging to check nil status of request and saml_settings but that seems to return false for both of them
puts request.nil?
puts saml_settings.nil?
Error trace:
Processing by SamlController#init as HTML
false
false
Created AuthnRequest: <samlp:AuthnRequest AssertionConsumerServiceURL='http://localhost:3000/saml/consume' ID='_394fa0a0-f313-0135-85a4-6a0001e18280' IssueInstant='2018-02-13T17:42:45Z' Version='2.0' xmlns:saml='urn:oasis:names:tc:SAML:2.0:assertion' xmlns:samlp='urn:oasis:names:tc:SAML:2.0:protocol'><saml:Issuer>http://localhost:3000/saml/consume</saml:Issuer></samlp:AuthnRequest>
Completed 500 Internal Server Error in 15ms (ActiveRecord: 0.0ms)
NoMethodError (undefined method `+' for nil:NilClass):
app/controllers/saml_controller.rb:9:in `init'
(Note: the error is line 5, it says line 9 for me because of debug logging I added)
I'm not too sure what else it could be, not sure what method it can't find and what is nil?
I have never messed with ruby stuff, but from my initial looks I'm not sure where the nil is coming from, the logs show the request being created so not sure. Any help would be appreciated, thanks!
Firstly I think you're using a pretty old ruby-saml gem version. That might be the problem.
I haven't tested your code, but it seems to me that you forgot to set idp_sso_target_url in your settings, and apparently that's the only place it can throw the exception you got. https://github.com/onelogin/ruby-saml/blob/v1.1.2/lib/onelogin/ruby-saml/authrequest.rb#L39
Posting the answer here, turns out that i was using a metadata url for the OKTA_METADATA environment variable.
Had to modify
settings = idp_metadata_parser.parse(ENV['OKTA_METADATA'])
to
settings = idp_metadata_parser.parse_remote(ENV['OKTA_METADATA'])
where
OKTA_METADATA=http://blahblahblah.com/metadata

prerendering in react_on_rails app is throwing error

Whenever I switch prerendering to true for my react component in my rails view I'm getting this error
undefined local variable or method `e' for ReactOnRails::ServerRenderingPool::Exec:Class
I've found on the shakacode site that there's a typo in lib/react_on_rails/server_rendering_pool/exec.rb
but I don't know how to access that file - it's nowhere in my directory - am I completely missing something here?
This has been fixed already on: https://github.com/shakacode/react_on_rails/pull/1020

Block Chain Ethereum Error NoMethodError: undefined method `keys' for nil:NilClass

I am integrating Block chain with my Rails App , so I am using Ethereum gem
to host the data to the blockchain.
I am getting the below error when i am trying to implement Ethereum to my Rails App.
I am using the following gem enter link description here
While i am trying the following command
init = Ethereum::Initializer.new("#{ENV['PWD']}/SimpleNameRegistry.sol", client)
I am getting the below error
NoMethodError: undefined method `keys' for nil:NilClass
when I try to debug inside the gem I received the following error code in the below line.
Error Line:
sol_output = #client.compile_solidity(#file)
Error Code:
{"jsonrpc"=>"2.0", "error"=>{"code"=>-32600, "message"=>"EOF"}}
Please help me to get out of this error as I am stuck with this.
Please also suggest me with an easy implementation of block chain with rails.

jQuery undefined in 1.2 stable jquery.mobile.js

I have updated jquery.mobile-1.0b2.js to jquery.mobile-1.2.0.js. I am getting jQuery undefined error.
In the previous beta version, I have modified the js as
(function(jQuery) {
// beta version code here..
})(custom.jquery);
where custom.jquery is defined as
custom.jquery = jQuery.noConflict(true);
in the jquery.js
I have done similar wrapping in the stable 1.2 js and got the undefined error.
Without wrapping also got the same error.
Please advice me.

Resources