user1881983
user1881983

Reputation: 115

Rails from directory of application doesn't work

I have installed rails. Once installed I create a application with

$ rails new my_app

and I ran the rail server from the directory of the application.

~/rails_projects/my_app$ rails server

The problem is that after exiting the application when I go to that directory later I can't run the server this second time.

~/rails_projects/my_app$ rails server

Could not find gem 'spring (>= 0) ruby' in the gems available on this machine.
Run `bundle install` to install missing gems.

It doesn't show any Rails version from that directory but yes from the home directory:

~$ rails -v
Rails 4.1.1

~/rails_projects/my_app$ rails -v

Could not find gem 'spring (>= 0) ruby' in the gems available on this machine.
Run `bundle install` to install missing gems

Upvotes: 0

Views: 283

Answers (1)

Paulo Fidalgo
Paulo Fidalgo

Reputation: 22296

It seams you are starting with Rails. Please follow the official guide to get an inside of the framework.

To get started you need to create a project:

$ rails new my_app

then go the project directory:

$ cd my_app

install dependencies (if you add any to your Gemfile):

$ bundle install

and then run the server

$ rails server

Again, if you are starting follow that guide!

Upvotes: 1

Related Questions