I have a blog of mine in jekyll and I want to publish it on github-pages.
Taking reference from here:
https://help.github.com/articles/using-jekyll-with-pages.
but I am getting this error while running bundle install
Gem::InstallError: public_suffix requires Ruby version >= 2.0.
An error occurred while installing public_suffix (1.5.1), and Bundler cannot continue.
Make sure that `gem install public_suffix -v '1.5.1'` succeeds before bundling.
below is the details of my gem env
gem env :
RubyGems Environment:
- RUBYGEMS VERSION: 2.2.3
- RUBY VERSION: 2.1.6 (2015-04-13 patchlevel 336) [x86_64-linux-gnu]
- INSTALLATION DIRECTORY: /var/lib/gems/2.1.0
- RUBY EXECUTABLE: /usr/bin/ruby2.1
- EXECUTABLE DIRECTORY: /usr/local/bin
- SPEC CACHE DIRECTORY: /home/ashwin/.gem/specs
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /var/lib/gems/2.1.0
- /home/ashwin/.gem/ruby/2.1.0
- /usr/share/rubygems-integration/2.1.0
- /usr/share/rubygems-integration/2.1
- /usr/share/rubygems-integration/all
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /usr/local/heroku/bin
- /usr/local/sbin
- /usr/local/bin
- /usr/sbin
- /usr/bin
- /sbin
- /bin
- /usr/games
- /usr/local/games
Just like you my ruby version was correct, but the fix for me was reinstalling bundler.
sudo gem install bundler
Try installing without sudo.
I've had the same issue after upgrading Ruby to 2.2.3 with rbenv (which is installed without admin rights).
After having upgraded, I ran sudo gem install github-pages, which resulted in the above error. Running gem install github-pages worked just fine.
Then, trying to have Jekyll serve my page, I ran bundle exec jekyll serve, which told that there were some bundles missing. bundle install fixed that too, and bundle exec jekyll serve worked fine.
Make sure that gem install public_suffix -v '1.5.1' succeeds before bundling.
I had the same issue and this command solves it.
sudo gem install github-pages -v 33
Then run jekyll.
bundle exec jekyll serve
See here
In the past i've also had issues with installing github pages or Jekyll dependencies because there is a space somewhere in the full path to your project folder and apparrently some of the dependencies cant handle spaces in filenames.
Most recently this seems to have been happening to me with public_suffix version 4.0.5 where a space in my username causes it to break
This has also happened with http_parser
Related
I am trying to update bundler in a project. i updated rbenv ruby 2.6.6. Then i ran bundle install and nothing happened. I followed the instructions in the error msg. Programme runs and then times out.
git:(master) ruby -v
ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-darwin18]
git:(master) bundler -v
Traceback (most recent call last):
2: from /Users/maryhealy/.rbenv/versions/2.6.6/bin/bundler:23:in `<main>'
1: from /Users/maryhealy/.rbenv/versions/2.6.6/lib/ruby/2.6.0/rubygems.rb:302:in `activate_bin_path'
/Users/maryhealy/.rbenv/versions/2.6.6/lib/ruby/2.6.0/rubygems.rb:283:in `find_spec_for_exe': Could not find 'bundler' (2.1.4) required by your /Users/maryhealy/code_old/yance/Gemfile.lock. (Gem::GemNotFoundException)
To update to the latest version installed on your system, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:2.1.4`
git:(master) gem install bundler
^CERROR: Interrupted
git:(master) gem install bundler:2.1.4
^CERROR: Interrupted
I tried running this in project directory
gem install bundler -v '~> 2.1'
ERROR: Loading command: install (LoadError)
dlopen(/Users/maryhealy/.rbenv/versions/2.4.4/lib/ruby/2.4.0/x86_64-darwin17/openssl.bundle, 9): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
Referenced from: /Users/maryhealy/.rbenv/versions/2.4.4/lib/ruby/2.4.0/x86_64-darwin17/openssl.bundle
Reason: image not found - /Users/maryhealy/.rbenv/versions/2.4.4/lib/ruby/2.4.0/x86_64-darwin17/openssl.bundle
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass
I have old versions of ruby as per my gem env
➜ ~ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 2.6.14.1
- RUBY VERSION: 2.4.4 (2018-03-28 patchlevel 296) [x86_64-darwin17]
- INSTALLATION DIRECTORY: /Users/maryhealy/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0
- USER INSTALLATION DIRECTORY: /Users/maryhealy/.gem/ruby/2.4.0
- RUBY EXECUTABLE: /Users/maryhealy/.rbenv/versions/2.4.4/bin/ruby
- EXECUTABLE DIRECTORY: /Users/maryhealy/.rbenv/versions/2.4.4/bin
- SPEC CACHE DIRECTORY: /Users/maryhealy/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /Users/maryhealy/.rbenv/versions/2.4.4/etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-17
- GEM PATHS:
- /Users/maryhealy/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0
- /Users/maryhealy/.gem/ruby/2.4.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /Users/maryhealy/.rbenv/versions/2.4.4/bin
- /usr/local/Cellar/rbenv/1.1.2/libexec
- ./bin
- ./node_modules/.bin
- /Users/maryhealy/.rbenv/shims
- /Users/maryhealy/.rbenv/bin
- /usr/local/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
- /Users/maryhealy/.composer/vendor/bin
- /usr/local/sbin
i have no idea how to fix the problem to update bundler. Any help appreciated?
Installing bundler
You need to install Bundler globally, not only for the current project (in the project directory). This is because Bundler provides a consistent environment for Ruby projects by tracking and installing the exact gems and versions that are needed.
Open a terminal and write
gem install bundler
You can check if the installation is successful by writing
bundle -v
I'm having what appears to be the exact same problem seen in a 1-month old question that no one has touched. I installed rbenv using homebrew, installed ruby 2.3.1 using rbenv install 2.3.1, installed jekyll and bundler using gem install jekyll and gem install bundler, then within a jekyll project, I typed bundle install. I got the error Rubygems 2.0.14.1 is not threadsafe, so your gems will be installed one at a time. Upgrade to Rubygems 2.1.0 or higher to enable parallel gem installation. When I run gem env, I see this:
RubyGems Environment:
- RUBYGEMS VERSION: 2.6.6
- RUBY VERSION: 2.3.1 (2016-04-26 patchlevel 112) [x86_64-darwin15]
- INSTALLATION DIRECTORY: /Users/lindsb/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0
- USER INSTALLATION DIRECTORY: /Users/lindsb/.gem/ruby/2.3.0
- RUBY EXECUTABLE: /Users/lindsb/.rbenv/versions/2.3.1/bin/ruby
- EXECUTABLE DIRECTORY: /Users/lindsb/.rbenv/versions/2.3.1/bin
- SPEC CACHE DIRECTORY: /Users/lindsb/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /Users/lindsb/.rbenv/versions/2.3.1/etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-15
- GEM PATHS:
- /Users/lindsb/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0
- /Users/lindsb/.gem/ruby/2.3.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /Users/lindsb/.rbenv/versions/2.3.1/bin
- /usr/local/Cellar/rbenv/1.0.0/libexec
- /Users/lindsb/.local/bin
- /usr/local/sbin
- /usr/local/bin
- /Users/lindsb/.rbenv/shims
- /Users/lindsb/.local/bin
- /usr/local/sbin
- /usr/local/bin
- /usr/local/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
- /opt/X11/bin
- /Library/TeX/texbin
I don't understand why bundler complains about Rubygems being below 2.1.0 when my Rubygems version is 2.6.6.
There is a Gemfile and a Gemfile.lock in the project directory. Gemfile looks like this:
source 'https://rubygems.org'
# jekyll
gem "jekyll", "3.1.1"
gem "redcarpet"
# compiling less
gem 'therubyracer'
gem 'less'
# minifying
gem 'jekyll-press'
# octokit
gem 'octokit'
gem 'netrc'
Hi I am learing Rails and encountered the same issue and I don't know what the root cause it is. But when I try reinstall bundler again
gem install bundler
and then run
bundle install
everything goes fine now.
I don't know exactly what the issue was, but when I removed Gemfile.lock and reran bundle install everything worked fine. There were probably just some bad constraints or something in Gemfile.lock.
I downloaded Ruby 2.0.0 and have gem version 2.0.14. I need at least gem version 2.0.3 to meet the requirements to run my script. However, when I try to update:
gem update --system
I get a message that says "Latest version currently installed, Aborting." What do I need to do to get this to update properly? As a result of this, I can't install the gems that I need. For example:
gem install watir
returns
ERROR: could not find a valid gem 'watir' ()= 0), here is why: Unable to download data from https://rubygems.org/ - no such name (https://rubygems.org/latest_specs.4.8.gz).
Could this be a proxy issue, or is it something entirely different?
EDIT gem env:
RubyGems Environment:
- RUBYGEMS VERSION: 2.0.14
- RUBY VERSION: 2.0.0 (2014-05-08 patchlevel 481) [i386-mingw32]
- INSTALLATION DIRECTORY: C:/Users/shwheelz/Documents/Ruby200/lib/ruby/gems/2.
0.0
- RUBY EXECUTABLE: C:/Users/shwheelz/Documents/Ruby200/bin/ruby.exe
- EXECUTABLE DIRECTORY: C:/Users/shwheelz/Documents/Ruby200/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-mingw32
- GEM PATHS:
- C:/Users/shwheelz/Documents/Ruby200/lib/ruby/gems/2.0.0
- C:/Users/shwheelz/.gem/ruby/2.0.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
Try to run
gem install rubygems-update
update_rubygems
I have encountered the same problem. Because I was gem source deleted.
Type
gem sources -l
See if there is one gem source, if not, run following
gem sources --add https://rubygems.org/
To remove a source
gem sources --remove https://rubygems.org/
then try again.
I am getting an error while running bundle install in my rails project.
sahil#debian:~/workspace/blog$ bundle install
/usr/bin/env: ruby: No such file or directory
Ruby
sahil#debian:~/workspace/blog$ ruby -v
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86__64-linux]
sahil#debian:~/workspace/blog$ which ruby
/home/sahil/.rvm/bin/ruby
Received the below error while installing ruby through rvm.
Error running 'env GEM_PATH=/home/sahil/.rvm/gems/ruby-2.0.0-p0:/home/sahil/.rvm/gems/ruby-2.0.0-p0#global:/home/sahil/.rvm/gems/ruby-2.0.0-p0:/home/sahil/.rvm/gems/ruby-2.0.0-p0#global GEM_HOME=/home/sahil/.rvm/gems/ruby-2.0.0-p0 /home/sahil/.rvm/rubies/ruby-2.0.0-p0/bin/ruby -d /home/sahil/.rvm/src/rubygems-2.0.3/setup.rb --verbose',
please read /home/sahil/.rvm/log/ruby-2.0.0-p0/rubygems.install.log
rvm env
sahil#debian:~$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 2.0.3
- RUBY VERSION: 2.0.0 (2013-02-24 patchlevel 0) [x86_64-linux]
- INSTALLATION DIRECTORY: /home/sahil/.rvm/gems/ruby-2.0.0-p0
- RUBY EXECUTABLE: /home/sahil/.rvm/rubies/ruby-2.0.0-p0/bin/ruby
- EXECUTABLE DIRECTORY: /home/sahil/.rvm/gems/ruby-2.0.0-p0/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /home/sahil/.rvm/gems/ruby-2.0.0-p0
- /home/sahil/.rvm/gems/ruby-2.0.0-p0#global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => t
rvm env looks ok. Not sure what have I missed.
please follow this basics steps for using RVM (copied from https://stackoverflow.com/a/15570121/497756):
rvm install 2.0.0
rvm use 2.0.0 --default # The default arg is needed only first time
gem install bundler
bundle install
also another answer showing more details: https://stackoverflow.com/a/10591301/497756
I'm trying to install gems on my ruby installation... I've installed a few, like heroku, yet when i list my local gems, the only one i see is Rake, and of course heroku cannot be used...
Any idea how i can solve this? What could the issue be? Installation for Heroku gem sewems to go smooth using sudo gem install heroku...
here is my gem environment:
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.6
- RUBY VERSION: 1.9.2 (2011-07-09 patchlevel 290) [i686-linux]
- INSTALLATION DIRECTORY: /home/alex/.rvm/gems/ruby-1.9.2-p290
- RUBY EXECUTABLE: /home/alex/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
- EXECUTABLE DIRECTORY: /home/alex/.rvm/gems/ruby-1.9.2-p290/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-linux
- GEM PATHS:
- /home/alex/.rvm/gems/ruby-1.9.2-p290
- /home/alex/.rvm/gems/ruby-1.9.2-p290#global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
Thx!
I see that you use rvm to maintain your gems. Please do not use sudo to install the gems in that case.
RVM doesn't recognize gems installed with sudo and seems to be buggy even when you aren't using the sudo installed gems.
The ultimate solution that worked for me to uninstall all the gems locally and with sudo. Here is what to do:
$sudo gem list and $gem list to grab the gems you want. Save those as a .gems file using a text editor. The .gems file is just a listing of the gems, one per line, with the version number after (e.g. nokogiri -v1.4.3.1)
uninstall all of the gems. You can do this in bulk by just listing the gems with a space separated between them. $sudo gem uninstall gem1 gem2 gem3
use the directions at https://rvm.beginrescueend.com/gemsets/importing/ to import the newly made .gems list.