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

Unable to install commonmarker #160

Open
chargio opened this issue Nov 23, 2017 · 10 comments
Open

Unable to install commonmarker #160

chargio opened this issue Nov 23, 2017 · 10 comments

Comments

@chargio
Copy link

chargio commented Nov 23, 2017

I am trying to use commonmarker (a library to render github markdown provided by github).
bundle install during the build in 2.4 fails because it can't install cmake.

@pvalena
Copy link
Member

pvalena commented Nov 24, 2017

Please paste logs with error message and any configs (f.e. Gemfile, Gemfile.lock) you've used.

@pvalena
Copy link
Member

pvalena commented Nov 24, 2017

(Or link to repo instead of pasting.)

@chargio
Copy link
Author

chargio commented Nov 24, 2017

Use this gemfile and it will fail with an error message about not being able to install cmake:

source 'https://rubygems.org'

git_source(:github) do |repo_name|
  repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
  "https://github.com/#{repo_name}.git"
end


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.1.4'
# Use postgresql as the database for Active Record
gem 'pg', '~> 0.18'
# Use Puma as the app server
gem 'puma', '~> 3.7'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
# gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 3.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

# Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin AJAX possible
# gem 'rack-cors'

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
  gem 'coveralls', require: false
  gem 'database_cleaner'
  gem 'factory_bot_rails'
  gem 'faker'
  gem 'rspec-rails', '~> 3.6'
end

group :development do
  gem 'listen', '>= 3.0.5', '< 3.2'
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
  gem 'rubocop', :require => false
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]


#
# Devise
#
gem 'devise', '~> 4.0'

gem 'octokit', '~> 4.0'
gem 'omniauth'
gem 'omniauth-github'
gem 'github-markup'
gem 'commonmarker' # Needed to render markdown github style
gem 'json-schema'

@pvalena
Copy link
Member

pvalena commented Nov 24, 2017

Do you have any minimal reproducer?
I can see multiple redundant dependencies (mingw for windows, jruby), which can cause your issue.

Also please supply the corresponding log and/or error message.

@chargio
Copy link
Author

chargio commented Nov 30, 2017

Just copy rails-ex and add commonmarker to the Gemfile.... It fails on build.

Example:

Cloning "https://github.com/miq-consumption/manageiq-galaxy.git" ...
	Commit:	65c9bd99c50e236c5f875b221df150fad0ce4791 (Merge pull request #10 from chargio/adding_tiddle)
	Author:	Sergio Ocón <sergio.ocon@redhat.com>
	Date:	Thu Nov 30 12:43:50 2017 +0100
---> Installing application source ...
---> Building your Ruby application from source ...
---> Running 'bundle install --deployment --without development:test' ...
Warning: the running version of Bundler (1.13.7) is older than the version that created the lockfile (1.15.4). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
Fetching gem metadata from https://rubygems.org/.........
Fetching version metadata from https://rubygems.org/..
Fetching dependency metadata from https://rubygems.org/.
Installing rake 12.3.0
Installing concurrent-ruby 1.0.5
Installing minitest 5.10.3
Installing thread_safe 0.3.6
Installing builder 3.2.3
Installing erubi 1.7.0
Installing mini_portile2 2.3.0
Installing crass 1.0.3
Installing rack 2.0.3
Installing nio4r 2.1.0 with native extensions
Installing websocket-extensions 0.1.3
Installing mini_mime 1.0.0
Installing arel 8.0.0
Installing public_suffix 3.0.1
Installing bcrypt 3.1.11 with native extensions
Installing orm_adapter 0.5.0
Installing method_source 0.9.0
Installing thor 0.19.4
Installing multipart-post 2.0.0
Installing github-markup 1.6.2
Installing pg 0.21.0 with native extensions
Installing puma 3.11.0 with native extensions
Installing rack-cors 1.0.2
Using bundler 1.13.7
Installing i18n 0.9.1
Installing tzinfo 1.2.4
Installing nokogiri 1.8.1 with native extensions
Installing rack-test 0.8.2
Installing warden 1.2.7
Installing sprockets 3.7.1
Installing websocket-driver 0.6.5 with native extensions
Installing mail 2.7.0
Installing addressable 2.5.2
Installing faraday 0.13.1
Installing ruby-enum 0.7.1
Installing activesupport 5.1.4
Installing loofah 2.1.1
Installing json-schema 2.8.0
Installing sawyer 0.8.1
Installing commonmarker 0.17.6 with native extensions
Installing rails-dom-testing 2.0.3
Installing globalid 0.4.1
Installing activemodel 5.1.4
Installing rails-html-sanitizer 1.0.3
Installing octokit 4.7.0
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
/opt/app-root/src/bundle/ruby/2.4.0/gems/commonmarker-0.17.6/ext/commonmarker
/opt/rh/rh-ruby24/root/usr/bin/ruby -r ./siteconf20171130-16-n7x04s.rb
extconf.rb
checking for cmake... no
[ERROR]: cmake is required and not installed. Get it here: http://www.cmake.org/
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib64
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/opt/rh/rh-ruby24/root/usr/bin/$(RUBY_BASE_NAME)
To see why this extension failed to compile, please check the mkmf.log which can
be found here:
/opt/app-root/src/bundle/ruby/2.4.0/extensions/x86_64-linux/2.4.0/commonmarker-0.17.6/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in
/opt/app-root/src/bundle/ruby/2.4.0/gems/commonmarker-0.17.6 for inspection.
Results logged to
/opt/app-root/src/bundle/ruby/2.4.0/extensions/x86_64-linux/2.4.0/commonmarker-0.17.6/gem_make.out
An error occurred while installing commonmarker (0.17.6), and Bundler cannot
continue.
Make sure that `gem install commonmarker -v '0.17.6'` succeeds before bundling.

hhorak added a commit to hhorak/s2i-ruby-container that referenced this issue Aug 13, 2020
Do not publish a container's port(s) to the host in tests
@pvalena
Copy link
Member

pvalena commented Jun 9, 2022

I can confirm this is still the case. @hhorak do we want to add cmake?

$ podman run --rm -ti "registry.access.redhat.com/ubi8/ruby-${x}" /usr/bin/bash
bash-4.4$ cmake
bash: cmake: command not found
bash-4.4$ dnf install cmake
Not root, Subscription Management repositories not updated

This system is not registered with an entitlement server. You can use subscription-manager to register.

Error: This command has to be run with superuser privileges (under the root user on most systems).

@pkubatrh
Copy link
Member

pkubatrh commented Jun 10, 2022

cmake is available in UBI repositories so you can build your own layer on top of RH provided images if you need it for your application.
So I guess the question becomes - do we want to add it to the ruby images by default? Is it a necessary dependency for enough Ruby applications to justify the size increase?

@phracek
Copy link
Member

phracek commented Aug 23, 2023

@chargio Can you please have a look on the last comments? Does it make sense to you? Can you please answer on them?
What about to create a pull request? Thanks.

@chargio
Copy link
Author

chargio commented Aug 23, 2023

I haven't used it recently so I am afraid I can't help

@chargio
Copy link
Author

chargio commented Aug 23, 2023

But some libraries require compilation so yes, an usable ruby env needs cmake

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

4 participants