Ruby on Rails

Ruby on Rails (also known as RoR, or simply as Rails) is a server side model-view-controller framework written in Ruby.

Ruby on Rails subscription active
You will receive email notifications for new publications on Ruby on Rails.
262 Results
  • Question

    bundle install NoMethodError: undefined method `gsub' for nil:NilClass

    During a routine deploy (a log message was being changed) to one of our testing environment servers, the deploy failed with the message NoMethodError: undefined methodgsub' for nil:NilClasswhenbundle install` was run....
    Accepted Answer: For anyone else encountering a similar problem, this was resolved by updating bundler version.
    1 By kathrynforsythe DigitalOcean Ruby on Rails
  • Question

    How can I run a rake task in my production environment?

    I have set up a rake task that I want to run once an hour using a cron expression. I got it working on my local dev environment, but I can't get it to work on my production environment hosted here. I have the followin...
    Accepted Answer: HI! Let me see if I can help. The first thing that comes to mind is that you do need to set the environment and use bundle. Be sure you're in the root of your rails app, and that you're using the user your app runs as...
    1 By donkerbc Ruby on Rails PostgreSQL Ruby Ubuntu 18.04
  • Question

    Rails / Action Text + Active Storage / Spaces

    I am unable to upload files into DO Spaces that are uploaded via the Action Text editor. I can store them locally but not in Spaces. I get the following message: <Error> <Code>SignatureDoesNotMatch</Code> <RequestId>...
    Accepted Answer: Of course the solution was CORS. My dumb brain kept saying 'CORS' doesn't count for local. Anyhow - it does. I added the following CORS configuration. Allowed Methods: GET, PUT, DELETE, POST Allowed Headers: Content-...
    1 By ianbradbury Ruby on Rails DigitalOcean Spaces
  • Question

    Best way to install wordpress and rails on same domain

    I have an nginx droplet with a rails app on it - I now need to add a wordpress site (as the landing pages to sit in front of my app. Im nervous about having wordpress and (my current app):'rails and elasticsearch and ...
    Accepted Answer: Hello, @christopherT If you think that the droplet can handle both applications without any issues you can go ahead and install WordPress on the same droplet. However if you would like to keep things separate you can...
    1 By christopherT WordPress Ruby on Rails Nginx
  • Question

    Connect() failed (111: Connection refused) while connecting to upstream, incorrect upstream?

    Hello everyone, what’s the point: such an error occurs, it doesn’t particularly affect the work, but the link preview has stopped working, and I suppose it's all connected. Is upstream formed correctly? In logs writes...
    Accepted Answer: I solved the problem, there was a prerender service, and for some reason it did not start - the problem is solved. Thanks to all.
    2 By alllstar02031998 Nginx Ruby on Rails
  • Question

    Nginx Error: "client sent invalid method while reading client request line"

    Hi, I am running into an error with my Nginx config after following a tutorial on deploying Rails w/Nginx, Puma, and Capistrano. New versions of the app deploy successfully to the server, however, when I request the d...
    Accepted Answer: Hey @KDSys, thanks for offering your help here. I appreciate it. It looks like my issue was rails-specific as I was able to get past this error by changing force_ssl = true to force_ssl = false in my config/environme...
    2 By jmarbach Nginx Ruby on Rails
  • Question

    Nginx, SSL, multiple domains

    Hi folks! Have been straggling around nginx.conf for multiple domains. This is what I have 1) 3 domains 2) SSL cert 3) Droplet 4) nginx I want to redirect all https, https://www, http, http://www to one of the domain ...
    Accepted Answer: Hi! Because of the way TLS/SSL works, the whole handshake and encryption process must be done before receiving any HTTP headers or the response body (as all HTTP traffic is passed through the TLS/SSL 'tunnel,' so it h...
    1 By kitchencoders Nginx Ruby on Rails
  • Question

    How long does it typically take a cluster to come up and be live?

    I have successfully launched my app using DO Kubernetes, but have noticed that from typing kubectl apply for the first time to the cluster being able to serve requests takes around 5 minutes. Is this typical? It see...
    Accepted Answer: Hi there! Yes it can take anywhere from 3-10min for the cluster to come up. This is heavily dependent on the cluster size and how many nodes need to bootstrap as well as other factors such as the standard performance ...
    4 By scottmiller Kubernetes Ruby on Rails
  • Question

    Why can I only view default "Yay! You're on Rails!" page?

    I used the One-Click Install for a Rails app. Everything appears to have gone smoothly. So I created a folder side-by-side with the /home/rails/example app and updated /etc/nginx/sites-available/rails (and thereby sit...
    Accepted Answer: Do this: Remove the IP from your nginx vhosts (159.65.238.194). Leave the subdomain there. Restart Nginx Stop the rails service: systemctl stop rails.service Start rails from your new app's folder like this: cd /home...
    2 By leeatifrog Ruby on Rails One-Click Install Apps Ubuntu 18.04
  • Question

    log file is showing no error message

    hello, In my rails app i have cleaned up my production.log file. and now the log file is showing no error message. what should i do?
    Accepted Answer: Hello, Do you by any chance have any logging related values set in config/environments/production.rb ? If you haven't made any changes, the default should be: config.log_level = :info RAILS_DEFAULT_LOGGER = Logger.n...
    3 By smehsan Ruby on Rails Ubuntu 18.04
  • Question

    Ruby on Rails One Click install - Change/add application and keep Puma running

    Good day, I've use the one click Ruby on Rails image to create a droplet. I've cloned my project in /home/rails/project-name and installed all dependancies and migrated the database. I've also created a virtual host c...
    Accepted Answer: Try seeing the output of tail -f /var/log/syslog Take a look if it shows: " Environment: development"... somewhere in the Puma output. I was able to add any Environment Variable I needed in the file: /etc/systemd/s...
    5 By designcafe Ruby on Rails Ubuntu 18.04
  • Question

    Rails ActiveStorageDigitalOcean Spaces CORS

    I'm getting a CORS error when trying to upload an image to DigitalOcean Spaces, despite it working fine in development and test. The error is as follows: Access to XMLHttpRequest at 'https://vglist.sfo2.digitaloceans...
    Accepted Answer: So I figured out that the reason this wasn't working is because I needed to set up CORS, and include some headers that Rails/Spaces needed. You need to go your DigitalOcean Spaces settings, then "Add" an Advanced CORS...
    1 By connoshea Ruby on Rails Ubuntu
  • Question

    Why is letter_opener not working?

    Hello, I'm just starting with a DO droplet, using Ubuntu 18.04, where I installed my Rails app as environment = "development" . In my local machine I set the gem "letter_opener", to access and debug the emails that ha...
    Accepted Answer: Apparently I'm not the only one having this issue... It seems that the best option would be to dockerize the application, switching from letter_opener to mailcatcher gem^^
    2 By jplescouzeres Ruby on Rails Ubuntu 18.04
  • Question

    How can I run 2 Dokku-based Droplets using the same Domain?

    I am building an application that uses a Rails API with a Vue.js front-end. I'd like to have the Rails API hosted in one Dokku droplet and accessible from http://api.mydomain.com, and have the Vue.js front-end hosted...
    Accepted Answer: Hey friend, This should definitely be possible. You should be able to set in your DNS for the root domain and/or the www subdomain to go to the IP of one droplet, and the API subdomain to go to the other. Jarland
    1 By kecuster Dokku Ruby on Rails Node.js
  • Question

    Two Rails projects on two different droplets with single domain

    Is it possible to use one domain for two Rails projects on two different droplets? I have two droplets with two different Rails 5 projects (ubuntu 18, nginx, puma). One for the website and another for API (backend fo...
    Accepted Answer: That's certainly feasible. Make Sure api.example.com resolves to the intended Droplet and Nginx has virtual hosts configured to handle requests for this subdomain. Same applies to Main domain on the other Droplet. Pr...
    1 By vitvetal Ruby on Rails Nginx Ubuntu 18.04
  • Question

    How to point Nginx to serve Capistrano deployment location (/home/rails/apps/appname/current) on Rails one click application?

    Hello, I have set up a Rails one click application and have configured Capistrano to deploy to /home/rails/apps/appname/current. All of the files are present and there are no errors during deployment. Before I setup C...
    Accepted Answer: Update: it turns out I needed to reboot the droplet and puma. I ran sudo reboot whilst SSHed into the droplet, followed by cap production puma:restart locally, and my site suddenly appeared. I couldn't find this infor...
    1 By LProof Ruby on Rails Nginx Ubuntu 18.04
  • Question

    DigitalOcean 1-Click Rails App - InvalidAuthenticityToken

    [2018-08-01T00:08:14.616530 #13285] INFO -- : Started POST "/login" for 108.3.168.115 at 2018-08-01 00:08:14 +0000 I, [2018-08-01T00:08:14.628178 #13285] INFO -- : Processing by SessionController#create as HTML I, [...
    Accepted Answer: Referencing this link: https://www.rubytreesoftware.com/resources/secure-your-cookies/ I was able to solve the problem. config/environments/production.rb config.force_ssl = true config/initializers/session_store.rb s...
    1 By Zetal Ruby on Rails Applications DigitalOcean Nginx Ubuntu 16.04
  • Question

    I didnt run 7777 port on my ubuntu server with ruby on rails app

    i run rails s -p 7777 command but my ip close this port
    Accepted Answer: @bilgiislem949e04522437ee32 Maybe you activated the firewall on your droplet make sure it is disabled with sudo ufw status If it is enabled just allow connections to port 7777 using sudo ufw allow 7777 If you are usi...
    1 By bilgiislem949e04522437ee32 Ruby on Rails Ubuntu
  • Question

    ImportError: No module named MX while running Python script in Ubuntu 14.04

    Hi I have a droplet using the one click Ubuntu Ruby on Rails on 14.04 (Postgres, Nginx, Unicorn). Within my /lib/assets folder i have a ruby script that uses mx module to find the date. I run it with result = `python ...
    Accepted Answer: @cliffjnr Have you tried to install the module using pip? pip install egenix-mx-base
    2 By cliffjnr Python Ruby on Rails Ubuntu
  • Question

    Sphinx error after server update

    I just discovered that the search functionality on my web site doesn't work. Going through some logs, I find this: unicorn.stdout.log: (...) Error connecting to Sphinx via the MySQL protocol. Error connecting to Sphin...
    Accepted Answer: I am not sure about Sphinx but if you are trying to restart, you may need to specify the Rails environment when calling the rake CLI: RAILS_ENV=production bundle exec rake ts:reindex Edit: or something similar with wh...
    1 By bbvv Ruby on Rails Ubuntu