MultiJson AdapterError Rails 4 Ruby 2 Passenger

I am trying to set up rails on aws (Dev env works fine). It is not possible to start production correctly. Can shell in and db look good. I looked into my log file and I get the following error.

rake aborted!
MultiJson::AdapterError: Did not recognize your adapter specification (cannot load such file -- json/ext/parser).

You have MultiJsonboth Jsongems installed and in the gemlock file.

This happens during asset compilation.

+4
source share
3 answers

, 100%, - , multi_json 1.7.8 , . , , , , , , ! :

Gemfile :

gem 'multi_json', '1.7.8' 

:

bundle update multi_json

:

git add .
git commit -m "Downgrade multi_json gem"

AWS:

git aws.push

.


, , , , Gemfile.lock.

Gemfile.lock:

rm Gemfile.lock

:

bundle install

aws.

+6

. :

Started POST "/users/sign_in" for 173.228.60.113 at 2015-09-29 15:53:47 +0000

MultiJson::AdapterError (Did not recognize your adapter specification (cannot load such file -- json/ext/parser).):
  activesupport (3.2.3) lib/active_support/dependencies.rb:251:in `require'
  activesupport (3.2.3) lib/active_support/dependencies.rb:251:in `block in require'
  activesupport (3.2.3) lib/active_support/dependencies.rb:236:in `load_dependency'
  activesupport (3.2.3) lib/active_support/dependencies.rb:251:in `require'
  json (1.8.3) lib/json/ext.rb:13:in `'
  json (1.8.3) lib/json/ext.rb:12:in `'
  json (1.8.3) lib/json/ext.rb:9:in `'

bundle show ( ec2) , ​​json gem:

[ec2-user@ip-172-31-43-145 current]$ bundle show json
/usr/local/share/gems1.9/gems/json-1.8.3

ext/json/ext/parser/parser.so

. , . - lib/json/ext

:

ln -s ../../../ext/json/ext/parser/parser.so .

.

generator.so. , lib/json/ext, :

ln -s ../../../ext/json/ext/generator/generator.so .

ext/json fbuffer, .h, no.so.

. , , gem.rb, ext/json/json.rb

, , , . , - , . .

0

After solving the situation when I could not return the version, I found another solution to the problem.

We are simply missing out on the corresponding dependent pearls. This helped me fix this without downgrading:

gem install json

Hope this also helps other people with this problem. I came from Google, so hopefully there will be other people too.

-1
source

Source: https://habr.com/ru/post/1535647/


All Articles