Permission denied - /tmp/.ruby_inline/Inline_ImageScience_cdab.c - ruby-on-rails

I have a Ruby on Rails app that I've recently deployed to a remote server (Ubuntu 9.10, nginx, passenger, ruby-enterprise) and I'm getting the error (works fine locally):
Permission denied - /var/www/project_name/tmp/.ruby_inline/Inline_ImageScience_cdab.c
First, the folder /tmp/.ruby_inline/ is empty - should it be? Is it trying to create Inline_ImageScience_cdab.c or read it?
I think I have all the required gems installed: 'gem list' shows image_science and RubyInline installed. libfreeimage3 and libfreeimage-dev are also installed.
I've run chmod 755 on /tmp/.ruby_inline/ to match the permissions on surrounding folders but I cannot go any higher than that, however, or I get another error:
/var/www/project_name/tmp/.ruby_inline is insecure (40777). It may not be group or world writable. Exiting.
And I guess second, why am I getting this error? :)
Thanks

I was able to fix the problem. The folder /tmp/.ruby_inline/ wasn't supposed to be empty so it wasn't finding Inline_ImageScience_cdab.c and giving a 'permission denied'. The files required were installed to ~/.ruby_inline so I just copied them to /tmp/.ruby_inline and chmod 755 them.

also i guess the filesystem in the production is for some reason read-only to store static content. Contact your host.

Related

Change where Julia is storing /logs/manifest_usage.toml

I'm getting this error when I run Julia in Docker:
julia.core.JuliaError: Exception 'SystemError: opening file "/root/.julia/logs/manifest_usage.toml": Read-only file system' occurred while calling julia code:
I tried setting JULIA_HISTORY, but that doesn't seem to be respected.
It looks like you actually probably want to move your whole .julia folder, assuming that the whole /root/ directory is probably going to give you filesystem permission errors unless you always run as root within your docker image.
You can control the location of the .julia directory at first install with the JULIA_DEPOT_PATH environment variable, which is described in a bit more detail in this answer: permissions for installing packages on julia in slurm cluster, though depending on how you are installing Julia, you may be able to more easily sidestep the whole issue by just not using sudo when installing Julia.

RubyMine + Vagrant : Error Copying Gems

I'm currently evaluating RubyMine 7.0.4 on Mac OS X 10.8.5, and I'm trying to get my Ruby on Rails project up and running in the editor but after I try to bundle, I get "Error Copying Gems". Locally I use rbenv but this project uses Vagrant with Ruby 2.1.
I've gone into RubyMine Preferences -> Languages and Frameworks -> Ruby SDK and Gems and set up a "Remote Interpreter" which looks like it is correctly pulling in my Vagrant / SSH information.
After I click OK, it looks like it correctly pulls down the gems, and copies them to the vendor/bundle folder, but then the IDE pops up an error message saying :
"Error Copying Gems - Unknown message with code 'Could not determine the type of file sftp://127.0.0.0.1:2222/......'"
or sometimes I'll get a more detailed error:
"Error Copying Gems - Could not copy sftp://127.0.0.1:2222/usr/bin/sudoedit to file://Users/my.username/Library/Caches/RubyMine70/ruby_stubs/....."
It feels like it is trying to copy them to a local cache folder on my Mac but failing for some reason.
I was facing a similar albeit different problem, maybe you are making the same mistake:
When setting up RubyMine to work with Vagrant, I am assuming you are adding a remote interpreter using the Vagrant dialogue. There it asks you to input the path to ruby executible. This is misleading, what you need is the path to where the gems are installed.
I'm also assuming you using RVM on your VM, as you indicate that you are not using rbenv on your VM.
I solved this by following the symlink steps found http://randycoulman.com/blog/2013/11/05/rubymine-and-vagrant/
Basically, RubyMine isn't trying to save things on your host machine. Its trying to save things to that particular path on your guest OS. I worked around this issue by creating the /Users/user_name/... directory on my guest OS, and then symlinking the directory that has the projects to /vagrant (Again, on the guest OS)

Sublime SFTP + Rails + DigitalOcean -- Uploading Files

Recently had the pleasure of picking up a VPS over # DigitalOcean. It's a Ubuntu 14.04 running Rails + Nginx & Unicorn.
I wanted to work with Sublime, as I have locally, so I installed the commercial SFTP plugin. I was able to successfully gain remote access to my VPS, and I even downloaded the rails folder locally. Now is where it gets difficult though, and I need some help.
How I do I keep the local folder and the remote folder in sync?
Right clicking on the folder via Sublime offers some options like, sync Local -> Remote, which seems like what I want, except that every upload ends in failure (Permission denied).
Am I supposed to be doing this local to remote sync? Or am I off base here? If I'm on base, why do I get permission denied?
Probably, the user you're using for the SFTP connection has read permissions on the folder you're working on, but is not allowed to write.
For this reason, you were allowed to download your remote folder, but no longer allowed to write in it (upload).
You can check this by running ls -ld /path/to/rails/ and reading the first part (for example, it could be drwxr--r--). If needed, here you can learn more about file system permissions.
If it's a permission problem, you can solve it in different ways, but you should consider how each solution could impact the security and/or functionality of your application:
You could change the owner of the rails directory to match the Sublime SFTP user (see man chown), and ensure the owner of the rails user has write access on it (sudo chmod o+w /path/to/rails)
You could use a different user for Sublime SFTP access (one that has write permissions on the rails folder)
You could add the Sublime SFTP user to the group of the rails folder (useradd -G {group-name} username) and then grant the folder group write access (sudo chmod g+w /path/to/rails)

Rails Error: Unable to access log file. Please ensure that /home.../log/development.log exists and is chmod 0666

Im trying to migrate a db2 database to Ruby on Rails, but just when I run rails g scaffold, I get this:
Rails Error: Unable to access log file. Please ensure that /home/.../log/development.log exists and is chmod 0666. The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.
I have checked and my development.log does not exist! I'm not sure why, since I followed every step during the installation, but still my file doesn't exist. How can I create it? I have already tried uninstalling and installing Rails again, but the problem remains.
Maybe just do what it asks you to do?:
$ touch the_required_path/development.log
$ chmod 0666 the_required_path/development.log
I've always had success with the the log file permissions as 644. When this has happened to me, more than once I might add, it has always been answered by the question linked below. Since this is the first answer in Google for the query I use, I'm linking to the answer that I really want.
Rails: Unable to access log file

How Do I Fix "Permission Denied" Error When Trying to Make Directory in Rails?

when I type the command
mkdir rails_projects
to follow along with a tutorial I am using on www.railstutorial.org I get this problem:
~ DUFF$ mkdir rails_projects
mkdir: rails_projects: Permission denied
Does anyone know what this is happening? I tried to quit terminal and come back, but that didn't work. I was thinking I may some how not have access to the current directory I am in, but I am not sure how to check that and I am the only user (that I am aware of on the computer). I looked around at the other threads but it seemed like they were not the same issue and most were PHP based.
I am not sure what commands I use to find out the directory I am currently in. Also, I am new to programming so I am not sure where these things reside on my system. Any help would be appreciated. You all were very helpful with my questions yesterday. I have seen a few posts saying you never need to use sudo and I should have access to create a directory, so I am not sure what is happening.
Again, thanks in advance.
What operating system are you using? If it's Linux/OS X, you can use the pwd command to list your current directory.
I would recommend you then switch directories to your user's home directory and start work there. You can do this with the cd ~
~ is simply a shortcut for the full path to the user's home directory, which, in OS X is generally /Users/username

Resources