I'm new to Rails, and I'm learning it from The Ruby on Rails Tutorial.
The bundle install command shows this error when I use gem 'sqlite3' in Gemfile;
An error occurred while installing sqlite3 (1.4.2), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.4.2' --source 'https://rubygems.org/'`
succeeds before bundling.
In Gemfile:
sqlite3
I found a solution to this over here - https://medium.com/#declancronje/installing-and-troubleshooting-ruby-on-rails-sqlite3-windows-10-fix-87c8886d03b, that suggested that gem 'sqlite3' should be replaced with gem ‘sqlite3’, git: “https://github.com/larskanis/sqlite3-ruby", branch: “add-gemspec”. On running bundle install after upating Gemfile, all the required gems, including sqlite3, appear to have installed;
Bundle complete! 15 Gemfile dependencies, 70 gems now installed.
Use 'bundle info [gemname]' to see where a bundled gem is installed.
But on running the command sqlite3 --version, I still get the error message that says
'sqlite3' is not recognized as an internal or external command,
operable program or batch file.
I have also referred to various stackoverflow answers, but none of them seem to work. gem install sqlite3 is also not working.
Please help.
try it helped
sudo apt-get install libsqlite3-dev
Related
Trying to execute bundle
$ gem install pg -v '1.1.14' --source 'https://rubygems.org/'
Gem files will remain installed in /home/saishbhende24/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/pg-1.1.4 for inspection.
Results logged to /home/saishbhende24/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/extensions/x86_64-linux/2.6.0-static/pg-1.1.4/gem_make.out
An error occurred while installing pg (1.1.4), and Bundler cannot continue.
Make sure that gem install pg -v '1.1.4' --source 'https://rubygems.org/'succeeds before bundling.
In Gemfile:
pg
saishbhende24#DESKTOP-ELUO53H:/mnt/c/saishrails/r5.1$ gem install pg -v '1.1.14' --source 'https://rubygems.org/'
ERROR: Could not find a valid gem 'pg' (= 1.1.14) in any repository
ERROR: Possible alternatives: pg
Output is rails server
Make sure you have installed postgres for Windows. There are official installers here. Then try again.
Then, if you still experience problems, try manually installing the pg gem first by:
bundle install pg
If you still have trouble you can also look at running rails, postgres, and all your other dependencies like the rest of your gems, redis, etc., on docker. Running ruby on Windows is a notoriously horrible experience. There's many things which aren't as easy as they are on Linux. Docker can solve a lot of those problems for you if you're still having trouble.
gem sources --add https://rubygems.org/
Fixed this issue.
To start I'm pretty new at rails which I'm sure this question will show. I was about to follow the steps on gorails.com to setup a local server. I also use codeanywhere for when I have internet access. When I try to install (rails new myapp) rails I keep getting the following error from my terminal command
extconf failed, exit code 1
Gem files will remain installed in
/var/folders/0d/yx9wdh954jjbn_pnn5nbm5540000gn/T/bundler20190310-64475-5t7xkksqlite3-1.4.0/gems/sqlite3-1.4.0
for inspection.
Results logged to
/var/folders/0d/yx9wdh954jjbn_pnn5nbm5540000gn/T/bundler20190310-64475-5t7xkksqlite3-1.4.0/extensions/universal-darwin-17/2.3.0/sqlite3-1.4.0/gem_make.out
An error occurred while installing sqlite3 (1.4.0), and Bundler cannot
continue.
Make sure that `gem install sqlite3 -v '1.4.0' --source 'https://rubygems.org/'`
succeeds before bundling.
In Gemfile:
sqlite3
run bundle exec spring binstub --all
Could not find gem 'uglifier (>= 1.3.0)' in any of the gem sources listed in your Gemfile.
Run `bundle install` to install missing gems."
Any Help on the matter would be greatly appreciated. Thanks in advance.
Please edit the file in your ruby rails project named Gemfile and change following
gem 'sqlite3'
to
gem 'sqlite3', '~> 1.3.11'
Now run following command to install Gem
bundle install
now run your rails project
rails s
I think you are missing sqlite3.
Run the command
sudo apt-get install -y sqlite3 libsqlite3-dev
Then modify gemfile to
gem 'sqlite3', '~> 1.3.11'
Then run
bundle install
In rails some packages needs to be installed in your local ,after which they can be included in your gemfile. The same applies for mysql and psql.
I'm trying to work on a project that uses the mysql2 gem, version 0.3.17 specifically.
I can get this to install by running:
gem install mysql2 -- --with-mysql-dir=C:\mysql\connector -v '0.3.17'
However after doing this (in the projects directory), and then run bundle install, it fails with the message
An error occurred while installing mysql2 (0.3.17), and Bundler cannot continue. Make sure that `gem install mysql2 -v '0.3.17'` succeeds before bundling.
Is there any way to run something like
bundle install -- --with-mysql-dir=C:\mysql\connector -v '0.3.17'
? I'm guessing I would need to specifiy the mysql2 gem in the command but I've looked on http://bundler.io/v1.3/man/bundle-install.1.html and can't seem to find anything.
My other option would be to simply point it to the gem I've already installed if that's possible.
Thanks in advance.
I git cloned a repo. I cannot run it on localhost with rails server because terminal says
Could not find activesupport-4.2.5 in any of the sources Run bundle
install to install missing gems.
When I run bundle install, I get
An error occurred while installing pg (0.18.4), and Bundler cannot
continue. Make sure that gem install pg -v '0.18.4' succeeds before
bundling.
I have rails 4.2.3, and the repo's Gemfile has gem 'rails', '4.2.5'. I don't know if this matter
Gem pg is Postgres driver, it only can be installed, if corresponding headers and libraries are present and can be accessed.
Most probably just installing postgres will fix it. If you're on a Mac with homebrew - brew install postgresql
Install postgresql.
Remove Gemfile.lock
Add gem 'pg' in your gemfile
execute bundle install
1: Remove Gemfile.lock if Gemgile.lock present in your project
2: add gem 'pg' # in Gemfile
3: Run bundle install
Hope this help you !!!
Run
sudo env ARCHFLAGS="-arch x86_64" gem install pg -v '1.18.4'
Now try running bundle install again.
I used a combination of #Chakreshwar Sharma and #Vinay's answers to get this working for the metasploit-framework.
Remove Gemfile.lock
Add gem 'pg' in your gemfile
Run apt-cache search postgresql-server-dev
apt-get update && apt-get install postgresql-server-dev-9.5 # Check your version
bundle install --no-deployment
To be honest, I think you could just run:
apt-cache search postgresql-server-dev
apt-cache search postgresql-server-dev-9.5
bundle install
...and you can avoid messing with the Gemfile, but I didn't get to verify it since mine started working after I made the adjustments.
I perform bundle install but it cannot continue because of sqlite3 it always returns to:
Gem::Package::FormatError: no metadata found in C:/RailsInstaller/Ruby1.9.3/lib/
ruby/gems/1.9.1/cache/sqlite3-1.3.4-x86-mingw32.gem
An error occured while installing sqlite3 (1.3.4), and Bundler cannot continue.
Make sure that gem install sqlite3 -v '1.3.4' succeeds before bundling.
How will I resolve this issue?
simply run gem install sqlite3 -v '1.3.4' this should fix the issue. Its because the gem is not included it the list of dependencies so running the command will fix it up