Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialtjgrist
6,553 PointsHow do you relaunch and preview a rails app e.g. 'myproject' from terminal after closing it?
I'm working with rails on OSX, and after having built a basic website app called 'myproject', I can't seem to open the app again in Terminal so that I can get a link to "localhost:3000" again and preview my site.
When I open terminal and navigate to myproject "cd myproject" and then say "rails s", the terminal spits out a bunch of Usage guidelines.
What am I doing wrong? I just want to be able to launch my app project 'myproject' again so I can continue working on it.
tjgrist
6,553 PointsActually it's giving me this:
It seems like it's trying to tell me to do something in particular.
TJs-MacBook-Pro:~ tjgrist$ cd myproject
TJs-MacBook-Pro:myproject tjgrist$ rails s
/Users/tjgrist/.rvm/gems/ruby-2.2.1/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:78:in require': /Users/tjgrist/myproject/config/application.rb:27: can't find string "Rails" anywhere before EOF (SyntaxError)
/Users/tjgrist/myproject/config/application.rb:11: syntax error, unexpected end-of-input
config.assets.paths <<Rails.root.join("app","assets","fonts")
^
from /Users/tjgrist/.rvm/gems/ruby-2.2.1/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:78:in
block in server'
from /Users/tjgrist/.rvm/gems/ruby-2.2.1/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:75:in tap'
from /Users/tjgrist/.rvm/gems/ruby-2.2.1/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:75:in
server'
from /Users/tjgrist/.rvm/gems/ruby-2.2.1/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:39:in run_command!'
from /Users/tjgrist/.rvm/gems/ruby-2.2.1/gems/railties-4.2.6/lib/rails/commands.rb:17:in
<top (required)>'
from /Users/tjgrist/myproject/bin/rails:9:in require'
from /Users/tjgrist/myproject/bin/rails:9:in
<top (required)>'
from /Users/tjgrist/.rvm/gems/ruby-2.2.1/gems/spring-1.6.4/lib/spring/client/rails.rb:28:in `load'
Tyler Taylor
17,939 PointsOof, that is hard to read! :P
It's telling you there's an unexpected end-of-input in application.rb:11
which means there's a typo/mistake around line 11 of application.rb. I'm new to this also so I may not be that helpful, especially without seeing that application.rb file.
3 Answers
Tyler Taylor
17,939 PointsYeah you're probably just looking for a missing or extra 'end' somewhere. Hope this helps!
tjgrist
6,553 PointsOk, I think that's helpful. I'll check out the syntax in that file and see if that works.
tjgrist
6,553 PointsThanks Tyler, that worked -- I had just added a bad bit of code on line 11 that needed to be taken out.
Tyler Taylor
17,939 PointsTyler Taylor
17,939 PointsWhat are the usage guidelines it's giving you?