Search code examples
ruby-on-railsrbenv

Rails environment broke- need help repairing


ugh! In the course of working in my perfectly good rails environment, I did something bad:

  • While running my local sandbox, looking in Chrome developer tools/sources (this is for our own codebase), I clicked an item in the sources list and doing so prompted downloading a file: Roboto-Regular-e60d1ba1cef90e4a4da5c9e2fe1ec3b1.woff2
  • I got a "threat detected" popup
  • I submitted the screen I was on, and saw an error to the effect of 'no data', and rails server had stopped

Now I'm having the following symptoms:

  • Typing "rails server" (or even just "rails") gives me a "No such file or directory" error for /usr/local/Cellar/rbenv/1.1.1/libexec/rbenv.
  • the following script (with no modifications since its original create date last year) has the line looking for that file : /.rbenv/shims/rails
  • in the directory in question (libexec), I don't see a plain "rbenv" file, only these with more specific names: rbenv---version, rbenv-help, rbenv-realpath.dylib, rbenv-version, rbenv-version-origin, rbenv-commands, rbenv-hooks, rbenv-root, rbenv-version-file, rbenv-versions, rbenv-completions, rbenv-init, rbenv-sh-rehash, rbenv-version-file-read, rbenv-whence, rbenv-exec, rbenv-local, rbenv-sh-shell, rbenv-version-file-write, rbenv-which rbenv-global, rbenv-prefix, rbenv-shims, rbenv-version-name

I've just used homebrew to upgrade rbenv, but the symptom is still the same.

My $PATH variable has:

-bash: /Users/drkaplan/.rvm/gems/ruby-2.2.2/bin:/Users/drkaplan/.rvm/gems/ruby-2.2.2@global/bin:/Users/drkaplan/.rvm/rubies/ruby-2.2.2/bin:/Users/drkaplan/.rvm/bin:/Users/drkaplan/.nvm/versions/node/v6.11.2/bin:/Users/drkaplan/google-cloud-sdk/bin:/Users/drkaplan/.rbenv/shims:/Users/drkaplan/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin:/Applications/Postgres.app/Contents/Versions/latest/bin: No such file or directory

Ideas for where to look next?


Solution

  • The solution in this case was to reinstall rails:

    gem install rails