Rails server issue - ruby-on-rails

It's my first time to use ruby on rails I installed rails from this link http://railsinstaller.org/en
I created my first project but I facing troubles when trying to run rails server, first, it requires to run
bundle install
After running bundle install
I see several issues in the command line
To see why this extension failed to compile, please check the mkmf.log which can
be found here:
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/extensions/x86-mingw32/2.3.0/sqlite3-1.4.2/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/sqlite3-1.4.2 for
inspection.
Results logged to
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/extensions/x86-mingw32/2.3.0/sqlite3-1.4.2/gem_make.out
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
So how I can fix these pleas?

In your Gemfile try lowering the version of sqlite you're using.
gem 'sqlite3', '~>1.3.13'
Looking at https://rubygems.org/gems/sqlite3/versions/1.3.13-x86-mingw23 , 1.3.13 seems to be the latest supported version with mingw23.

Related

An error occurred while installing pg (1.1.4), and Bundler cannot continue

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.

Can't install bundle versions properly

I haven't used Rails since a year ago and I'm very rusty with the process. I've tried cloning it locally, then running bundle install. This is where I run into a suite of errors.
Then I get this error:
An error occurred while installing gemname (version), and Bundler cannot
continue.
Make sure that `gem install gemname -v 'version'` succeeds before bundling.
The surveyor gem last & latest version is 1.4.0 therefore you are getting this error. Check your Gemfile and fix the version in it.
You can refer the gem available version here

Issue with SQLite gem when installing Ruby on Rails

Error installing sqlite3, failed to build native gem extension.
Running on Windows 10.
Following a codeacademy tutorial, I successfully installed Ruby on Rails (ruby version : 2.3.3p222 (2016-11-21 revision 56859) [i386-mingw32) (rails version : 5.1.7). Running 'bundle install' popped up with an error saying I needed to download SQlite.
No problem, I go to the SQLite website and download sqlite3. Re-running 'bundle install', I get an error saying :
'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.'
Following the suggestion, I run this command and get the following error:
'sqlite3.h is missing. Install SQLite3 from http://www.sqlite.org/ first. Could not create Makefile..'
I have download sqlite3 from the website, there is no sqlite3.h file in the folders. My google and SO searches have been fruitless.
Can you try the steps here:
https://medium.com/#declancronje/installing-and-troubleshooting-ruby-on-rails-sqlite3-windows-10-fix-87c8886d03b
Github thread - https://github.com/sparklemotion/sqlite3-ruby/issues/224#issuecomment-482612096
Go to Gemfile and replace gem'sqlite3' to gem 'sqlite3', '< 1.4'

Failed to build gem native extension. in ubuntu

I download redmine in github
And open the application
After give bundle install
An error occurred while installing rmagick (2.16.0), and Bundler
cannot continue. Make sure that gem install rmagick -v '2.16.0'
succeeds before bundling.
To see why this extension failed to compile, please check the mkmf.log
which can be found here:
/home/supranimbus12/.rvm/gems/ruby-2.3.0#global/extensions/x86_64-linux/2.3.0/rmagick-2.16.0/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in
/home/supranimbus12/.rvm/gems/ruby-2.3.0#global/gems/rmagick-2.16.0
for inspection. Results logged to
/home/supranimbus12/.rvm/gems/ruby-2.3.0#global/extensions/x86_64-linux/2.3.0/rmagick-2.16.0/gem_make.out
An error occurred while installing rmagick (2.16.0), and Bundler
cannot continue. Make sure that gem install rmagick -v '2.16.0'
succeeds before bundling.
In Gemfile: rmagick
Please make sure you install Imagemagick first. If you are using ubuntu, then you can use apt-get to install Imagemagick. Also maybe you need to install libmagickwand-dev.

Running bundle install with modifier on certain gem

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.

Resources