As the title says, if you add a Gem, you get the error message There was an error parsing Gemfile
Described in Gemfile to put faker in development environment and test environment.
group :development, :test do
**gem 'faker'**← Add this
end
And even though I try bundle install,
bundle install
I get an error in the title.
[!] There was an error parsing `Gemfile`: You cannot specify the same gem twice with different version requirements.
You specified: faker (>= 0) and faker (= 2.1.2). Bundler cannot continue.
# from /Users/XXXX/XXXX/XXXX/Gemfile:88
# -------------------------------------------
# gem 'dotenv-rails'
> gem 'faker', '2.1.2'
# gem 'carrierwave'
# -------------------------------------------
When I read the error statement,
An error occurred in parsing Gemfile`. You cannot specify the same gem twice with different version requirements. You specified faker (> = 0) and faker (= 2.1.2), so Bundler cannot continue.
It seems that faker is already included because it is said. As a matter of fact, there was already a description of faker at the bottom of the Gemfile.
gem 'faker', '2.1.2'
As noted in the error statement I tried to specify the same gem twice with different version requirements. It's said exactly, and there's no gu sound.
The solution is that faker can be used in all environments including the test environment, so in this case it will be "do not add gemfile". It may be different from the solution, but you know the cause. that's all.