Locally works fine, on server - - ruby-on-rails

When running my rails app locally, everything works fine. However, when deployed to a server, I get the following error:
ActionController::UnknownFormat (TasksController#index is missing a template for this request format and variant.
It's similar for all the pages. What could be the problem?
Rails version is 5.0.1. The deployed application is running on unicorn and nginx. I'm using slim templates. The same problem appears either if the views have .slim extension or .html.slim.

The slim gem might not be installed on your server. Try running bundle install on the command line in your app directory and then restarting your server.

Related

Hosting a ruby site on localhost?

How to locally host this website package i got, I am PHP developer, and this package my client gave me contains of ruby gem files. Can anyone let me know step by step process for mac?
this is how the package looks
I tried installing gem bundle and packages, but not able to host it locally.
Here is a step by step tutorial to launch you first ruby on rails server.
https://www.tutorialspoint.com/ruby-on-rails/rails-installation.htm
When everything is set you launch your server with this command : rails server
Your server is now accessible here : http://localhost:3000
Step 2 from the below tutorial will get your site up and running on localhost.
https://www.theodinproject.com/courses/web-development-101/lessons/your-first-rails-application
First, you need to install Rails
gem install rails
Then navigate to your project folder and start your local server with
rails server

Manifest requires output filename

I'm using Rails 3.0.10 and running rake assets precompile at production server and facing problem as manifest requires output filename.this code is already deployed on heroku server and working fine. Please provide a solution on this.

undefined method `react_component' on ubuntu server

I am using ReactJs with rails . i am using react-rails gem. Everything is working fine on local machine, but when deployed it on my ubuntu server, it produces undefined method react_component error. I try to run app locally on production mode everything works fine . On my production server i use Nginx with Unicorn.
After looking into my capistrano settings, i figure out my unicorn server is not restart after deployment. So i kill my unicorn process and deploy again and everything is working fine now.

how do I add a gem in heroku?

I updated a gem(rtf) in my ruby on rails app through the Gemfile. The app works fine on my localhost but when I pushed changes to heroku and tried 'bundle install' within heroku bash. I see that the gem has been installed based on the log
Using rtf (0.3.3)
Following this, I did a
heroku restart --a myapp
however, when i tried the app on heroku, it still cant recognize the lib installed through the gem, i get the following error(normally appears when the library cannot be reached for command "require 'RTF'").
cannot load such file -- RTF
What am I doing wrong in heroku?
I think you misunderstand how Heroku works. When you run a bash shell on your app, nothing you do on that dyno will affect any other dynos for your app (like your web dynos). Heroku runs bundle install for you when you deploy your app and if your Gemfile is configured correctly all the gems will be installed.
the answer by sevenseacat is right- i had just got the case wrong-
require 'rtf'
works fine. In OSX, it ignores case in the command require 'RTF'

How does jekyll run as a .exe, and it starts rails server also?

How does the jekyll gem work, it somehow creates a command line arguement and also runs rails server on port 4000.
Where in the code does it implement this functionality?
https://github.com/mojombo/jekyll/tree/master/lib/jekyll
Jekyll uses WEBrick. WEBrick also happens to be used by Rails, but is a generic Ruby HTTP server. The functionality is implemented in bin/jekyll.

Resources