Installing Jekyll theme for a website on a shared hosting plan - ruby

On my shared hosting plan I am trying to get a personal website to work, simple 2-page site based on a theme that I bought on jekyllthemes. As I'm obviously new at this I followed blogposts on this topic but I always get stuck, so I'd like someone more experienced that could possibly tell me what am I doing wrong. I'm using the cheapest shared hosting plan on hawkhost (if that's important to mention).
Here are the segmented steps I took trying to install this, hope it's easy to follow and figure out what I did and where was I wrong;
a) cPanel -> Setup Ruby App
Ruby version 3.1
App Directory: jekyll_site
App Domain: testweb
b) Testing www.mysite.com/testweb
blank page with "It works! Ruby 3.1.2" message
c) cPanel Terminal
source /home/user/rubyvenv/jekyll__site/3.1/bin/activate (with single underscore I get "no such file or dir" warning, but works when double underscore)
terminal now points to: (jekyll_site:3.1)[user#dal206 ~]$
gem install bundler jekyll
Done installing documentation for webrick, unicode-display_width, terminal-table, safe_yaml, rouge, forwardable-extended, pathutil, mercenary, liquid, rexml, kramdown, kramdown-parser-gfm, ffi, rb-inotify, rb-fsevent, listen, jekyll-watch, sassc, jekyll-sass-converter, concurrent-ruby, i18n, http_parser.rb, eventmachine, em-websocket, colorator, public_suffix, addressable, jekyll after 22 seconds
29 gems installed
cd public_html
terminal now points to: (jekyll_site:3.1)[user#dal206 public_html]$
gem install bigdecimal
Done installing documentation for bigdecimal after 0 seconds 1 gem installed
jekyll new testweb
And after this, I get this error; /opt/alt/ruby31/share/rubygems/rubygems.rb:265:in find_spec_for_exe': can't find gem jekyll (>= 0.a) with executable jekyll (Gem::GemNotFoundException) from /opt/alt/ruby31/share/rubygems/rubygems.rb:284:in activate_bin_path'
from /home/user/bin/jekyll:25:in `

Related

Github pages installation: Jekyll -v output `require': cannot load such file -- google/protobuf_c (LoadError)

I'm trying to follow this guide on setting up a GitHub page website. I installed Homebrew, chruby, and Jekyll following this jekyllrb.com tutorial.
When I run ruby -v I get ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin18]. When I run chruby -V I get chruby: 0.3.9. After installing Jekyll with gem install jekyll I get Successfully installed jekyll-4.3.1 Parsing documentation for jekyll-4.3.1 Done installing documentation for Jekyll after 0 seconds 1 gem installed.
But when I run jekyll -v (or any Jekyll command) I get a very long message with the following error:
<internal:/Users/my_username/.rubies/ruby-3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require': dlopen(/Users/my_username/.gem/ruby/3.1.2/gems/google-protobuf-3.21.12-x86_64-darwin/lib/google/3.1/protobuf_c.bundle, 9): no suitable image found. Did find: (LoadError)
/Users/my_username/.gem/ruby/3.1.2/gems/google-protobuf-3.21.12-x86_64-darwin/lib/google/3.1/protobuf_c.bundle: cannot load 'protobuf_c.bundle' (load command 0x80000034 is unknown)
/Users/my_username/.gem/ruby/3.1.2/gems/google-protobuf-3.21.12-x86_64-darwin/lib/google/3.1/protobuf_c.bundle: cannot load 'protobuf_c.bundle' (load command 0x80000034 is unknown) - /Users/my_username/.gem/ruby/3.1.2/gems/google-protobuf-3.21.12-x86_64-darwin/lib/google/3.1/protobuf_c.bundle
I spent hours looking at what this error means and found very specific (to some version of Ruby or other libraries) questions like Ruby 2.7.2 google/protobuf_c problem (M1), Ruby: Gem version 3.11.2 doesn't load on Ruby 2.7, and many others.
It's the first time I even hear about Ruby or Jekyll or anything else here and I can't figure out how to properly install these to just make a website on GitHub. I also tried to install Ruby using rvm instead of chruby but that gave the same error. I also tried to install different versions of Ruby, like 3.1.3 and 3.2.0.
When gems have native extensions that need to be compiled it's possible for the gem author to build the extensions in advance and include them in the package so that the gem can install faster than if it were being compiled from scratch. Unfortunately Google has broken this implementation repeatedly.
This has been a problem for about two years with google-protobuf. Google has periodically fixed it and broken it again. They also periodically claim to understand the problem without understanding it and claim to have fixed it without fixing it. And their GitHub issues frequently pass the buck when they're the only ones that can fix it.
Anytime you're dealing with google-protobuf on macOS it's best to ensure that you are compiling it from scratch. This can be done with the --platform argument:
gem install --platform ruby google-protobuf
The platform ruby means don't use any pre-compiled binaries and force compilation from source.
The platform x86_64-darwin means use the pre-compiled binaries for macOS with Intel processors. That's the version that the gem installer identified for your system and used automatically but the error no suitable image found is a macOS error that means this library was not compiled in a way that I can understand.

Apache/Ruby/Passenger misconfigured after Ubuntu 12.04 to 14.04 update

Well, I have to admit, that I'm down today. I've updated my Ubuntu and that rendered Redmine 2.1.2 completely dead. Any suggestions as of to what should I update or reconfigure? I'm trying not to use Ruby/Rails/Passenger blindly but it's tough as it's not my expertise. I'd like to USE Redmine instead.
Top of the Passenger error log is below, but feel free to check whole page at http://redmine.teacloud.net:
It looks like Bundler could not find a gem. Maybe you didn't install all the gems that this application needs. To install your gems, please run:
bundle install
If that didn't work, then the problem is probably caused by your application being run under a different environment than it's supposed to. Please check the following:
Is this app supposed to be run as the nobody user?
Is this app being run on the correct Ruby interpreter? Below you will see which Ruby interpreter Phusion Passenger attempted to use.
-------- The exception is as follows: -------
Could not find rake-10.3.2 in any of the sources (Bundler::GemNotFound)
/var/lib/gems/1.8/gems/bundler-1.3.4/lib/bundler/spec_set.rb:92:in `block in materialize'
• I have no idea, what user should this app supposed to be run as. Everything else uses www-data by default, however the redmine application folder in filesystem is owner by root.
• Everything was working for two years on ruby 1.8 that is not on my system now. I've managed to install lowest version 1.8.7, latest 2.1.2... and I have no idea where does the 1.9.1 get from.
• I don't understand how 'bundle install' and 'bundle update' is related to current ruby version switched to using rvm.
• I am not sure, at what point will my Redmine MySQL database be migrated or destroyed if I'll need to upgrade Redmine (so I have backup).
• bundle install didn't help, Apache runs ruby 1.9.1
Solution was simply as follows (whole failure path is documented here http://www.redmine.orgenter code here/boards/2/topics/43500?r=43514):
• Everything happens in the Redmine's installation folder:
• Went to GitHub (https://github.com/redmine/redmine/blob/master/Gemfile) and copied fresh database section to Redmine's Gemfile (ignoring the fact that I have Redmine 2.1.2 and Gemfile is far newer)
$ rvm use system
$ bundle install

Rails server command generates error report

When I used rails server command, found following errors in terminal. It shows that "could not find a JavaScript runtime". I am newbie in ROR and don't know to configure different files. I Google and found solutions of this problem 1 2 3. Still I am not getting the things. Please suggest some solutions.
Ruby and Rail versions on my system
Ruby version:- ruby 1.8.7 , Rails version:- Rails 3.2.6
I suppose you lack executable on your system/
Haven't you try to run gem install execjs or bundle install(from your project directory) in console?
UPDATE
Also visit execjs homepage and try instaling any of JS runtimes supported.
UPDATE 2
I was able to reproduce your error (with ruby 1.9.2). Just add gem 'therubyracer' to your Gemfile and run bundle install. For some weird reason ROR is not working out of the box on Ubuntu. See this and search for runtime word for more info.
PS
Please put your Gemfile here. This might help.
The error message also tells your to
See https://github.com/sstephenson/execjs for a list of available runtimes.
You have to install one of the JavaScript runtimes listed there:
therubyracer
therubyrhino
Node.js
Microsoft Windows Script Host
For Rails 3.2.6 I suggest to use Ruby 1.9.3. for better performance.

How to revert back to the default Ruby install on Mac OSX Lion Server

I did an install of Redmine on my OSX Lion Server following the install guide on the Redmine website. There it told me to update/install some RubyGems. The install of Redmine went fine but the procedure killed my Profile Manager and Wiki Service.
Looking around on the web led me to the Apple Support web page http://support.apple.com/kb/TS4042
Basically it says not to update or install Ruby Gems because it will cause problems but it does not give a solution if you already did update or install any Ruby Gem.
Is there a way to revert back to the default Ruby install on OSX Lion Server (10.7.3) without a complete reinstall of the system?
I'm looking for a solution for this same exact issue as well.
I'll post anything additional that I find.
So, in addition wikid/collabd not working, I was also seeing gobs of error messages in /var/log/system.log from sandboxd regarding ruby:
Apr 17 11:34:07 reddwarf sandboxd[3890] ([3887]): ruby(3887) deny
file-read-metadata /private/var/folders/zz/zyxvpxvq6csfxvn_n00000vm00006x
I found a thread in Apple Communities (https://discussions.apple.com/thread/3216408?start=0&tstart=0) that showed a possible solution:
Can you uninstall the newer version of Rack, 1.2.2?
sudo gem uninstall rack
sudo gem install rack --version 1.2.1
This is a bug we're aware of.
I decided to do this since I had originally got mired in this mess after updating ruby.
First off, stop the wiki server...
sh-3.2# serveradmin stop wiki
wiki:state = "STOPPED"
I found I had multiple versions of rack installed (1.4.1 and 1.3.5), but 1.2.1 did not show as installed, which evidently is the version of this gem that wikid depends on.
sh-3.2# gem uninstall rack
Select gem to uninstall:
1. rack-1.3.5
2. rack-1.4.1
3. All versions
> 2
I uninstalled both of these, trying to start the wiki server after each was removed. The wiki was still not working up to this point. Then I installed 1.2.1...
sh-3.2# gem install rack --version 1.2.1
Successfully installed rack-1.2.1
1 gem installed
Installing ri documentation for rack-1.2.1...
Installing RDoc documentation for rack-1.2.1...
After that, another attempt at starting the wiki...
sh-3.2# serveradmin start wiki
wiki:state = "STARTING"
sh-3.2# serveradmin status wiki
wiki:state = "RUNNING"
And guess what? It actually worked! My wiki is now functional again.

Why does my Rails app not see installed gems?

Running Ubuntu 10, RVM, Passenger and apache2. Trying to configure and get Redmine running.
First, I set my default Ruby binary to /usr/local/rvm/rubies/ruby-1.9.2-p180/bin/ruby. That's the output of which ruby. Output of which gem is /usr/local/rvm/rubies/ruby-1.9.2-p180/bin/gem. I think that side of things is set up properly.
I know Passenger is running, because I'm getting an error screen, with this error:
Error message:
Missing the i18n 0.4.2 gem. Please gem install -v=0.4.2 i18n
Update The error that passenger is producing is coming from the boot.rb file. I went and made a gist of the application's boot.rb file.
When I do check to see if that gem is installed, here's the output.
# gem list
# ... list truncated ...
# i18n (0.4.2)
(full gist of installed gems here)
Really? Let's first make sure passenger.conf is going to the right Ruby installation...
passenger.conf
PassengerRuby /usr/local/rvm/rubies/ruby-1.9.2-p180/bin/ruby
>:| So now, I go onto SSH into the application directory, and what have you, script/server starts normally. I'm a little more than confused. Clearly the Ruby installation that Passenger is configured to has the Gem it says is missing, installed, and additionally, the application doesn't falter on a start up. Which makes me think it's a Passenger problem.
Using RVM with Passenger is a bit complicated, maybe this link about using Ruby and Passenger will help.

Resources