Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

json gem doesn't build with ruby 2.2 #38

Closed
gyscos opened this issue Aug 3, 2017 · 5 comments
Closed

json gem doesn't build with ruby 2.2 #38

gyscos opened this issue Aug 3, 2017 · 5 comments

Comments

@gyscos
Copy link

gyscos commented Aug 3, 2017

For easy reproducibility, here is a Dockerfile:

FROM redmine:3.2

RUN apt-get update && apt-get install -y build-essential
RUN git clone https://github.com/twinslash/redmine_omniauth_google.git
RUN cd redmine_omniauth_google && bundle install --no-deployment

Attempting to build this container gives the following error:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /usr/local/bundle/gems/json-1.7.5/ext/json/ext/generator
/usr/local/bin/ruby -r ./siteconf20170803-7-8500vk.rb extconf.rb
creating Makefile

current directory: /usr/local/bundle/gems/json-1.7.5/ext/json/ext/generator
make "DESTDIR=" clean

current directory: /usr/local/bundle/gems/json-1.7.5/ext/json/ext/generator
make "DESTDIR="
compiling generator.c
In file included from generator.c:1:0:
../fbuffer/fbuffer.h: In function 'fbuffer_to_s':
../fbuffer/fbuffer.h:179:47: error: macro "rb_str_new" requires 2 arguments, but
only 1 given
     VALUE result = rb_str_new(FBUFFER_PAIR(fb));
                                               ^
../fbuffer/fbuffer.h:179:20: warning: initialization makes integer from pointer
without a cast
     VALUE result = rb_str_new(FBUFFER_PAIR(fb));
                    ^
In file included from generator.c:2:0:
generator.c: In function 'cState_aref':
generator.h:75:27: warning: variable 'state' set but not used
[-Wunused-but-set-variable]
     JSON_Generator_State *state;              \
                           ^
generator.c:632:5: note: in expansion of macro 'GET_STATE'
     GET_STATE(self);
     ^
Makefile:237: recipe for target 'generator.o' failed
make: *** [generator.o] Error 1

make failed, exit code 2

Gem files will remain installed in /usr/local/bundle/gems/json-1.7.5 for
inspection.
Results logged to
/usr/local/bundle/extensions/x86_64-linux/2.2.0/json-1.7.5/gem_make.out

An error occurred while installing json (1.7.5), and Bundler cannot continue.
Make sure that `gem install json -v '1.7.5'` succeeds before bundling.

In Gemfile:
  json

It seems the json package cannot properly build with this ruby version (2.2.7p470). #24 (comment) seems to indicate that this plugin works with redmine 3.2, how can I properly install it?

Thanks!

@gyscos gyscos changed the title JSON doesn't build with ruby 2.2 json gem doesn't build with ruby 2.2 Aug 3, 2017
@auxlife
Copy link

auxlife commented Aug 24, 2017

@gyscos Any luck on trying to get the json gem1.7.5 to install?

@gyscos
Copy link
Author

gyscos commented Aug 24, 2017

I didn't try anything else. I'm still unsure how to install this plugin.

@gyscos
Copy link
Author

gyscos commented Aug 24, 2017

Aaah it works if I run bundle install from the redmine repository (or even the plugins repository), not from the redmine_omniauth_google repository...

@gyscos gyscos closed this as completed Aug 24, 2017
@auxlife
Copy link

auxlife commented Aug 25, 2017

@gyscos i'm glad that worked for you; however i'm still having that same issue with ruby 2.3.4p301 and redmine 3.4.2; bundle install works from the redmine root directory, but when i restart apache and try to load redmine it fails with an error that required gems are missing and to run bundle install.

@gyscos
Copy link
Author

gyscos commented Aug 25, 2017

My working dockerfile:

FROM redmine

RUN apt-get update && apt-get install -y build-essential

# Other plugins...

RUN git clone https://github.com/twinslash/redmine_omniauth_google /usr/src/redmine/plugins/redmine_omniauth_google
RUN cd /usr/src/redmine && bundle install

The resulting installation has a working google_omniauth and the following environment:


Environment:
  Redmine version                3.4.2.stable
  Ruby version                   2.4.1-p111 (2017-03-22) [x86_64-linux]
  Rails version                  4.2.8
  Environment                    production
  Database adapter               SQLite
SCM:
  Subversion                     1.8.10
  Mercurial                      3.1.2
  Bazaar                         2.7.0
  Git                            2.1.4
  Filesystem                     
Redmine plugins:
  redmine_contacts               4.1.1
  redmine_custom_css             0.1.6
  redmine_landing_page           0.1.1
  redmine_omniauth_google        0.0.1
  redmine_slack                  0.2

Does this not work for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants