"This webpage is unavailable" when running Jekyll locally on Cloud9 - ruby-on-rails

I'm trying to setup Jekyll on Cloud9 IDE and then run locally but i keep getting a page that says "This webpage is not available".
Following instructions on 'https://rubygems.org/gems/jekyll/versions/3.0.1' and https://jekyllrb.com/, here's what i've done.
Added gem in gemfile (gem 'jekyll', '~> 3.0', '>= 3.0.1').
bundle install
Everthing looks like it installs fine.
gem install jekyll
'Successfully installed jekyll-3.0.1'.
jekyll new blog
'New jekyll site installed in /home/ubuntu/workspace/blog.'.
cd blog
jekyl serve
The page that loads is 'This webpage is not available.'
jekyll serve -p $PORT -b $IP
Same result.
jekyll s -p $PORT -b $IP
Same result.
Normally when i want to run locally i just do "rails s -p $PORT -b $IP".
Not really sure how to get this to work. I'm still kindof new to ruby on rails so apologies if i'm missing something simple here.
Thankyou!

Solved.
Thanks #Matahhir for providing this link in the comments above.
https://docs.c9.io/docs/jekyll
I needed to run,
jekyll serve --host $IP --port $PORT --baseurl ""

Here is a how-to for installing Jekyll on Cloud9:
create a free account on Cloud9 (https://c9.io)
create an empty project (Ubuntu) and follow these steps:
type on the command line: gem install jekyll
create an empty _config.yml file in the root
create a index.md file in the root
type on the command line: jekyll serve --host $IP --port $PORT --baseurl ''
your website is now running 'locally' on Cloud9
The content of your index.md file:
---
title: Home
---
Hello world!

Related

How can I run a ruby script right after the server starts in Rails 5

I have two ruby scripts that need to be running while the server is.
Currently I am running them separately using detached screens, but I would like to launch them at the same time the rails server is starting.
How can I integrate them so that I can achieve this behavior?
Have you tried Foreman gem? It will allow you to create a simple file (Procfile) where you can specify all the process that should be started simultaneously.
I usually create a file named Procfile.dev in the project's root, that would look like for example:
web: bundle exec rails server thin start -p 4000
mail: mailcatcher -f
your_script: instructions
Then you start your Rails app as:
foreman start -f Procfile.dev
With that command, Foreman will execute all the processes on the file.
You should install the gem locally and not in the Gemfile.
Foreman Gem

quickly starting up a rails app on a new server; "No command 'puma' found"

I am trying to quickly set up a rails server. I have an app that I have working an running on my personal computer. Running rails server launches it in localhost:3000 with no issues.
I am trying to start a server on a server to an external IP. So, I followed the instructions here: http://luugiathuy.com/2014/11/setup-nginx-puma-on-ubuntu/ with no issue until I ran: puma -e production -d -b unix:///tmp/app_name.sock --pidfile /tmp/puma.pid and got:
No command 'puma' found, did you mean:
Command 'pump' from package 'pump' (universe)
Command 'pumpa' from package 'pumpa' (universe)
Command 'duma' from package 'duma' (universe)
I have run: gem install puma and bundle install I have added gem 'puma' to my gemfile.
If I visit the external IP of the server I get the nginx error of:
We're sorry, but something went wrong.
If you are the application owner check the logs for more information.
which makes sense since puma isn't running.
Solved it:
`/bin/bash --login`
I believe this worked because before I was not "logged in" to the user that had puma installed

Clout9 (c9.io) IDE ruby on rails error when run rails s

When running rails server on cloud9, I get: No application seems to be running here! I tried removing the workspace, cloning it from a repository on github, and nothing works.
The solution that works for me is:
to start the server, do not simply type
rails s
but instead
rails s -b $IP -p $PORT

Can't deploy Rails and Faye app to Heroku

I am making a chatting application using Ruby on Rails with Faye gem.
The app works on localhost after I inserted "localhost:9292/faye.js" in the index.html and I run the following script on command line:
rackup faye.ru -s thin -E production
ruby faye.rb
However, the app doesn't work on Heroku even if I changed the source url to "http://myappname.herokuapp.com/faye.js" and makes these errors.
http://myappname.herokuapp.com/faye.js 404 (Not Found)
ReferenceError: Faye is not defined
I've tried these commands but no luck so far.
heroku bundle exec rackup faye.ru -s thin
heroku bundle exec ruby faye.rb
It would be great if you could figure this out.
I appreciate for your help in advance!
I changed the url to "http://myappname.herokuapp.com:9292/faye.js"
and run the following commands on the commandline
heroku run bundle exec rackup faye.ru
heroku run bundle exec ruby faye.rb
Now I am getting this error
http://myappname.herokuapp.com:9292/faye.js net::ERR_CONNECTION_REFUSED
I tested the app with "foreman start" on localhost and everything worked.
However, it still does not work on Heroku.

How to resolve issue starting Ruby on Rails server on Cloud9 ide?

I'm trying to start the web server for a rails app on a Cloud9 IDE workspace and I'm receiving this error message:
`require': cannot load such file -- rack/handler/server (LoadError)
This is the code that I am running:
rails s -p $PORT -b $IP server
I'm very new to Ruby on Rails so my apologies if this pretty simple.
You're running
$ rails s -p $PORT -b $IP server
when it should just be
$ rails s -p $PORT -b $IP
You probably added an extraneous server because you're used to running rails server, but rails s is just a shorthand for the former.
It looks like the extra argument to rails is causing it to look for a file named server in rack/handler, and when it doesn't find a file it throws an error.

Resources