I'm in my app folder, but the command
rails s is not working. I read through quite a few posts on Stack Overflow, and most of them seem to be from users who are not in their app directory.
In addition, I built a few other apps. I checked those, and the Rails server works for all of those apps. This is the only one where I can't get it to launch.
I'm working through Hartl's Rails Tutorial, and he makes quite a few modifications to the gemfile. I am wondering if this might be the cause?
source 'https://rubygems.org' gem 'rails', '3.2.13' group :development do gem 'sqlite3', '1.3.5' end # Gems used only for assets and not required # in production environments by default. group :assets do gem 'sass-rails', '3.2.5' gem 'coffee-rails', '3.2.2' gem 'uglifier', '1.2.3' end gem 'jquery-rails', '2.0.2' group :production do gem 'pg', '0.12.2' end
It seems to think you are not in a rails directory (your output is saying the only valid way to use rails is with
Depending on your version, Rails identifies this differently. On 3.2, it checks for a file at
script/rails. Now that 4.0 has been released, it looks for either
Presumably you can get around this by creating the file
rails in your
script directory (if you do not have a
script directory, create one in the root of your app):
#!/usr/bin/env ruby # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. APP_PATH = File.expand_path('../../config/application', __FILE__) require File.expand_path('../../config/boot', __FILE__) require 'rails/commands'
Of course, it's worth wondering why you don't have this file in the first place. Might be worth making sure your rails is the version you want to be using first (
rails -v if the version is newer, this post will show you how to create the new app using the older version).