Trying to install the factory_bot_rails gem, but running into this after executing bundle install:
There was an error parsing `Gemfile`: Undefined local variable or method `‘factory_bot_rails’' for Gemfile. Bundler cannot continue.
My rvm is up to date...what exactly is the problem?
Thanks in advance.
I think the problem is how the gem is wrote.
Just type on a console in the project's root directory:
gem install factory_bot_rails
or put inside your Gem file
group :development, :test do
gem 'factory_bot_rails'
end
After type:
bundle install
source: https://github.com/thoughtbot/factory_bot_rails enter link description here
Related
I need sqlite3 v1.3.9 gem installed for my app, so I add this line to the Gemfile:
gem 'sqlite3', '= 1.3.9'
However, when I run 'bundle install', it installs v1.4.2 of that gem.
I modified the above line to
gem 'sqlite3', '= 1.3.9', '< 1.4'
No joy -- sqlite v1.4.2 is installed (even if I remove any reference to 'sqlite3' from the Gemfile completely).
My Gemfile was created when I used rails new appname, so it is not fancy at all... I only added gem devise to it.
Gemfile.lock doesn't contain any reference to sqlite3. I removed it anyway and it didn't help.
As another option, I installed v1.3.9 via gem install sqlite3 -v 1.3.9 and I removed v1.4.2 with
# bundle exec gem uninstal sqlite3
Select gem to uninstall:
1. sqlite3-1.3.9
2. sqlite3-1.4.2
3. All versions
> 2
Successfully uninstalled sqlite3-1.4.2
...but as soon as I tried to add v1.3.9, I got:
# bundle add sqlite3 -v 1.3.9
[!] There was an error parsing `injected gems`: You cannot specify the same gem twice with different version requirements.
You specified: sqlite3 (~> 1.4) and sqlite3 (= 1.3.9). Bundler cannot continue.
# from injected gems:1
# -------------------------------------------
> gem "sqlite3", "= 1.3.9"
# -------------------------------------------
I'd grateful for any hints on why v1.4.2 keeps being installed and, most importantly, how do get the bundler forget about v1.4.2 and accept v1.3.9?
Thanks a lot!
There might be some gem in your app that requires sqlite3-1.4.2 and that is causing an issue with installing sqlite3-1.3.9. You should check your Gemfile.lock and look for any gem that is adding sqlite3-1.4.2 as a dependency.
There should be a gem in your app that requires sqlite3-1.4.2 and that is causing an issue with installing sqlite3-1.3.9. You should check your Gemfile.lock and look for any gem that is adding sqlite3-1.4.2 as a dependency.
when I tried to start Server with command rails -s that throw an error:
Could not find gem 'therubyracer x86-mingw32' in any of the gem sources listed i
n your Gemfile.
Run bundle install to install missing gems.
I also try with
gem install
gem update ...
but no effect
my gem file:
gem 'therubyracer', group: :production
I don't know why that can not run! but run with another project is OK.
how can I resolve this?
You can run bundle install --without production to skip that gem being installed for development.
Hi I'm doing Rails app and when I bundle install it returns an error:
Could not find coffee-script-source-1.1.3 in any of the sources
I know that coffee-script-source-1.1.3 gem is deprecated/yanked but my other gems are having dependencies with this.
But this project is working with other machine and in heroku production.
How can I successfully bundle install this without changing my gemfile?
Thanks
Run this:
bundle update --source coffee-script-source
If you get an error, like this:
An error occurred while installing rmagick (2.13.1), and Bundler cannot continue.
Run this:
gem install rmagick
I hope it'll help you.
What it worked for me was to update the gem to 1.2.0.
As it shows here https://rubygems.org/gems/coffee-script-source/versions
1.1.3 says that it's yanked.
gem 'coffee-script-source', '~> 1.2.0'
And run
bundle update --source coffee-script-source
I have referred to several different sources in order to try to push Heroku..
the error code I'm getting is:
An error occurred while installing sqlite3 (1.3.7), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.7'` succeeds before bundling.
Failed to install gems via Bundler.
Heroku push rejected, failed to compile Ruby/rails app
I've tried several Gemfile configurations but this is what I currently have:
group :production, :staging do
gem "pg"
end
group :development, :test do
gem "sqlite3-ruby", "~> 1.3.0", :require => "sqlite3"
end
I've also tried different bundles after.. bundle, bundle install, bundle install --without development
I keep getting the same error.
Please help
Thank you
ps: Please note, I'm new with a lot of this.. So please be as specific as possible.
Thanks again
try (on fedora) or equivalent, and then either install this gem alone or restart the bundle.
yum install sqlite-devel
When I try to run the
bundle install --without production
command on Ubuntu 12.04, I get an error message like this:
Could not find gem 'pg0.12.2 (>= 0) ruby' in the gems available on this machine
Any ideas about why this is happening?
Thanks
If you want 0.12.2 gem to be installed please write in the following way.
gem 'pg', '0.12.2'
If you want version which is greater than 0.12.2 then write in following way
gem 'pg' , '>= 0.12.2'
Please use this link to know more about how to bundle gems in rails Bundle