How to raise Rails console as underprivileged www-data user? - ruby

My Rails app runs with nginx's www-data user and all disk write functions are owned by www-data and so all the app's related disk stored assets are owned by www-data. Sometimes I need to raise the Rails console and perform actions that touch or create stored assets and I do not want these touched/created assets to become owned by root or another admin user, I want them to remain owned by the www-data user. This worked fine under ruby 1.9.3 -> 2.6.x:
sudo -u www-data RAILS_MASTER_KEY=xxx RAILS_ENV=production bin/rails console
When I try this on ruby 2.7.x or 3.0.0, I get these errors:
Loading production environment (Rails 6.1.3)
/usr/lib/ruby/3.0.0/irb/ext/save-history.rb:98:in `stat': Permission denied # rb_file_s_stat - /root/.irb_history (Errno::EACCES)
from /usr/lib/ruby/3.0.0/irb/ext/save-history.rb:98:in `save_history'
from /usr/lib/ruby/3.0.0/irb/ext/save-history.rb:60:in `block in extended'
from /usr/lib/ruby/3.0.0/irb.rb:475:in `block in run'
from /usr/lib/ruby/3.0.0/irb.rb:475:in `each'
from /usr/lib/ruby/3.0.0/irb.rb:475:in `ensure in run'
from /usr/lib/ruby/3.0.0/irb.rb:475:in `run'
from /usr/lib/ruby/3.0.0/irb.rb:400:in `start'
from /apps/connect/shared/vendor_bundle/ruby/3.0.0/gems/railties-6.1.3/lib/rails/commands/console/console_command.rb:70:in `start'
from /apps/connect/shared/vendor_bundle/ruby/3.0.0/gems/railties-6.1.3/lib/rails/commands/console/console_command.rb:19:in `start'
from /apps/connect/shared/vendor_bundle/ruby/3.0.0/gems/railties-6.1.3/lib/rails/commands/console/console_command.rb:102:in `perform'
from /apps/connect/shared/vendor_bundle/ruby/3.0.0/gems/thor-1.1.0/lib/thor/command.rb:27:in `run'
from /apps/connect/shared/vendor_bundle/ruby/3.0.0/gems/thor-1.1.0/lib/thor/invocation.rb:127:in `invoke_command'
from /apps/connect/shared/vendor_bundle/ruby/3.0.0/gems/thor-1.1.0/lib/thor.rb:392:in `dispatch'
from /apps/connect/shared/vendor_bundle/ruby/3.0.0/gems/railties-6.1.3/lib/rails/command/base.rb:69:in `perform'
from /apps/connect/shared/vendor_bundle/ruby/3.0.0/gems/railties-6.1.3/lib/rails/command.rb:50:in `invoke'
from /apps/connect/shared/vendor_bundle/ruby/3.0.0/gems/railties-6.1.3/lib/rails/commands.rb:18:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
/usr/lib/ruby/3.0.0/reline/config.rb:124:in `readlines': Permission denied # rb_sysopen - /root/.inputrc (Errno::EACCES)
from /usr/lib/ruby/3.0.0/reline/config.rb:124:in `read'
from /usr/lib/ruby/3.0.0/reline.rb:232:in `inner_readline'
from /usr/lib/ruby/3.0.0/reline.rb:175:in `readmultiline'
from /usr/lib/ruby/3.0.0/forwardable.rb:238:in `readmultiline'
from /usr/lib/ruby/3.0.0/forwardable.rb:238:in `readmultiline'
from /usr/lib/ruby/3.0.0/irb/input-method.rb:302:in `gets'
from /usr/lib/ruby/3.0.0/irb.rb:519:in `block (2 levels) in eval_input'
from /usr/lib/ruby/3.0.0/irb.rb:721:in `signal_status'
from /usr/lib/ruby/3.0.0/irb.rb:518:in `block in eval_input'
from /usr/lib/ruby/3.0.0/irb/ruby-lex.rb:202:in `lex'
from /usr/lib/ruby/3.0.0/irb/ruby-lex.rb:174:in `block (2 levels) in each_top_level_statement'
from /usr/lib/ruby/3.0.0/irb/ruby-lex.rb:171:in `loop'
from /usr/lib/ruby/3.0.0/irb/ruby-lex.rb:171:in `block in each_top_level_statement'
from /usr/lib/ruby/3.0.0/irb/ruby-lex.rb:170:in `catch'
from /usr/lib/ruby/3.0.0/irb/ruby-lex.rb:170:in `each_top_level_statement'
from /usr/lib/ruby/3.0.0/irb.rb:537:in `eval_input'
from /usr/lib/ruby/3.0.0/irb.rb:472:in `block in run'
from /usr/lib/ruby/3.0.0/irb.rb:471:in `catch'
from /usr/lib/ruby/3.0.0/irb.rb:471:in `run'
from /usr/lib/ruby/3.0.0/irb.rb:400:in `start'
from /apps/connect/shared/vendor_bundle/ruby/3.0.0/gems/railties-6.1.3/lib/rails/commands/console/console_command.rb:70:in `start'
from /apps/connect/shared/vendor_bundle/ruby/3.0.0/gems/railties-6.1.3/lib/rails/commands/console/console_command.rb:19:in `start'
from /apps/connect/shared/vendor_bundle/ruby/3.0.0/gems/railties-6.1.3/lib/rails/commands/console/console_command.rb:102:in `perform'
from /apps/connect/shared/vendor_bundle/ruby/3.0.0/gems/thor-1.1.0/lib/thor/command.rb:27:in `run'
from /apps/connect/shared/vendor_bundle/ruby/3.0.0/gems/thor-1.1.0/lib/thor/invocation.rb:127:in `invoke_command'
from /apps/connect/shared/vendor_bundle/ruby/3.0.0/gems/thor-1.1.0/lib/thor.rb:392:in `dispatch'
from /apps/connect/shared/vendor_bundle/ruby/3.0.0/gems/railties-6.1.3/lib/rails/command/base.rb:69:in `perform'
from /apps/connect/shared/vendor_bundle/ruby/3.0.0/gems/railties-6.1.3/lib/rails/command.rb:50:in `invoke'
from /apps/connect/shared/vendor_bundle/ruby/3.0.0/gems/railties-6.1.3/lib/rails/commands.rb:18:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
I've tried creating a file at /root/.irb_history and given it world write permissions and I still get the same errors.
I'm compiling ruby from source on Ubuntu 18.04 and 20.04 with only the '--prefix=/usr' flag.
If I sudo su to an admin user account that is a full user with a home directory, etc, unlike the limited www-data user, or run as root I can raise the Rails console without errors (of course ownership of on disk assets is a problem).
If I run the sudo -u www-data bin/rails console command as a full admin user I can raise the console and only see errors once I exit the console like this:
irb(main):033:0> exit
/usr/lib/ruby/3.0.0/irb/ext/save-history.rb:108:in `initialize': Permission denied # rb_sysopen - /home/[username]/.irb_history (Errno::EACCES)
from /usr/lib/ruby/3.0.0/irb/ext/save-history.rb:108:in `open'
from /usr/lib/ruby/3.0.0/irb/ext/save-history.rb:108:in `save_history'
from /usr/lib/ruby/3.0.0/irb/ext/save-history.rb:60:in `block in extended'
from /usr/lib/ruby/3.0.0/irb.rb:475:in `block in run'
from /usr/lib/ruby/3.0.0/irb.rb:475:in `each'
from /usr/lib/ruby/3.0.0/irb.rb:475:in `run'
from /usr/lib/ruby/3.0.0/irb.rb:400:in `start'
from /apps/connect/shared/vendor_bundle/ruby/3.0.0/gems/railties-6.1.3/lib/rails/commands/console/console_command.rb:70:in `start'
from /apps/connect/shared/vendor_bundle/ruby/3.0.0/gems/railties-6.1.3/lib/rails/commands/console/console_command.rb:19:in `start'
from /apps/connect/shared/vendor_bundle/ruby/3.0.0/gems/railties-6.1.3/lib/rails/commands/console/console_command.rb:102:in `perform'
from /apps/connect/shared/vendor_bundle/ruby/3.0.0/gems/thor-1.1.0/lib/thor/command.rb:27:in `run'
from /apps/connect/shared/vendor_bundle/ruby/3.0.0/gems/thor-1.1.0/lib/thor/invocation.rb:127:in `invoke_command'
from /apps/connect/shared/vendor_bundle/ruby/3.0.0/gems/thor-1.1.0/lib/thor.rb:392:in `dispatch'
from /apps/connect/shared/vendor_bundle/ruby/3.0.0/gems/railties-6.1.3/lib/rails/command/base.rb:69:in `perform'
from /apps/connect/shared/vendor_bundle/ruby/3.0.0/gems/railties-6.1.3/lib/rails/command.rb:50:in `invoke'
from /apps/connect/shared/vendor_bundle/ruby/3.0.0/gems/railties-6.1.3/lib/rails/commands.rb:18:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
If I run it as root I get the errors above.

I believe all you have to do is configure the HOME variable to your command so it looks like:
sudo -u www-data HOME=/tmp RAILS_MASTER_KEY=xxx RAILS_ENV=production bin/rails console

Related

Jekyll serve doesn't work, Permission denied

I downloaded ruby and Jekyll as a gem on a windows machine, now I want to test a site I made, but the Jekyll server opens, and then closes, does anyone has any clue on what I can do to fix this issue. thank you!!
Here is the error
> C:\Users\30697\Downloads
λ jekyll serve
Configuration file: none
Source: C:/Users/30697/Downloads
Destination: C:/Users/30697/Downloads/_site
Incremental build: disabled. Enable with --incremental
Generating...
------------------------------------------------
Jekyll 4.2.1 Please append `--trace` to the `serve` command
for any additional information or backtrace.
------------------------------------------------
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/utils.rb:141:in `initialize': Permission denied # rb_sysopen - C:/Users/30697/Downloads/FirefoxPortable/Data/profile/parent.lock (Errno::EACCES)
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/utils.rb:141:in `open'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/utils.rb:141:in `has_yaml_header?'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/reader.rb:52:in `block in read_directories'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/reader.rb:48:in `each'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/reader.rb:48:in `read_directories'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/reader.rb:89:in `block in retrieve_dirs'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/reader.rb:86:in `each'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/reader.rb:86:in `retrieve_dirs'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/reader.rb:60:in `read_directories'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/reader.rb:89:in `block in retrieve_dirs'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/reader.rb:86:in `each'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/reader.rb:86:in `retrieve_dirs'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/reader.rb:60:in `read_directories'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/reader.rb:89:in `block in retrieve_dirs'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/reader.rb:86:in `each'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/reader.rb:86:in `retrieve_dirs'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/reader.rb:60:in `read_directories'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/reader.rb:16:in `read'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/site.rb:181:in `read'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/site.rb:78:in `process'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/command.rb:28:in `process_site'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/commands/build.rb:65:in `build'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/commands/build.rb:36:in `process'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/command.rb:91:in `block in process_with_graceful_fail'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/command.rb:91:in `each'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/command.rb:91:in `process_with_graceful_fail'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/commands/serve.rb:86:in `block (2 levels) in init_with_program'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/exe/jekyll:15:in `<top (required)>'
from C:/Ruby30-x64/bin/jekyll:25:in `load'
from C:/Ruby30-x64/bin/jekyll:25:in `<main>'
C:\Users\30697\Downloads
You are running jekyll serve in the root folder of Downloads. Jekyll will process every subfolder in that folder, which can be anything you have sitting there. Things which probably have nothing to do with Jekyll. This will confuse Jekyll.
To fix this create a subfolder for your Jekyll project, and then run jekyll serve from there.
Example:
> jekyll new mysite
> cd mysite <-- very important!!!
> jekyll serve

Diaspora (Ruby) run Error, Maybe PATH Problem? "uninitialized constant TurboDevAssets (NameError)"

I try to migrate diaspora from a damaged debian 8 to another gentoo. I want to be able to can run diaspora before I deploy the web server. I crashes because of Ruby Errors, maybe kind of PATH errors.
When I run diaspora with script/server in production mode it crashes because the thing behind web.pid crashes. In the log eye_processes_stderr.log is:
bin/bundle:3:in `load': cannot load such file -- /usr/lib/ruby/bin/bundle (LoadError)
from bin/bundle:3:in `<main>'
In development mode I can not execute correctly (I tried it to get better error message reporting):
RAILS_ENV=development bin/rake db:migrate RAILS_ENV=development
bin/rake assets:precompile
because of the stdout and stderr of script/server I run: bin/bundle exec unicorn -c config/unicorn.rb
In production mode it returns:
that I shall look into stderr
and in the log there is nothing helpful, in:
tail log/eye_processes_stderr.log:
bin/bundle:3:in `load': cannot load such file -- /usr/lib/ruby/bin/bundle (LoadError)
from bin/bundle:3:in `<main>' bin/bundle:3:in `load': cannot load such file -- /usr/lib/ruby/bin/bundle (LoadError)
from bin/bundle:3:in `<main>'
But in development mode it returns:
I, [2019-10-07T11:14:20.840060 #20262] INFO -- : Refreshing Gem list
/home/diaspora/diaspora-2017-07-07-newest/config/environments/development.rb:64:in `block in <top (required)>': uninitialized constant TurboDevAssets (NameError)
from /home/diaspora/diaspora-2017-07-07-newest/vendor/bundle/ruby/2.4.0/gems/railties-5.1.6.2/lib/rails/railtie.rb:211:in `instance_eval'
from /home/diaspora/diaspora-2017-07-07-newest/vendor/bundle/ruby/2.4.0/gems/railties-5.1.6.2/lib/rails/railtie.rb:211:in `configure'
from /home/diaspora/diaspora-2017-07-07-newest/config/environments/development.rb:3:in `<top (required)>'
from /home/diaspora/diaspora-2017-07-07-newest/vendor/bundle/ruby/2.4.0/gems/railties-5.1.6.2/lib/rails/engine.rb:600:in `block (2 levels) in <class:Engine>'
from /home/diaspora/diaspora-2017-07-07-newest/vendor/bundle/ruby/2.4.0/gems/railties-5.1.6.2/lib/rails/engine.rb:599:in `each'
from /home/diaspora/diaspora-2017-07-07-newest/vendor/bundle/ruby/2.4.0/gems/railties-5.1.6.2/lib/rails/engine.rb:599:in `block in <class:Engine>'
from /home/diaspora/diaspora-2017-07-07-newest/vendor/bundle/ruby/2.4.0/gems/railties-5.1.6.2/lib/rails/initializable.rb:30:in `instance_exec'
from /home/diaspora/diaspora-2017-07-07-newest/vendor/bundle/ruby/2.4.0/gems/railties-5.1.6.2/lib/rails/initializable.rb:30:in `run'
from /home/diaspora/diaspora-2017-07-07-newest/vendor/bundle/ruby/2.4.0/gems/railties-5.1.6.2/lib/rails/initializable.rb:59:in `block in run_initializers'
from /usr/lib/ruby/2.4.0/tsort.rb:228:in `block in tsort_each'
from /usr/lib/ruby/2.4.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
from /usr/lib/ruby/2.4.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
from /usr/lib/ruby/2.4.0/tsort.rb:431:in `each_strongly_connected_component_from'
from /usr/lib/ruby/2.4.0/tsort.rb:421:in `block in each_strongly_connected_component_from'
from /home/diaspora/diaspora-2017-07-07-newest/vendor/bundle/ruby/2.4.0/gems/railties-5.1.6.2/lib/rails/initializable.rb:48:in `each'
from /home/diaspora/diaspora-2017-07-07-newest/vendor/bundle/ruby/2.4.0/gems/railties-5.1.6.2/lib/rails/initializable.rb:48:in `tsort_each_child'
from /usr/lib/ruby/2.4.0/tsort.rb:415:in `call'
from /usr/lib/ruby/2.4.0/tsort.rb:415:in `each_strongly_connected_component_from'
from /usr/lib/ruby/2.4.0/tsort.rb:349:in `block in each_strongly_connected_component'
from /usr/lib/ruby/2.4.0/tsort.rb:347:in `each'
from /usr/lib/ruby/2.4.0/tsort.rb:347:in `call'
from /usr/lib/ruby/2.4.0/tsort.rb:347:in `each_strongly_connected_component'
from /usr/lib/ruby/2.4.0/tsort.rb:226:in `tsort_each'
from /usr/lib/ruby/2.4.0/tsort.rb:205:in `tsort_each'
from /home/diaspora/diaspora-2017-07-07-newest/vendor/bundle/ruby/2.4.0/gems/railties-5.1.6.2/lib/rails/initializable.rb:58:in `run_initializers'
from /home/diaspora/diaspora-2017-07-07-newest/vendor/bundle/ruby/2.4.0/gems/railties-5.1.6.2/lib/rails/application.rb:353:in `initialize!'
from /home/diaspora/diaspora-2017-07-07-newest/config/environment.rb:7:in `<top (required)>'
from config.ru:10:in `require'
from config.ru:10:in `block in <main>'
from /home/diaspora/diaspora-2017-07-07-newest/vendor/bundle/ruby/2.4.0/gems/rack-2.0.6/lib/rack/builder.rb:55:in `instance_eval'
from /home/diaspora/diaspora-2017-07-07-newest/vendor/bundle/ruby/2.4.0/gems/rack-2.0.6/lib/rack/builder.rb:55:in `initialize'
from config.ru:1:in `new'
from config.ru:1:in `<main>'
from /home/diaspora/diaspora-2017-07-07-newest/vendor/bundle/ruby/2.4.0/gems/unicorn-5.5.0/lib/unicorn.rb:54:in `eval'
from /home/diaspora/diaspora-2017-07-07-newest/vendor/bundle/ruby/2.4.0/gems/unicorn-5.5.0/lib/unicorn.rb:54:in `block in builder'
from /home/diaspora/diaspora-2017-07-07-newest/vendor/bundle/ruby/2.4.0/gems/unicorn-5.5.0/lib/unicorn/http_server.rb:794:in `build_app!'
from /home/diaspora/diaspora-2017-07-07-newest/vendor/bundle/ruby/2.4.0/gems/unicorn-5.5.0/lib/unicorn/http_server.rb:141:in `start'
from /home/diaspora/diaspora-2017-07-07-newest/vendor/bundle/ruby/2.4.0/gems/unicorn-5.5.0/bin/unicorn:128:in `<top (required)>'
from /home/diaspora/diaspora-2017-07-07-newest/vendor/bundle/ruby/2.4.0/bin/unicorn:23:in `load'
from /home/diaspora/diaspora-2017-07-07-newest/vendor/bundle/ruby/2.4.0/bin/unicorn:23:in `<main>'
and now it returns that also in production mode, after I executed it in development mode.
line 64 in
/home/diaspora/diaspora-2017-07-07-newest/config/environments/development.rb
is:
# Speed up asset serving
config.middleware.insert 0, TurboDevAssets
It shall run as it did with every working diaspora as it has worked on debian 8 when I used rvm in the home directory. (as I also tried that on the Gentoo machine)

I run this code "vagrant up" in Terminal and I get an error of 'No such file or directory' - how to fix this?

I'm trying to install Homestead on my terminal. I was in my home directory and ran the code "vagrant up" but I get an error. This was what I typed in:
MACs-MBP:Homestead MAC$ vagrant up
And this was the error:
/Users/MAC/web/Homestead/scripts/homestead.rb:118:in `read': No such file or directory # rb_sysopen - /Users/MAC/.ssh/id_rsa (Errno::ENOENT)
from /Users/MAC/web/Homestead/scripts/homestead.rb:118:in `block (2 levels) in configure'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/plugins/kernel_v2/config/vm_provisioner.rb:72:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/plugins/kernel_v2/config/vm_provisioner.rb:72:in `add_config'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/plugins/kernel_v2/config/vm.rb:338:in `provision'
from /Users/MAC/web/Homestead/scripts/homestead.rb:115:in `block in configure'
from /Users/MAC/web/Homestead/scripts/homestead.rb:114:in `each'
from /Users/MAC/web/Homestead/scripts/homestead.rb:114:in `configure'
from /Users/MAC/web/Homestead/Vagrantfile:35:in `block in <top (required)>'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/config/v2/loader.rb:37:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/config/v2/loader.rb:37:in `load'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/config/loader.rb:113:in `block (2 levels) in load'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/config/loader.rb:107:in `each'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/config/loader.rb:107:in `block in load'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/config/loader.rb:104:in `each'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/config/loader.rb:104:in `load'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/vagrantfile.rb:28:in `initialize'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/environment.rb:746:in `new'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/environment.rb:746:in `vagrantfile'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/environment.rb:492:in `host'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/environment.rb:214:in `block in action_runner'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/action/runner.rb:33:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/action/runner.rb:33:in `run'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/environment.rb:479:in `hook'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/environment.rb:728:in `unload'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/bin/vagrant:130:in `ensure in <main>'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/bin/vagrant:130:in `<main>'
How would I fix this? I am really confused. Thank you for all the help
The first line in your error message indicates that you need to generate an SSH key first.
In your terminal (but outside Homestead interface), type:
ssh-keygen -t rsa
When it asks for the directory to save your key, press Enter for default directory, which is where your Homestead is searching. When it asks for a passphrase, it's good to have one.
Then try vagrant up again.

Can't start rails server - "Failed to watch" error - Bash - Ubuntu - Windows 10

The problem is that the server will not start.
I have set up the following:
Windows 10 build 1607 (Anniversary edition)
Windows subsystem for Linux
GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu)
Ubuntu 14.04.5 LTS \n \l
Rails ver 5.0.0.1
Ruby ver 2.3.1 (using - rbenv)
MySQL 5.5.53
I am very new to Linux and Ruby / Rails so please forgive me if I use incorrect terminology.
After a few days of installing, configuring and debugging, I was able to get everything working (Linux shell, rails, ruby mysql etc.).
I began a tutorial at Lynda called "Ruby on Rails 5 Essential Training" and was able to do the following:
Create a new rails project called Simple CMS
Create MySQL databases for development and test
Create users in MySQL
** When it came time to start the web server (Puma via the 'rails server' command) I received pages of errors as shown. I've searched every stackoverflow, google, Microsoft and GitHub result that had anything to do with "Failed to watch" and the above noted configuration. There were no solutions and the latest result stated that it was not possible to run the server because of the way Windows works.
Before scrapping my installation I wanted to ask here if anyone had run across this and/or had a solution.
Thank you very much in advance for any help and for taking the time to read this.
Mike
Here is the error including the command I used to initiate it:(Sorry its huge)
mike#MIKES-PC:~/sites/simple_cms$ rails server
=> Booting Puma
=> Rails 5.0.0.1 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
Exiting
/home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rb-inotify-0.9.7/lib/rb-inotify/watcher.rb:74:in `initialize': Invalid argument - Failed to watch "/home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/locale": the given event mask contains no legal events; or fd is not an inotify file descriptor. (Errno::EINVAL)
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rb-inotify-0.9.7/lib/rb-inotify/notifier.rb:190:in `new'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rb-inotify-0.9.7/lib/rb-inotify/notifier.rb:190:in `watch'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rb-inotify-0.9.7/lib/rb-inotify/notifier.rb:204:in `watch'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/adapter/linux.rb:32:in `_configure'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/adapter/base.rb:45:in `block in configure'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/adapter/base.rb:40:in `each'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/adapter/base.rb:40:in `configure'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/adapter/base.rb:63:in `start'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/backend.rb:28:in `start'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/listener.rb:67:in `block in <class:Listener>'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/fsm.rb:120:in `instance_eval'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/fsm.rb:120:in `call'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/fsm.rb:91:in `transition_with_callbacks!'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/fsm.rb:57:in `transition' from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/listen-3.0.8/lib/listen/listener.rb:90:in `start' from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/evented_file_update_checker.rb:90:in `boot!'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/evented_file_update_checker.rb:61:in `initialize'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/i18n_railtie.rb:59:in `new'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/i18n_railtie.rb:59:in `initialize_i18n'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/i18n_railtie.rb:15:in `block in <class:Railtie>'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/lazy_load_hooks.rb:44:in `each'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/application/finisher.rb:65:in `block in <module:Finisher>'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:30:in `instance_exec'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:30:in `run'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:347:in `each'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:347:in `call'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/initializable.rb:54:in `run_initializers'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/application.rb:352:in `initialize!'
from /home/mike/sites/simple_cms/config/environment.rb:5:in `<top (required)>'
from /home/mike/sites/simple_cms/config.ru:3:in `require_relative'
from /home/mike/sites/simple_cms/config.ru:3:in `block in <main>'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:55:in `instance_eval'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:55:in `initialize' from /home/mike/sites/simple_cms/config.ru:in `new'
from /home/mike/sites/simple_cms/config.ru:in `<main>'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:49:in `eval'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:49:in `new_from_string'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:40:in `parse_file' from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/server.rb:318:in `build_app_and_options_from_config'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/server.rb:218:in `app'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/server.rb:59:in `app'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/server.rb:353:in `wrapped_app'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/server.rb:124:in `log_to_stdout'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/server.rb:77:in `start'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:90:in `block in server'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:85:in `tap'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:85:in `server'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands.rb:18:in `<top (required)>'
from /home/mike/sites/simple_cms/bin/rails:9:in `require'
from /home/mike/sites/simple_cms/bin/rails:9:in `<top (required)>'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-2.0.0/lib/spring/client/rails.rb:28:in `load'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-2.0.0/lib/spring/client/rails.rb:28:in `call'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-2.0.0/lib/spring/client/command.rb:7:in `call'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-2.0.0/lib/spring/client.rb:30:in `run'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-2.0.0/bin/spring:49:in `<top (required)>'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-2.0.0/lib/spring/binstub.rb:31:in `load'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-2.0.0/lib/spring/binstub.rb:31:in `<top (required)>'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /home/mike/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /home/mike/sites/simple_cms/bin/spring:14:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
Found a solution in #jwsloan's comment on this Github issue:
When creating a new rails app, use --skip-listen to avoid problems with inotify, like so:
rails new myproject --skip-listen
That should allow the server to start - worked for me! :)

Error Upgrading GitLab 6.1 to 6.3 [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I want to update Gitlab (6.1 to 6.3) but after the Checkout this happens.
I update the database with the command:
ruby bin/rake db:migrate RAILS_ENV=production
I need to know how to troubleshoot:
Can't connect to local MySQL server through socket '/home/gitlab/mysql/tmp/mysql.sock' (2)
Systeminfo:
Ubuntu 12.10 64
LTS Ruby 2.0,
GitLab 6.1
The full output:
root#j72177:/home/gitlab/apps/gitlab/htdocs# ruby bin/rake db:migrate RAILS_ENV=production
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /home/gitlab/apps/gitlab/htdocs/Rakefile:7)
rake aborted!
Can't connect to local MySQL server through socket '/home/gitlab/mysql/tmp/mysql.sock' (2)
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `connect'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `initialize'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `new'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `mysql2_connection'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:315:in `new_connection'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:325:in `checkout_new_connection'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:247:in `block (2 levels) in checkout'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `loop'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `block in checkout'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:239:in `checkout'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:102:in `block in connection'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:101:in `connection'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:410:in `retrieve_connection'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_specification.rb:171:in `retrieve_connection'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_specification.rb:145:in `connection'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.15/lib/active_record/model_schema.rb:224:in `table_exists?'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/acts-as-taggable-on-2.4.1/lib/acts_as_taggable_on/acts_as_taggable_on/cache.rb:5:in `included'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/acts-as-taggable-on-2.4.1/lib/acts_as_taggable_on/taggable.rb:98:in `include'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/acts-as-taggable-on-2.4.1/lib/acts_as_taggable_on/taggable.rb:98:in `taggable_on'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/acts-as-taggable-on-2.4.1/lib/acts_as_taggable_on/taggable.rb:39:in `acts_as_taggable_on'
/home/gitlab/apps/gitlab/htdocs/app/models/issue.rb:38:in `<class:Issue>'
/home/gitlab/apps/gitlab/htdocs/app/models/issue.rb:20:in `<top (required)>'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/backports-3.3.2/lib/backports/tools.rb:328:in `require'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/backports-3.3.2/lib/backports/tools.rb:328:in `require_with_backports'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:251:in `block in require'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:236:in `load_dependency'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:251:in `require'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:359:in `require_or_load'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:502:in `load_missing_constant'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:192:in `block in const_missing'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:190:in `each'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:190:in `const_missing'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:514:in `load_missing_constant'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:192:in `block in const_missing'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:190:in `each'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:190:in `const_missing'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:514:in `load_missing_constant'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:192:in `block in const_missing'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:190:in `each'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:190:in `const_missing'
/home/gitlab/apps/gitlab/htdocs/lib/api/notes.rb:6:in `<class:Notes>'
/home/gitlab/apps/gitlab/htdocs/lib/api/notes.rb:3:in `<module:API>'
/home/gitlab/apps/gitlab/htdocs/lib/api/notes.rb:1:in `<top (required)>'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/backports-3.3.2/lib/backports/tools.rb:328:in `require'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/backports-3.3.2/lib/backports/tools.rb:328:in `require_with_backports'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:251:in `block in require'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:236:in `load_dependency'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:251:in `require'
/home/gitlab/apps/gitlab/htdocs/lib/api/api.rb:1:in `block in <top (required)>'
/home/gitlab/apps/gitlab/htdocs/lib/api/api.rb:1:in `each'
/home/gitlab/apps/gitlab/htdocs/lib/api/api.rb:1:in `<top (required)>'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/backports-3.3.2/lib/backports/tools.rb:328:in `require'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/backports-3.3.2/lib/backports/tools.rb:328:in `require_with_backports'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:251:in `block in require'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:236:in `load_dependency'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:251:in `require'
/home/gitlab/apps/gitlab/htdocs/config/initializers/2_app.rb:13:in `block in <top (required)>'
/home/gitlab/apps/gitlab/htdocs/config/initializers/2_app.rb:13:in `each'
/home/gitlab/apps/gitlab/htdocs/config/initializers/2_app.rb:13:in `<top (required)>'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:245:in `load'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:245:in `block in load'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:236:in `load_dependency'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:245:in `load'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/engine.rb:593:in `block (2 levels) in <class:Engine>'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/engine.rb:592:in `each'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/engine.rb:592:in `block in <class:Engine>'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/initializable.rb:30:in `instance_exec'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/initializable.rb:30:in `run'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/initializable.rb:55:in `block in run_initializers'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/initializable.rb:54:in `each'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/initializable.rb:54:in `run_initializers'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/application.rb:136:in `initialize!'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/railtie/configurable.rb:30:in `method_missing'
/home/gitlab/apps/gitlab/htdocs/config/environment.rb:5:in `<top (required)>'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/backports-3.3.2/lib/backports/tools.rb:328:in `require'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/backports-3.3.2/lib/backports/tools.rb:328:in `require_with_backports'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:251:in `block in require'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:236:in `load_dependency'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:251:in `require'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/application.rb:103:in `require_environment!'
/home/gitlab/apps/gitlab/htdocs/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/application.rb:305:in `block (2 levels) in initialize_tasks'
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)
root#j72177:/home/gitlab/apps/gitlab/htdocs#
You can check "Can't connect to local MySQL server through socket '/path/to/mysql.sock'" for various common causes behind that error message.
That path is configured in your gitlab/config/database.yml.mysql file.
Mainly:
check that your mysql is running (mysqladmin -u root -p status)
check the access rights (sudo chmod -R 755 /home/gitlab/mysql/tmp/mysql)
check your /etc/mysql/my.cnf
check how/if you have installed mysql-server.
Also make sure you follow the migration process:
sudo -u git -H bundle install --without development test postgres --deployment
sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production

Resources