I accidentally ran the command sudo chmod 600 -R / when I meant to do it to sudo chmod 600 -R Documents/some_directory and my macbook pro's file permissions got messed up. I ran sudo chmod 755 -R /directories_that_don't_need_to_be_secure and tried to fix all the permissions. But when I start my Jekyll server jekyll --server --auto everything is forbidden. I made my whole directory readable, writable, and executable. But the error keeps popping up. This is what I get when the jekyll server generates
Shalin-Shah-Me:shalin shalinvs$ jekyll --server --auto
Configuration from /Users/shalinvs/Documents/Developer/Websites/shalin/_config.yml
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `gem_original_require': no such file to load -- sass (LoadError)
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `require'
from /Users/shalinvs/Documents/Developer/Websites/shalin/_plugins/sass_converter.rb:5
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `require'
from /Library/Ruby/Gems/1.8/gems/jekyll-0.12.0/bin/../lib/jekyll/site.rb:78:in `setup'
from /Library/Ruby/Gems/1.8/gems/jekyll-0.12.0/bin/../lib/jekyll/site.rb:77:in `each'
from /Library/Ruby/Gems/1.8/gems/jekyll-0.12.0/bin/../lib/jekyll/site.rb:77:in `setup'
from /Library/Ruby/Gems/1.8/gems/jekyll-0.12.0/bin/../lib/jekyll/site.rb:76:in `each'
from /Library/Ruby/Gems/1.8/gems/jekyll-0.12.0/bin/../lib/jekyll/site.rb:76:in `setup'
from /Library/Ruby/Gems/1.8/gems/jekyll-0.12.0/bin/../lib/jekyll/site.rb:31:in `initialize'
from /Library/Ruby/Gems/1.8/gems/jekyll-0.12.0/bin/jekyll:238:in `new'
from /Library/Ruby/Gems/1.8/gems/jekyll-0.12.0/bin/jekyll:238
from /usr/bin/jekyll:23:in `load'
from /usr/bin/jekyll:23
I have also tried using Disk Utility to repair my permissions but still no luck.
Thanks in advance!
The jekyll command operates on the directory you are currently in. The output in your question shows that you're running it in your home directory. It seems unlikely that that's really where you have your jekyll site stored (especially since it means that jekyll would have to process everything in your home directory each time it runs).
Assuming that you have your jekyll files somewhere else, change to that directory (where you should see the _config.yml and other jekyll files/dirs) and try running the command there.
Disk Utility.app has a Fix Permissions module. Perhaps that would solve it?
Related
I try to deploy the Rails app to the server. But I got this error when the webpage runs. I did a lot of research on this problem, and most of them are to change the permission. But i absolutely can not change the permission in .socket folder. If anyone knows how to fix this problem, please help me out. Thanks
parent directory is world writable, FileUtils#remove_entry_secure does not work; abort: "/.socket/fcgi/passenger-native-support-d8m77l" (parent directory mode 40777) (ArgumentError)
/.socket/ruby/rubies/ruby-2.2.2/lib/ruby/2.2.0/fileutils.rb:716:in `remove_entry_secure'
/.socket/passenger/lib/phusion_passenger/utils/tmpio.rb:72:in `ensure in mktmpdir'
/.socket/passenger/lib/phusion_passenger/utils/tmpio.rb:72:in `mktmpdir'
/.socket/passenger/lib/phusion_passenger/native_support.rb:147:in `download_binary_and_load'
/.socket/passenger/lib/phusion_passenger/native_support.rb:49:in `start'
/.socket/passenger/lib/phusion_passenger/native_support.rb:405:in `<top (required)>'
/.socket/ruby/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/.socket/ruby/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/.socket/passenger/lib/phusion_passenger.rb:237:in `require_passenger_lib'
/.socket/passenger/helper-scripts/rack-preloader.rb:75:in `init_passenger'
/.socket/passenger/helper-scripts/rack-preloader.rb:157:in `<module:App>'
/.socket/passenger/helper-scripts/rack-preloader.rb:29:in `<module:PhusionPassenger>'
/.socket/passenger/helper-scripts/rack-preloader.rb:28:in `<main>'
This is a known issue with Passenger. Try this chmod o+t -R /tmp
Read more about the sticky bit here: https://askubuntu.com/questions/432699/what-is-the-t-letter-in-the-output-of-ls-ld-tmp
Doing sudo chmod o-w tmp/ worked for me
This removes world writable permissions for the directory
I get this error when I run rails s.
Can anyone help me?
Rails Error: Unable to access log file. Please ensure that
/Users/delejnr/Desktop/ruby_playground/observe/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. Exiting
/Library/Ruby/Gems/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:345:in
delete': Permission denied -
/Users/delejnr/Desktop/ruby_playground/observe/tmp/pids/server.pid
(Errno::EACCES) from
/Library/Ruby/Gems/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:345:in
check_pid!' from
/Library/Ruby/Gems/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:246:in
start' from
/Library/Ruby/Gems/2.0.0/gems/railties-4.0.3/lib/rails/commands/server.rb:84:in
start' from
/Library/Ruby/Gems/2.0.0/gems/railties-4.0.3/lib/rails/commands.rb:76:in
block in <top (required)>' from
/Library/Ruby/Gems/2.0.0/gems/railties-4.0.3/lib/rails/commands.rb:71:in
tap' from
/Library/Ruby/Gems/2.0.0/gems/railties-4.0.3/lib/rails/commands.rb:71:in
<top (required)>' from bin/rails:4:inrequire' from bin/rails:4:in
`'
You don't have permission for that file(s).
Start as admin / sudo and check the file permissions and adjust them accordingly.
Also make sure that file( /Users/delejnr/Desktop/ruby_playground/observe/log/development.log ) even exists.
I received this error and ran the following command to fix the permissions:
sudo chmod 0664 <path to app>/<name of app>/log/development.log
Replace <path to app> and <name of app>
in your case
sudo chmod 0664 /Users/delejnr/Desktop/ruby_playground/observe/log/development.log
For Mac 10.11.5
I recently uploaded some new files to my production server (and overriding the old ones) and am now getting 500 Internal Server Error. The server is running phusion passenger (even though I am not getting that error message anymore) and in my local test environment everything seems to be working fine.
Here is the site: http://www.pandonews.com/
When I looked in my apache log i see this error:
[ pid=3106 thr=140057117177664 file=ext/apache2/Hooks.cpp:884 time=2013-09-01 17:37:24.84 ]: Unexpected error in mod_passenger: Cannot spawn application '/var/www/feedme': The spawn server died unexpectedly, and restarting it failed.
Backtrace:
in 'virtual Passenger::SessionPtr Passenger::ApplicationPool::Client::get(const Passenger::PoolOptions&)' (Client.h:742)
in 'Passenger::SessionPtr Hooks::getSession(const Passenger::PoolOptions&)' (Hooks.cpp:312)
in 'int Hooks::handleRequest(request_rec*)' (Hooks.cpp:585)
I have no idea what the problem is. It has been running fine up until now. I don't really know where to start in order to fix this. I tried running gem passenger install again but nothing happened.
Recent activities:
Installed pg gem (but removed it from gem file after deciding to stay with sqlite3 for now) the yml file should be ok...
Tried running bundle update on server and locally but it keeps hanging
Changed some javascript and css files...
Tried resetting the server with RAILS_ENV=production rake:db reset - no change!
EDIT:
when running rails s production i get the following error:
/home/otto/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.7/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- rack/handler/production (LoadError)
from /home/otto/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.7/lib/active_support/dependencies.rb:251:in `block in require'
from /home/otto/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.7/lib/active_support/dependencies.rb:236:in `load_dependency'
from /home/otto/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.7/lib/active_support/dependencies.rb:251:in `require'
from /home/otto/.rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.5/lib/rack/handler.rb:63:in `try_require'
from /home/otto/.rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.5/lib/rack/handler.rb:16:in `get'
from /home/otto/.rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.5/lib/rack/server.rb:272:in `server'
from /home/otto/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.7/lib/rails/commands/server.rb:59:in `start'
from /home/otto/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.7/lib/rails/commands.rb:55:in `block in <top (required)>'
from /home/otto/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.7/lib/rails/commands.rb:50:in `tap'
from /home/otto/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.7/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
EDIT2:
$ passenger-status
ERROR: Phusion Passenger doesn't seem to be running.
EDIT3:
Seems like it is running, still internal server error:
passenger start -a 0.0.0.0 -p 3000 -d -e production
=============== Phusion Passenger Standalone web server started ===============
PID file: /var/www/feedme/tmp/pids/passenger.3000.pid
Log file: /var/www/feedme/log/passenger.3000.log
Environment: production
Accessible via: http://0.0.0.0:3000/
Serving in the background as a daemon.
===============================================================================
otto#scraper:/var/www/feedme$ passenger status
Phusion Passenger Standalone is running on PID 18788, according to PID file /var/www/feedme/tmp/pids/passenger.3000.pid
otto#scraper:/var/www/feedme$
Did the following:
gem install passenger (no sudo or anything)
Find root: passenger-config –root
Give chmod to all from root until username folder: sudo chmod -R 777 /home/username/.rvm/gems/ruby-1.9.3-p392/gems/passenger-4.0.14 to every folder until /home/username/
passenger-install-apache2-module (without anything)
Take the code you are given paste it inside: /etc/apache2/httpd.conf
sudo service apache2 restart
I accidentally ran the command sudo chmod 600 -R / when I meant to do it to sudo chmod 600 -R Documents/some_directory and my macbook pro's file permissions got messed up. I ran sudo chmod 755 -R /directories_that_don't_need_to_be_secure and tried to fix all the permissions. But when I start my Jekyll server jekyll --server --auto I hit a bunch of errors. I made my whole directory readable, writable, and executable. But the error keeps popping up. This is what I get when the jekyll server generates:
Shalin-Shah-Me:shalin shalinvs$ jekyll --server --auto
Configuration from /Users/shalinvs/Documents/Developer/Websites/shalin/_config.yml
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `gem_original_require': no such file to load -- sass (LoadError)
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `require'
from /Users/shalinvs/Documents/Developer/Websites/shalin/_plugins/sass_converter.rb:5
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `require'
from /Library/Ruby/Gems/1.8/gems/jekyll-0.12.0/bin/../lib/jekyll/site.rb:78:in `setup'
from /Library/Ruby/Gems/1.8/gems/jekyll-0.12.0/bin/../lib/jekyll/site.rb:77:in `each'
from /Library/Ruby/Gems/1.8/gems/jekyll-0.12.0/bin/../lib/jekyll/site.rb:77:in `setup'
from /Library/Ruby/Gems/1.8/gems/jekyll-0.12.0/bin/../lib/jekyll/site.rb:76:in `each'
from /Library/Ruby/Gems/1.8/gems/jekyll-0.12.0/bin/../lib/jekyll/site.rb:76:in `setup'
from /Library/Ruby/Gems/1.8/gems/jekyll-0.12.0/bin/../lib/jekyll/site.rb:31:in `initialize'
from /Library/Ruby/Gems/1.8/gems/jekyll-0.12.0/bin/jekyll:238:in `new'
from /Library/Ruby/Gems/1.8/gems/jekyll-0.12.0/bin/jekyll:238
from /usr/bin/jekyll:23:in `load'
from /usr/bin/jekyll:23
I have also tried using Disk Utility to repair my permissions but still no luck.
Thanks in advance!
What do you get with this?
gem list sass
Try this:
gem uninstall sass
gem install sass
Then run your jekyll command again.
* * * * * /bin/bash -l -c 'cd /Users/boris/projects/MyApp/ && rails runner "Resque.enqueue(Place)"'
Basically I need to do the following:
Load Ruby with RVM
Navigate to MyApp Dir
Run the following line: rails runner "Resque.enqueue(Place)
The above cron seems to be running, but its producing the following errors with rails runner
whats going on?
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/dependency.rb:52:in `initialize': Valid types are [:development, :runtime], not nil (ArgumentError)
from /Users/boris/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/resolver.rb:359:in `new'
from /Users/boris/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/resolver.rb:359:in `search'
from /Users/boris/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/resolver.rb:354:in `gems_size'
from /Users/boris/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/resolver.rb:179:in `resolve'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/source_index.rb:95:in `sort_by'
from /Users/boris/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/resolver.rb:175:in `each'
from /Users/boris/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/resolver.rb:175:in `sort_by'
from /Users/boris/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/resolver.rb:175:in `resolve'
from /Users/boris/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/resolver.rb:160:in `start'
from /Users/boris/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/resolver.rb:128:in `resolve'
from /Users/boris/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/resolver.rb:127:in `catch'
from /Users/boris/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/resolver.rb:127:in `resolve'
from /Users/boris/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/definition.rb:151:in `resolve'
from /Users/boris/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/definition.rb:90:in `specs'
from /Users/boris/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/definition.rb:135:in `specs_for'
from /Users/boris/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/definition.rb:124:in `requested_specs'
from /Users/boris/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/environment.rb:23:in `requested_specs'
from /Users/boris/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/runtime.rb:11:in `setup'
from /Users/boris/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler.rb:107:in `setup'
from /Users/boris/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/setup.rb:6
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `require'
from /Users/boris/projects/chaggregator/config/boot.rb:6
from script/rails:5:in `require'
from script/rails:5
Actually the best way to do this is to use rvm wrapper. You can create a wrapper like this:
rvm wrapper ruby-1.9.3-p0#somegemset appname rails
binary can be rails, rake, gem or whatever other ruby binary you have installed. What happens is that rvm creates a wrapper that will source the correct rvm environment before executing the rails command. On system wide rvm, the wrapper will normally be placed in /usr/local/rvm/bin/
Now from cron you can just do:
*/3 * * * * cd /path/to/your/app && appname_rails runner "Resque.enqueue(Place)" -e production
This will cd into your app directory and execute the rvm wrapper you just created every 3 minutes. This example is based on rails 3 and production environment.
You need to source the right environment via RVM before any Ruby code runs. So include something like this in the command:
source /usr/local/rvm/environments/ruby-1.9.2-p180#my-gemset
So a potential solution would be:
SHELL=/bin/bash
* * * * * source /{path_to_rvm_environment_for_ruby}#{gemset} && cd /Users/boris/projects/MyApp/ && rails runner "Resque.enqueue(Place)"'
Lots of moving pieces here, here are a couple of pointers on things to check in your environment (ruby, rvm, bundle) - post your findings and will go from there.
Path's issue with bundler, to change or not to change?
Bundle bug
I guess the commands runs fine outside of cron? if you're running your cron job as a different user, check the environment of that user.