twinslash / redmine_omniauth_google

This plugin is used to authenticate in redmine through Google.
http://www.redmine.org/plugins/redmine_omniauth_google
94 stars 103 forks source link

json gem doesn't build with ruby 2.2 #38

Closed gyscos closed 7 years ago

gyscos commented 7 years ago

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). https://github.com/twinslash/redmine_omniauth_google/issues/24#issuecomment-172893420 seems to indicate that this plugin works with redmine 3.2, how can I properly install it?

Thanks!

auxlife commented 7 years ago

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

gyscos commented 7 years ago

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

gyscos commented 7 years ago

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

auxlife commented 7 years ago

@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 commented 7 years ago

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?