Error when running Jekyll command - ruby-on-rails

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.

Related

Can't debug test cases in ruby mine

I used to debug test cases in ruby mine for my rails test cases. Some time ago I updated my ruby mine and not sure what happened since then, I am not able to debug my test cases.
Attaching the screenshot of the error below:
What can be done here to rectify this?
Here is the same console output in plain text:
Testing started at 12:53 PM ...
bash -c "/Users/someUSER/.rvm/bin/rvm ruby-2.3.1 do /Users/someUSER/.rvm/rubies/ruby-2.3.1/bin/ruby /Users/someUSER/.rvm/gems/ruby-2.3.1#global/gems/ruby-debug-ide-0.7.0.beta6/bin/rdebug-ide --key-value --disable-int-handler --evaluation-timeout 10 --evaluation-control --time-limit 100 --memory-limit 0 --rubymine-protocol-extensions --port 49496 --host 0.0.0.0 --dispatcher-port 49497 -- /Users/someUSER/.rvm/gems/ruby-2.3.1/bin/rspec /Users/someUSER/RubymineProjects/Proj/spec/controllers/site/some_controller_spec.rb --require teamcity/spec/runner/formatter/teamcity/formatter --format Spec::Runner::Formatter::TeamcityFormatter --example \"Site::SomeController Some POST create new data \""
Fast Debugger (ruby-debug-ide 0.7.0.beta6, debase 0.2.2, file filtering is supported) listens on 0.0.0.0:49496
Uncaught exception: cannot load such file -- rspec/core/formatters/fallback_message_formatter
/Users/someUSER/.rvm/gems/ruby-2.3.1/gems/rspec-core-3.8.0/lib/rspec/core/formatters.rb:132:in `require'
/Users/someUSER/.rvm/gems/ruby-2.3.1/gems/rspec-core-3.8.0/lib/rspec/core/formatters.rb:132:in `setup_default'
/Users/someUSER/.rvm/gems/ruby-2.3.1/gems/rspec-core-3.8.0/lib/rspec/core/reporter.rb:47:in `block in prepare_default'
/Users/someUSER/.rvm/gems/ruby-2.3.1/gems/rspec-core-3.8.0/lib/rspec/core/reporter.rb:228:in `ensure_listeners_ready'
/Users/someUSER/.rvm/gems/ruby-2.3.1/gems/rspec-core-3.8.0/lib/rspec/core/reporter.rb:199:in `notify'
/Users/someUSER/.rvm/gems/ruby-2.3.1/gems/rspec-core-3.8.0/lib/rspec/core/reporter.rb:92:in `message'
/Users/someUSER/.rvm/gems/ruby-2.3.1/gems/rspec-core-3.8.0/lib/rspec/core/reporter.rb:161:in `notify_non_example_exception'
/Users/someUSER/.rvm/gems/ruby-2.3.1/gems/rspec-core-3.8.0/lib/rspec/core/configuration.rb:2037:in `rescue in load_file_handling_errors'
/Users/someUSER/.rvm/gems/ruby-2.3.1/gems/rspec-core-3.8.0/lib/rspec/core/configuration.rb:2034:in `load_file_handling_errors'
/Users/someUSER/.rvm/gems/ruby-2.3.1/gems/rspec-core-3.8.0/lib/rspec/core/configuration.rb:1560:in `block in load_spec_files'
/Users/someUSER/.rvm/gems/ruby-2.3.1/gems/rspec-core-3.8.0/lib/rspec/core/configuration.rb:1558:in `each'
/Users/someUSER/.rvm/gems/ruby-2.3.1/gems/rspec-core-3.8.0/lib/rspec/core/configuration.rb:1558:in `load_spec_files'
/Users/someUSER/.rvm/gems/ruby-2.3.1/gems/rspec-core-3.8.0/lib/rspec/core/runner.rb:98:in `setup'
/Users/someUSER/.rvm/gems/ruby-2.3.1/gems/rspec-core-3.8.0/lib/rspec/core/runner.rb:86:in `run'
/Users/someUSER/.rvm/gems/ruby-2.3.1/gems/rspec-core-3.8.0/lib/rspec/core/runner.rb:71:in `run'
/Users/someUSER/.rvm/gems/ruby-2.3.1/gems/rspec-core-3.8.0/lib/rspec/core/runner.rb:45:in `invoke'
/Users/someUSER/.rvm/gems/ruby-2.3.1/gems/rspec-core-3.8.0/exe/rspec:4:in `<top (required)>'
/Users/someUSER/.rvm/gems/ruby-2.3.1/bin/rspec:23:in `load'
/Users/someUSER/.rvm/gems/ruby-2.3.1/bin/rspec:23:in `<top (required)>'
/Users/someUSER/.rvm/gems/ruby-2.3.1#global/gems/ruby-debug-ide-0.7.0.beta6/bin/rdebug-ide:187:in `<main>'
Process finished with exit code 1
Empty test suite.
I think you are having problems to install the debug gem for RubyMine. I had the same issue and after taking a look at JetBrains web page seems like they are working to fix it on RubyMine 2018.3.3. Meantime, a workaround is to install the gems in a console.
Open the terminal inside RubyMine and run:
gem install debase -v 0.2.3.beta3 --no-document
gem install ruby-debug-ide -v 0.7.0.beta7 --no-document
The beta6 version of the ruby-debug-ide gem that you use is older than rspec 3.8. Maybe upgrading ruby-debug-ide to the latest beta7 version helps (or downgrading rspec to a version older than beta6).

rails console on openshift

I deployed my rails application to openshift it works well but I cannot run 'rails console' on production server. It gives me this error. How can I solve this? I tried to update rubygems but it also gives permission denied error and I couldn't make it too.
rails c error:
Warning: You're using Rubygems 1.8.24 with Spring. Upgrade to at least Rubygems 2.1.0 and run `gem pristine --all` for better startup performance.
/opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in `require': cannot load such file -- bundler/setup (LoadError)
from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
from /var/lib/openshift/5429e72a500446dfee000197/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/spring-1.1.3/lib/spring/commands.rb:33:in `<module:Spring>'
from /var/lib/openshift/5429e72a500446dfee000197/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/spring-1.1.3/lib/spring/commands.rb:4:in `<top (required)>'
from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
from /var/lib/openshift/5429e72a500446dfee000197/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/spring-1.1.3/lib/spring/application.rb:77:in `preload'
from /var/lib/openshift/5429e72a500446dfee000197/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/spring-1.1.3/lib/spring/application.rb:140:in `serve'
from /var/lib/openshift/5429e72a500446dfee000197/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/spring-1.1.3/lib/spring/application.rb:128:in `block in run'
from /var/lib/openshift/5429e72a500446dfee000197/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/spring-1.1.3/lib/spring/application.rb:122:in `loop'
from /var/lib/openshift/5429e72a500446dfee000197/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/spring-1.1.3/lib/spring/application.rb:122:in `run'
from /var/lib/openshift/5429e72a500446dfee000197/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/spring-1.1.3/lib/spring/application/boot.rb:18:in `<top (required)>'
from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
from -e:1:in `<main>'
rubygems-update error:
[appname.rhcloud.com repo]\> update_rubygems
ERROR: While executing gem ... (Errno::EACCES)
Permission denied - /opt/rh/ruby193/root/usr/local/share/ruby
I ran into the same issue, try running it like this:
RAILS_ENV=production bundle exec rails console
Also make sure you are running it in ~/app-root/repo when you run it
To update rubygems:
gem update --system
If that doesn't solve the problem try Spring's suggestion and run:
gem pristine --all
The problem is that there are multiple bundle executables and the system is using the wrong one.
Locate the correct bundle executable. In my case it was located at ~/.gem/bin/bundle.
If you can't find it, install it gem install bundler.
Then run ~/.gem/bin/bundle exec rails console production inside ~/app-root/repo
I couldn't get any of the gem install or bundle exec solutions to work while running the 4.1.4 Rails cartridge on OpenShift. My solution was running RAILS_ENV=production bin/rails c in app-root/repo.

Reset File Permissions for Jekyll

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?

Every Rails command fails epically

I recently ran into a problem and in desperation decided to uninstall and reinstall both Ruby and Rails on my OS X 10.6. I've reinstalled Ruby and gem installed rails. Now, though, I get this error or similar EVERY time I try to run a rails command (even -v):
rails -v
/Users/Dylan/.rvm/gems/ruby-1.9.3-p125#global/gems/bundler-1.1.5/lib/bundler/spec_set.rb:90:in `block in materialize': Could not find bcrypt-ruby-3.0.1 in any of the sources (Bundler::GemNotFound)
from /Users/Dylan/.rvm/gems/ruby-1.9.3-p125#global/gems/bundler-1.1.5/lib/bundler/spec_set.rb:83:in `map!'
from /Users/Dylan/.rvm/gems/ruby-1.9.3-p125#global/gems/bundler-1.1.5/lib/bundler/spec_set.rb:83:in `materialize'
from /Users/Dylan/.rvm/gems/ruby-1.9.3-p125#global/gems/bundler-1.1.5/lib/bundler/definition.rb:127:in `specs'
from /Users/Dylan/.rvm/gems/ruby-1.9.3-p1
25#global/gems/bundler-1.1.5/lib/bundler/environment.rb:27:in `specs'
from /Users/Dylan/.rvm/gems/ruby-1.9.3-p125#global/gems/rubygems-bundler-1.0.3/lib/rubygems-bundler/noexec.rb:41:in `candidate?'
from /Users/Dylan/.rvm/gems/ruby-1.9.3-p125#global/gems/rubygems-bundler-1.0.3/lib/rubygems-bundler/noexec.rb:60:in `setup'
from /Users/Dylan/.rvm/gems/ruby-1.9.3-p125#global/gems/rubygems-bundler-1.0.3/lib/rubygems-bundler/noexec.rb:75:in `<top (required)>'
from /Users/Dylan/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
from /Users/Dylan/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
from /Users/Dylan/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
from /Users/Dylan/.rvm/gems/ruby-1.9.3-p125/bin/ruby_noexec_wrapper:9:in `<main>'
ANy ideas on how to fix this?
It seems like you need to install bcrypt-ruby
Maybe try sudo gem install bcrypt-ruby?
Run bundle install then run bundle exec rails -v see if this clears the issue.

cap deploy:setup bash: /usr/bin/cap: No such file or directory

I am getting this error
cap deploy:setup
bash: /usr/bin/cap: No such file or directory
gem list:--
capistrano (2.5.19)
capistrano-ext (1.2.1)
Previously i was getting an issue like:--
cap deploy:setup
/usr/lib/ruby/1.8/capistrano/configuration/loading.rb:152:in `require': no such file to load -- capistrano/ext/multistage (LoadError)
from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:152:in `require'
from ./config/deploy.rb:2:in `load'
from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:172:in `load_from_file'
from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:89:in `load'
from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:86:in `load'
from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:86:in `each'
from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:86:in `load'
from Capfile:3:in `load'
from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:172:in `load_from_file'
from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:89:in `load'
from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:86:in `load'
from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:86:in `each'
from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:86:in `load'
from /usr/lib/ruby/1.8/capistrano/cli/execute.rb:64:in `load_recipes'
from /usr/lib/ruby/1.8/capistrano/cli/execute.rb:64:in `each'
from /usr/lib/ruby/1.8/capistrano/cli/execute.rb:64:in `load_recipes'
from /usr/lib/ruby/1.8/capistrano/cli/execute.rb:30:in `execute!'
from /usr/lib/ruby/1.8/capistrano/cli/execute.rb:14:in `execute'
from /usr/bin/cap:4
So i did:--
sudo gem uninstall capistrano
sudo rm -rf /usr/bin/cap
sudo gem install capistrano-ext
sudo gem install capistrano
so i m getting the eror i specified earlier:--
cap deploy:setup
bash: /usr/bin/cap: No such file or directory
How can fix this issue. I am not able to find this using google etc.
If you are using bundler, try executing in the bundle context:
bundle exec cap deploy:setup
remove both the gems and install it again..
I'm going to guess that ls -l /usr/bin/cap actually shows a small file there.
Capistrano is written in Ruby and the first line of the file will be a shebang that probably references the Ruby interpreter with an absolute path name.
Type head -1 cap or cat cap and see if the Ruby interpreter is really located where the cap script thinks it is. If not, you can install a gem on top of itself, so just install capistrano again.

Resources