Raisen
Raisen

Reputation: 4495

railis new failing on Ubuntu

When I run rails new [application] on Ubuntu 13.10, I get the following error:

Resolving dependencies...
Could not find gem 'coffee-rails (~> 3.2.1) ruby' in the gems available on this machine.

It looks like I have this gem installed though:

$ gem list | grep coffee-rails
coffee-rails (4.0.1)

Any ideas on what's going on?

Upvotes: 1

Views: 404

Answers (2)

Marco Poli
Marco Poli

Reputation: 533

According to the Bundler page:

The specifier ~> has a special meaning, best shown by example. ~> 2.0.3 is identical to >= 2.0.3 and < 2.1. ~> 2.1 is identical to >= 2.1 and < 3.0. ~> 2.2.beta will match prerelease versions like 2.2.beta.12.

As such, version 4.0.1 of your gem is still not the specified one, that is between 3.2.1 and <3.3.

Just run

bundle install

Or, if you were unable to get a project directory with a valid Gemfile:

gem install coffee-rails --version 3.2.1

And it should install a compatible version.

Upvotes: 5

Raisen
Raisen

Reputation: 4495

I figured it out. After I got that error, I just went ahead and ran bundle install on the newly created app folder. It installed the missing dependencies and rails new is working now.

Upvotes: 2

Related Questions