2
respostas

Erro Rails bundle

Eu tenho um problema no meu trabalho, já tentei de todas as maneiras possiveis instalar o JSON, mas sem sucesso. Alguem pode me ajudar?. Quando eu dou um "bundle install" estoura esse erro no ubuntu. Segue o erro:

Fetching gem metadata from https://rubygems.org/..........
Using rake 10.4.2
Using i18n 0.7.0
Fetching json 1.8.3


Your user account isn't allowed to install to the system RubyGems.
  You can cancel this installation and run:

      bundle install --path vendor/bundle

  to install the gems into ./vendor/bundle/, or you can enter your password
  and install the bundled gems to RubyGems using sudo.

  Password: 
Installing json 1.8.3 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/tmp/bundler20180905-2562-dhijicjson-1.8.3/gems/json-1.8.3/ext/json/ext/generator
/usr/bin/ruby2.5 -r ./siteconf20180905-2562-107diqr.rb extconf.rb
creating Makefile

current directory:
/tmp/bundler20180905-2562-dhijicjson-1.8.3/gems/json-1.8.3/ext/json/ext/generator
make "DESTDIR=" clean

current directory:
/tmp/bundler20180905-2562-dhijicjson-1.8.3/gems/json-1.8.3/ext/json/ext/generator
make "DESTDIR="
compiling generator.c
generator.c: In function ‘generate_json’:
generator.c:861:25: error: ‘rb_cFixnum’ undeclared (first use in this function);
did you mean ‘mFixnum’?
     } else if (klass == rb_cFixnum) {
                         ^~~~~~~~~~
                         mFixnum
generator.c:861:25: note: each undeclared identifier is reported only once for
each function it appears in
generator.c:863:25: error: ‘rb_cBignum’ undeclared (first use in this function);
did you mean ‘rb_cFixnum’?
     } else if (klass == rb_cBignum) {
                         ^~~~~~~~~~
                         rb_cFixnum
Makefile:242: recipe for target 'generator.o' failed
make: *** [generator.o] Error 1

make failed, exit code 2

Gem files will remain installed in
/tmp/bundler20180905-2562-dhijicjson-1.8.3/gems/json-1.8.3 for inspection.
Results logged to
/tmp/bundler20180905-2562-dhijicjson-1.8.3/extensions/x86_64-linux/2.5.0/json-1.8.3/gem_make.out

An error occurred while installing json (1.8.3), and Bundler cannot
continue.
Make sure that `gem install json -v '1.8.3' --source 'https://rubygems.org/'`
succeeds before bundling.

In Gemfile:
  bootstrap-kaminari-views was resolved to 0.0.5, which depends on
    rails was resolved to 4.2.4, which depends on
      actionmailer was resolved to 4.2.4, which depends on
        actionpack was resolved to 4.2.4, which depends on
          actionview was resolved to 4.2.4, which depends on
            rails-dom-testing was resolved to 1.0.7, which depends on
              rails-deprecated_sanitizer was resolved to 1.0.3, which depends on
                activesupport was resolved to 4.2.4, which depends on
                  json
2 respostas

Oi Krystian, estranho isso, parece problema de permissão. Ai a solução vai depender de como você instalou o Ruby, RVM, etc.. Mas você tentou usado o sudo no bundle install? Não é recomendado, mas pra testar é mais fácil do que reinstalar as demais coisas...

Olá Krystian blz?

Existe um problema de compatibilidade de versão.

Pode por gentileza postar seu arquivo gemfile?

Tenta instalar a gem com o seguinte comando e nos fale o que acontece:

gem install json