Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show error when rails path is not found #23

Open
sorbits opened this issue Dec 8, 2010 · 1 comment
Open

Show error when rails path is not found #23

sorbits opened this issue Dec 8, 2010 · 1 comment

Comments

@sorbits
Copy link
Contributor

sorbits commented Dec 8, 2010

When Support/lib/rails/rails_path.rb is unable to find the rails path, throw up an error dialog explaining this and possibly what the issue is, e.g.:

%x{ "$DIALOG" alert --alertStyle critical --title "This is not a Rails Project" --body "Your project directory “${TM_PROJECT_DIRECTORY//$HOME/~}” does not match the layout of a typical Rails project.\nIt must contain all of the following folders: app config db." }

We often receive error reports from users about the various “Go to …” functions in the Rails bundle. This seems to stem from not finding the rails root. The error manifest itself as a tool tip showing stack dumps like below:

/Applications/TextMate.app/Contents/SharedSupport/Bundles/Ruby on Rails.tmbundle/Support/lib/rails/rails_path.rb:294:in `join': can't convert nil into String (TypeError)
  from /Applications/TextMate.app/Contents/SharedSupport/Bundles/Ruby on Rails.tmbundle/Support/lib/rails/rails_path.rb:294:in `wants_haml'
  from /Applications/TextMate.app/Contents/SharedSupport/Bundles/Ruby on Rails.tmbundle/Support/lib/rails/rails_path.rb:307:in `stubs'
  from /Applications/TextMate.app/Contents/SharedSupport/Bundles/Ruby on Rails.tmbundle/Support/lib/rails/rails_path.rb:268:in `rails_path_for_view'
  from /Applications/TextMate.app/Contents/SharedSupport/Bundles/Ruby on Rails.tmbundle/Support/lib/rails/rails_path.rb:266:in `each'
  from /Applications/TextMate.app/Contents/SharedSupport/Bundles/Ruby on Rails.tmbundle/Support/lib/rails/rails_path.rb:266:in `rails_path_for_view'
  from /Applications/TextMate.app/Contents/SharedSupport/Bundles/Ruby on Rails.tmbundle/Support/lib/rails/rails_path.rb:244:in `rails_path_for'
  from /Applications/TextMate.app/Contents/SharedSupport/Bundles/Ruby on Rails.tmbundle/Support/lib/rails/command_go_to_file.rb:8:in `alternate'
  from /Applications/TextMate.app/Contents/SharedSupport/Bundles/Ruby on Rails.tmbundle/Support/bin/go_to_alternate_file.rb:13

This leads the user to think the rails bundle and/or TextMate is broken, but as he may have had it working with a previous project, the first troubleshooting steps seems to be re-installing the bundle, TextMate, zapping preferences, a.s.o.

@miaoling
Copy link

I've just fixed this error. In my case, the exception above was thrown because the mother directory of the files I had in my drawer wasn't open (i.e. I had app/, config/, etc open but not the Rails app folder itself), which apparently caused rails_root to not be set. When I opened the mother directory, the go-to navigation works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants