I am a novice programmer trying to use a Jekyll theme for my Github blog. This is my first time using it... and I'm having problems with bundle exec jekyll serve command.
(FYI, I'm using Windows OS.)
Here's the output:
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/kramdown-1.17.0/lib/kramdown/parser/html.rb:10:in `require': cannot load such file -- rexml/parsers/baseparser (LoadError)
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/kramdown-1.17.0/lib/kramdown/parser/html.rb:10:in `<top (required)>'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown/html.rb:10:in `require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown/html.rb:10:in `<top (required)>'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown/paragraph.rb:14:in `require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown/paragraph.rb:14:in `<top (required)>'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown.rb:345:in `require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown.rb:345:in `<class:Kramdown>'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown.rb:60:in `<module:Parser>'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown.rb:19:in `<module:Kramdown>'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown.rb:17:in `<top (required)>'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-3.8.6/lib/jekyll/converters/smartypants.rb:3:in `require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-3.8.6/lib/jekyll/converters/smartypants.rb:3:in `<top (required)>'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-3.8.6/lib/jekyll.rb:13:in `require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-3.8.6/lib/jekyll.rb:13:in `block in require_all'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-3.8.6/lib/jekyll.rb:12:in `each'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-3.8.6/lib/jekyll.rb:12:in `require_all'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-3.8.6/lib/jekyll.rb:194:in `<top (required)>'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-3.8.6/exe/jekyll:8:in `require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-3.8.6/exe/jekyll:8:in `<top (required)>'
from C:/Ruby30-x64/bin/jekyll:25:in `load'
from C:/Ruby30-x64/bin/jekyll:25:in `<main>'
I tried these 4 different solutions:
1.
bundle add webrick
But had the same error
(referenced bundle exec jekyll serve: cannot load such file)
gem install jekyll github-pages
gem install jekyll
gem install jekyll-feed
bundle update
But had the same error
3.
gem install webrick
gem install jekyll -mentions
Then added
group :jekyll_plugins do
gem "jekyll-mentions", "1.6.0"
gem "webrick"
end
to my gemfile, then
bundle install
But had the same error
(referenced https://github.com/jekyll/jekyll/issues/8523)
bundle add sdbm
bundle add webrick
bundle add net-telnet
bundle add xmlrpc
But had the same error.
Is there any way I can fix this situation?
From what I understand, Ruby moves all stdlib parts into gems, some are "default gems", as in, they are normally installed with Ruby and don't need a reference in your Gemfile, but some are "bundled gems" which also are installed with Ruby, but need a reference in Gemfile. The problem stems from a fact, that with every Ruby release, some "default gems" become "bundled gems".
Such a situation happened with webrick in the past.
In your case it's most likely that you need rexml, which just became a "bundled gem" in Ruby 3.0: https://stdgems.org/rexml/
All this about a theory, but a solution is pretty simple. You just need to do
bundle add rexml
and then bundle install.
Related
Ruby 2.1.3p242 <2014-09-19 revision 47630> [x64-mingw32]
Rails 4.2.0.beta2
I'm running windows 8 on a 64 bit system. I have been using c9 (cloud hosted ubuntu) but want to start using RubyMine IDE on my pc to make everything faster but it's posing some problems.
I've tried pretty much every recommended way including this one:
How do I install sqlite3 for Ruby on Windows?
but I'm still getting the same error message. You help is much appreciated! Please let me know if you have any questions for me.
Full Error message when I run $rails s:
C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0.beta2/lib/active_support/dependencies.rb:248:in `require': cannot load such file -- sqlite3/sqlite3_native (LoadError)
from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0.beta2/lib/active_support/dependencies.rb:248:in `block in require'
from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0.beta2/lib/active_support/dependencies.rb:233:in `load_dependency'
from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0.beta2/lib/active_support/dependencies.rb:248:in `require'
from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sqlite3-1.3.9-x64-mingw32/lib/sqlite3.rb:6:in `rescue in <top (required)>'
from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sqlite3-1.3.9-x64-mingw32/lib/sqlite3.rb:2:in `<top (required)>'
from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.7.4/lib/bundler/runtime.rb:76:in `require'
from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.7.4/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.7.4/lib/bundler/runtime.rb:72:in `each'
from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.7.4/lib/bundler/runtime.rb:72:in `block in require'
from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.7.4/lib/bundler/runtime.rb:61:in `each'
from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.7.4/lib/bundler/runtime.rb:61:in `require'
from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/bundler-1.7.4/lib/bundler.rb:133:in `require'
from C:/Sites/aynulhabib-habib-framework-aca42deddccd/config/application.rb:7:in `<top (required)>'
from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.2.0.beta2/lib/rails/commands/commands_tasks.rb:78:in `require'
from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.2.0.beta2/lib/rails/commands/commands_tasks.rb:78:in `block in server'
from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.2.0.beta2/lib/rails/commands/commands_tasks.rb:75:in `tap'
from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.2.0.beta2/lib/rails/commands/commands_tasks.rb:75:in `server'
from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.2.0.beta2/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.2.0.beta2/lib/rails/commands.rb:17:in `<top (required)>'
from C:/Sites/aynulhabib-habib-framework-aca42deddccd/bin/rails:8:in `require'
from C:/Sites/aynulhabib-habib-framework-aca42deddccd/bin/rails:8:in `<top (required)>'
from -e:1:in `load'
from -e:1:in `<main>'
Process finished with exit code 1
fortunately, you don't have to switch to ruby 2.0
there is a solution to this issue, after endless trying...
https://github.com/hwding/sqlite3-ruby-win
Steps
Pre
gem uninstall sqlite3 --all
Source
Download the latest sqlite3-ruby, https://github.com/sparklemotion/sqlite3-ruby
unzip the package
Build
run command-line in the extracted dir
make sure you have your C compiler installed and added to PATH
gem install bundler
bundle install
rake native gem
you'll find a dir named 'pkg' generated
Install
enter dir 'pkg'
gem install --local sqlite3-xxx.gem ('xxx' is version code)
Check
irb
require 'sqlite3'
The issue is that binary sqlite3 gem do not include pre-compiled versions for Ruby 2.1.3
This is mentioned in the sqlite3-ruby mailing list here.
In the folder of your project open terminal and execute:
bundle update sqlite3
bundle update nokogiri
I hope i have helped you ;)
EDIT:
i always recommend using linux/mac for ruby, because some gems may get problematic, because of compiling errors with c
always use bundle to manage your gems, it is much easier*,
you can install it by:
gem install bundler
bundle install - will install all the gems in your Gemfile
the last bundler version is not compatible withe ruby bellow 2.3, so use gem install bundler -v 1.16.4
If you have extracted "exe"s and "dll"s from Sqlite download link to Ruby's bin folder and still have this problem. Try this:
bundle update
gem uninstall sqlite3
Given a choice between multiple versions of sqlite3, choose last option 'All versions'. Enter last number here
Select gem to uninstall:
1. sqlite3-1.3.13
2. sqlite3-1.3.13-x64-mingw32
3. All versions
>3
.
.
If you remove this gem, these dependencies will not be met.
Continue with Uninstall? [yN]
>
y
gem install sqlite3 --platform=ruby
rails s
This should work.
Read through this link for more explanation if above works for you.
I deployed my rails application to openshift it works well but I cannot run 'rails console' on production server. It gives me this error. How can I solve this? I tried to update rubygems but it also gives permission denied error and I couldn't make it too.
rails c error:
Warning: You're using Rubygems 1.8.24 with Spring. Upgrade to at least Rubygems 2.1.0 and run `gem pristine --all` for better startup performance.
/opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in `require': cannot load such file -- bundler/setup (LoadError)
from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
from /var/lib/openshift/5429e72a500446dfee000197/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/spring-1.1.3/lib/spring/commands.rb:33:in `<module:Spring>'
from /var/lib/openshift/5429e72a500446dfee000197/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/spring-1.1.3/lib/spring/commands.rb:4:in `<top (required)>'
from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
from /var/lib/openshift/5429e72a500446dfee000197/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/spring-1.1.3/lib/spring/application.rb:77:in `preload'
from /var/lib/openshift/5429e72a500446dfee000197/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/spring-1.1.3/lib/spring/application.rb:140:in `serve'
from /var/lib/openshift/5429e72a500446dfee000197/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/spring-1.1.3/lib/spring/application.rb:128:in `block in run'
from /var/lib/openshift/5429e72a500446dfee000197/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/spring-1.1.3/lib/spring/application.rb:122:in `loop'
from /var/lib/openshift/5429e72a500446dfee000197/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/spring-1.1.3/lib/spring/application.rb:122:in `run'
from /var/lib/openshift/5429e72a500446dfee000197/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/spring-1.1.3/lib/spring/application/boot.rb:18:in `<top (required)>'
from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
from -e:1:in `<main>'
rubygems-update error:
[appname.rhcloud.com repo]\> update_rubygems
ERROR: While executing gem ... (Errno::EACCES)
Permission denied - /opt/rh/ruby193/root/usr/local/share/ruby
I ran into the same issue, try running it like this:
RAILS_ENV=production bundle exec rails console
Also make sure you are running it in ~/app-root/repo when you run it
To update rubygems:
gem update --system
If that doesn't solve the problem try Spring's suggestion and run:
gem pristine --all
The problem is that there are multiple bundle executables and the system is using the wrong one.
Locate the correct bundle executable. In my case it was located at ~/.gem/bin/bundle.
If you can't find it, install it gem install bundler.
Then run ~/.gem/bin/bundle exec rails console production inside ~/app-root/repo
I couldn't get any of the gem install or bundle exec solutions to work while running the 4.1.4 Rails cartridge on OpenShift. My solution was running RAILS_ENV=production bin/rails c in app-root/repo.
I'm trying to run the script from "HOW TO RUN YOUR OWN BITCOIN ARBITRAGE BOT".
You can try following it yourself and test the results.
I followed it exactly and yet, when I open the program, I get this and I have no idea how to fix it.
c:\Ruby200-x64\devkit>rbtc_simple
C:/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require
': cannot load such file -- bundler (LoadError)
from C:/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:5
5:in `require'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rbtc_arbitrage_simple-2.1.1
/lib/rbtc_arbitrage.rb:1:in `<top (required)>'
from C:/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:5
5:in `require'
from C:/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:5
5:in `require'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rbtc_arbitrage_simple-2.1.1
/bin/rbtc_simple:4:in `<top (required)>'
from C:/Ruby200-x64/bin/rbtc_simple:23:in `load'
from C:/Ruby200-x64/bin/rbtc_simple:23:in `<main>'
I'm running 64bit Ruby and 64bit devkit.
I ran git init in C:\Ruby200\bin, which I think is the right folder. How can I know where to run it?
You are missing the bundler gem as seen in your error message:
require: cannot load such file -- bundler
to fix this you can install bundler to your gems: gem install bundler
Attempting to switch from WEBrick to Unicorn, I've got the Unicorn gem v 4.8.1 installed on my machine [via "gem install unicorn"] and it's also located in my Gemfile ["gem "unicorn", "~> 4.8.1"], for which I've successfully run bundle install.
However, when starting the server locally via "rails s" (worked fine pre-Unicorn), I get the following error:
...../vendor/cache/ruby/1.9.1/gems/unicorn-4.8.1/lib/unicorn/const.rb:44:in `require': cannot load such file -- unicorn/version (LoadError)
from /Users/johndoe/Sites/my_app/vendor/cache/ruby/1.9.1/gems/unicorn-4.8.1/lib/unicorn/const.rb:44:in `<top (required)>'
from /Users/johndoe/Sites/my_app/vendor/cache/ruby/1.9.1/gems/unicorn-4.8.1/lib/unicorn.rb:108:in `require'
from /Users/johndoe/Sites/my_app/vendor/cache/ruby/1.9.1/gems/unicorn-4.8.1/lib/unicorn.rb:108:in `<top (required)>'
from /Users/johndoe/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
from /Users/johndoe/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
from /Users/johndoe/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
from /Users/johndoe/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
from /Users/johndoe/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
from /Users/johndoe/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
from /Users/johndoe/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
from /Users/johndoe/Sites/my_app/config/application.rb:7:in `<top (required)>'
from /Users/johndoe/Sites/my_app/vendor/cache/ruby/1.9.1/gems/railties-3.2.13/lib/rails/commands.rb:53:in `require'
from /Users/johndoe/Sites/my_app/vendor/cache/ruby/1.9.1/gems/railties-3.2.13/lib/rails/commands.rb:53:in `block in <top (required)>'
from /Users/johndoe/Sites/my_app/vendor/cache/ruby/1.9.1/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
from /Users/johndoe/Sites/my_app/vendor/cache/ruby/1.9.1/gems/railties-3.2.13/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I'm thinking this may be due to using RVM? When I type 'which gem "unicorn"' I get:
/Users/johndoe/.rvm/rubies/ruby-1.9.3-p392/bin/gem
/Users/johndoe/.rvm/gems/ruby-1.9.3-p392/bin/unicorn
Also for reference, my $PATH: /Users/johndoe/.rvm/rubies/ruby-1.9.3-p392/bin/gem:/usr/local/rvm/bin:/Users/johndoe/.rvm/gems/ruby-1.9.3-p392/bin:/Users/johndoe/.rvm/gems/ruby-1.9.3-p392#global/bin:/Users/johndoe/.rvm/rubies/ruby-1.9.3-p392/bin:/Users/johndoe/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/git/bin
"bundle show unicorn" gives: /Users/johndoe/Sites/my_app/vendor/cache/ruby/1.9.1/gems/unicorn-4.8.1
The application successfully deploys to Heroku, so I believe this issue is isolated to my machine (rather than being an issue with the application). Any ideas on how to solve this?
I seemed to fix the problem by uninstalling the gem via "sudo bundle exec gem uninstall unicorn", then reinstalling it via standard "sudo bundle install"
Still not sure exactly why the issue occurred, but that fix did seem to work.
Can you used this..
$ rails server unicorn
or
bundle exec unicorn -p 3000
Still not sure what caused this problem.
I solved this simply by reinstalling the unicorn gem.
gem uninstall unicorn
bundle install
bundle update
I have tried various installation methods for deploying a WEBrick and mongrel from the terminal. When I enter the rails server command I get the following:
Toran1$ rails server
/Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/mysql2-0.3.2/lib/mysql2.rb:8:in `require': dlopen(/Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/mysql2-0.3.2/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib (LoadError)
Referenced from: /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/mysql2-0.3.2/lib/mysql2/mysql2.bundle
Reason: image not found - /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/mysql2-0.3.2/lib/mysql2/mysql2.bundle
from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/mysql2-0.3.2/lib/mysql2.rb:8:in `<top (required)>'
from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.13/lib/bundler/runtime.rb:68:in `require'
from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.13/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.13/lib/bundler/runtime.rb:66:in `each'
from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.13/lib/bundler/runtime.rb:66:in `block in require'
from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.13/lib/bundler/runtime.rb:55:in `each'
from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.13/lib/bundler/runtime.rb:55:in `require'
from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.13/lib/bundler.rb:120:in `require'
from /Users/Toran1/Sites/simple_cms/config/application.rb:7:in `<top (required)>'
from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/railties-3.0.7/lib/rails/commands.rb:28:in `require'
from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/railties-3.0.7/lib/rails/commands.rb:28:in `block in <top (required)>'
from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/railties-3.0.7/lib/rails/commands.rb:27:in `tap'
from /Users/Toran1/.rvm/gems/ruby-1.9.2-head/gems/railties-3.0.7/lib/rails/commands.rb:27:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I have installed the gem both locally and at the root level, and I also have navigated to the application folder before issuing the command. Any help would be appreciated!
Webrick will install automatically if you install rails in a correct manner.
Try this link
Here
And if you don't want to install rails again, try to install server using gem command
Dont forget to include the gems in Gemfile and to run "bundle install"
If you are using Rails < 3.1 you need to use version ~> 0.2.7 of the mysql2 gem
Checkout the documentation and search for active record: https://github.com/brianmario/mysql2
I'm not sure if that will help solve this problem directly, but it may solve others that you may encounter.
Just update your bundler, maybe of any-one of the older gem is conflicting with latest one, this type of issues arises.
gem install bundler
and then bundler install
If you find again error, then delete GEM.lock file, then run
bundler install
This may resolve the issue.