Ruby on Rails Project Hosted on GitHub - ruby-on-rails

I'm trying to figure out how to display the home page of my ruby on rails hello world project. It's currently live but I'm getting the README.md file contents instead of the Hello World message, which, is in the application_controller.rb file a few directories in from the root. The README.md file that's showing is at the root. live project

You can only host a static website with Github pages.
If you want to deploy your rails app I suggest to use the Heroku free plan.
Read this if you want to understand the difference between static and dynamic websites.

Related

How to deploy a middleman blog inside a rails app?

I have a rails app. I want to make a blog for it with middleman and in subdirectory. For example www.myapp.com/blog .
How can I do that?
MiddleMan's output is a static HTML/JS/CSS website. Just place the output of your MiddleMan project in the public/blog directory within your Rails app.

How to use jekyll on an existing blog made with rails

My situation is that I have just finished creating a blog using ruby on rails. I have been using localhost to see it display on my browser, but I want to deploy it online. I found out that rails apps can't be deployed on ghpages because it is not static. However, I searched online and read that if I used Jekyll, i could display it on ghpages. I have never used jekyll before, so my question is...
How could I use/integrate jekyll to my existing rails app so that it can be deployed and hosted through github pages?
Thank you!
You are trying to screw in a screw with a hammer.
Github pages is simple free hosting for static pages like a simple portfolio or the info page for a github project. You would use jekyll to generate simple static HTML pages for this.
If you want to deploy a Rails application there are several cloud hosting providers such as Heroku and Openshift that provide a free tier.
First determine what you are trying to build. Then select the right tool and hosting for the job.
You CANNOT host a rails blog app with databases on gh pages. you need a static site to be hosted on ghpages. jekyll is a static site generator that generates static HTML pages which can be served to users from gh-pages.
So you need to build new blog engine with jekyll
install jekyll: gem install jekyll
create new jekyll site: jekyll new your-github-username.github.io
cd to the new directory generated and test locally: jekyll serve (visit http://localhost:4000)
link to github articles on gh-pages with jekyll

Get AWS Beanstalk to run Rails app from subfolder as opposed to root

I have a repo with the folder structure as such
root_of_repo
-app
-some_gem
-some_gem
Within the app folder is where my Rails app lives. I would like for beanstalk to deploy the rails app from within this folder. However, it keeps trying to deploy the Rails app from the root. How would I tell beanstalk to first navigate into the app folder then continue running the necessary rails actions (bundle, rails s, etc).
beanstalk is very sensitive to structure as its deployment process is mostly a bunch of shell scripts wrapped together. therefore it won't bend to your new structure.
a couple of options here:
1. adapt to the standard structure, which is also recommended by rails. don't nest "app" folders.
2. create a pre-deploy script (.ebextension) that copies your folder to the right place.

Where should I save standalone non-ruby scripts in my Rails app?

This is a simple question, but I haven't been able to find an exact answer to it anywhere.
I have a standalone Python script which I am using in my Rails app. What is the appropriate folder I should save it in according to convention, so that I can push it to production (currently running it from my computer's desktop)? I think the answer is lib/assets but I want to make sure.
I don't think there is an exact answer for this question.
If it is a ruby script, it is usually placed in lib or bin.
From the rails folder descriptions in Getting Started with Rails guide:
bin/ Contains the rails script that starts your app and can contain
other scripts you use to setup, deploy or run your application.
lib/ Extended modules for your application.
You could put it in lib/assets folder as it reflects your understanding that it is an external asset used in the system.

Spree doesn't generate project files in folder

I generate site following guide http://guides.spreecommerce.com/getting_started.html
But when i try to edit Spree generated files. There's no files in app folder. Where they disappear?
a busy cat http://img822.imageshack.us/img822/2469/screenshotat20120409224.png
Spree does not put files inside the app directory, but works as an engine. For more information about engines, please read the Engines Guide.

Resources