I am installing mysql gem for my application but i have an error
please any one tell me how can i install MySQL gem
gem install mysql2 -v '0.3.11'. Its a generic error.
Related
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
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'
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 am using Windows 7 and creating connection to MySQL2. I need to install gem. I am following these steps. Could someone please review them:
Add the following to the Gemfile: gem 'mysql2', '~> 0.3.15'
Run the following in cmd: gem install mysql2 -v '0.3.15'
Go to the application using cmd and run this code: bundle install
When I perform step (3), I get the following error:
An error occurred while installing mysql2 (0.3.15), and bundler cannot
continue make sure that `gem install mysql2 -v "0.3.15" ' succeeds
before bundling..
My application resides on the D drive and I am using Windows 7.
I have found a solution that works on Ubuntu.
My mistake was that had not installed the my-sql library before trying to connect.
Please follow these steps to do this. Run the following commands:
sudo apt-get install mysql-client libmysqlclient-dev
sudo gem install mysql2
Add the following to the gemfile
gem 'mysql2', '~> 0.3.15'
And then run:
bundle install
I want to use MySQL in ROR.
I add gem in my Gem file.
gem mysql2
and then I run a command
gem install mysql2
It gives me following error
"could not find a valid gem '0.3.13' <> =0> in any repository"
Please anybody tell me how can i use MySQL for ROR application
Thanks
I think your syntax in your Gemfile is missing quote marks:
gem 'mysql'
and then your commandline call to install it should instead be:
bundle install