tiny_tds gem installation issue on Rails 5 - ruby-on-rails

I have tried to install gem tiny_tds on Rails 5, but not able to install. I have googled it and tried all the solution. But there is no solution. Can you please suggest me to install it.
Below are the solutions I have tried,
Rails 4: Error when installing tiny_tds gem?
sudo apt-get install freetds-dev

tiny_tds gem can be easily installed from terminal using following command:
$ gem install tiny_tds
If any other issue you are facing with tiny_tds gem you can refer the documentation of gem:
https://github.com/rails-sqlserver/tiny_tds

Make sure you have freetds library installed in case of MacOS
brew install freetds

Debian 10
Rails: 5.2
Ruby 2.5
How to Install FreeTDS:
source: https://www.microsoft.com/en-us/sql-server/developer-get-started/ruby/ubuntu/
Use the Terminal with Root or Sudo permissions to run the following commands:
wget ftp://ftp.freetds.org/pub/freetds/stable/freetds-1.00.27.tar.gz
tar -xzf freetds-1.00.27.tar.gz
cd freetds-1.00.27
./configure --prefix=/usr/local --with-tdsver=7.3
make
sudo make install
cd ..
gem install tiny_tds
This should get you started.

Related

Rails - Gem Error while installing pg (1.1.3), and Bundler cannot continue

I am still fairly new to Rails. I am trying to push to Heroku and I am getting errors.
The first error is when I run a Bundle Install I get this error message:
"An error occurred while installing pg (1.1.3), and Bundler cannot continue.
Make sure that gem install pg -v '1.1.3' succeeds before bundling."
I have tried to run this command
gem install pg -v '1.1.3'
But it fails and gives me this error message:
"ERROR: Error installing pg:
ERROR: Failed to build gem native extension."
Does anyone have a solution to this?
I had the exact same problem, and solved it by running sudo apt install postgresql-contrib libpq-dev. Then bundle worked just fine.
if you're using OSX, you could try running
brew install postgresql
and then installing the gem
TL;DR; If you installed the Postgres using the PostgresAPP instead of BREW then the problem might be that you don't have the postgres bin folder in the $APTH
The solution is to find the Posgres app installation folder an in it the /bin folder.
In my case if I run which postgres doesn't work which means I don't have it in my $PATH, so what I did is I navigated to: cd /Applications/Posgres.app then to Contents and then to Versions until I found the latest folder:
/Applications/Postgres.app/Contents/Versions/latest/bin
Now, with this I can install the PG GEM by providing the path to the bin folder of my Postgres app installation
Finally, in the terminal in the root of my Rails project I ran where I provide the postgres config file path to the GEM installer:
gem install pg -v '1.2.3' -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/latest/bin/pg_config
I encountered the same problem. I am using Ubuntu. I installed Postgres using this Ubuntu guide. After installing Postgres, I ran this code sudo apt install postgresql-contrib libpq-dev then bundle install.
The accepted answer is not correct. If you installed postgresql-contrib and libpq-dev as mentioned in Cesar Faria answer, and you still getting the same error, most probable you missed the list of packages which are considered essential for building Debian packages. All that packages included in build-essential package. So, all you need to do to get rid of the error is the command below.
sudo apt install libpq-dev build-essential
try instaling with pg-config like this:
gem install pg -v 1.1.3 -- --with-pg-config=/usr/pgsql-9.X/bin/pg_config.
In pg-config path mention the posgtres version installed in you're system.
Postgresql needs to be in local in order to install gem pg. Try this
brew install postgresql
and the re-install bundle
bundle install
or
If you are using yum. Try this
sudo yum install postgresql-devel
The following is only for your local environment:
Note: Update the command below to match your version postgresql/13.2/...
> brew install postgres
> sudo gem install pg -v '1.1.4' --source 'https://rubygems.org/' -- --with-pg-config=/usr/local/Cellar/postgresql/13.2/bin/pg_config
Also, make sure to start your server > pg_ctl -D /usr/local/var/postgres start

Mysql2 gem installation issue on ubuntu with ruby on rails

I am unable to install mysql2 gem .
I have recently installed ruby 2 and rails 4 version .
I am not able to install mysql2 gem, getting the below error when i run the command gem install mysql2:
Some index files failed to download. They have been ignored, or old ones used instead.
Make sure that the following packages are installed first
sudo apt-get install mysql-client mysql-server libmysqlclient-dev
You may need to run
sudo apt-get update
before installing them
You should provide more information. But here some thoughts:
Why are you using gem install mysql2 instead of adding the gem to your Gemfile and run bundle?
I had some issues with Rails 4 and mysql2 v0.4.x and downgraded to v0.3.20

Installing rails. Gem install rails stucks (for real!), and curl stucks

:)
I am trying to install ruby on rails on VirtualBox. I started with Fedora... without success, now I am giving Ubuntu a try, and still some problems occur. I wrote:
$ gem install rails
$ gem -V install rails
$ gem update --system
I waited... but nothing happend. Then i tried diffrent approach and I wanted to install RVM... but then
$ curl -L get.rvm.io | bash -s stable --ruby
stucked... It downloaded 1 file... and that was it.
Any hint?
oh... to install ruby on rails i followed this way:
$ sudo apt-get install ruby1.9.1
$ wget http://production.cf.rubygems.org/rubygems/rubygems-1.8.24.tgz
$ tar zxvf rubygems-1.8.24.tgz
$ cd rubygems-1.8.24
$ sudo ruby setup.rb
$ sudo apt-get install ruby1.9.1-dev
$ gem install rails
And I can't go any further than this...
Try using rbenv instead of rvm, bit simpler for a start.
rbenv + ruby-build is a must ;)
rbenv install ruby
gem install bundler
gem install rails
Maybe your OS has already a ruby installed and its interfering...
try :
which ruby
to find out.
Can't tell you more without nknowing more. :s
Good luck !

problem in installing rails

hi all i am getting problem while installing rails in by gem :
i have written in terminal
gem install rails
Successfully installed rails-3.0.3
1 gem installed
Installing ri documentation for rails-3.0.3...
File not found: lib
what i need to do next and how to install rails using gem.
I had the same problem. I continued with the error. I do not see anything breaking. And I can code peacefully. So, probably you do not need to worry.
sudo apt-get install build-essential libopenssl-ruby libfcgi-dev
sudo apt-get install ruby irb rubygems ruby1.8-dev
sudo apt-get install sqlite3 libsqlite3-dev
sudo gem install rails
sudo gem install sqlite3-ruby
If you dont find path do this: (for Unix based systems)
Quoted from the book, but anyone else would suggest the same
If you can’t find the rails command, you may need to add
/var/lib/gems/1.8/bin to your PATH environment variable.
You can do this by adding a line to your .bashrc file:
export PATH=/var/lib/gems/1.8/bin:$PATH
OK as aditya sanghi has mentioned, I do lack rdoc gem-- so probably running this will help
gem install rdoc rails
I've seen this error when you dont have the "rdoc" gem installed. Can you do a "gem list" and show us a list of gems installed?
Try running "gem install rdoc rails".

Installing Rails ERROR: could not find rails locally or in a repository

I've been poking around the internet looking for a solution on this one... with no luck..
I'm new to rails... If anyone has an idea, I'd love to hear it. Much appreciated!
I enter:
LW:src liamwright$ sudo gem install rails --include-dependencies
And Get:
INFO: `gem install -y` is now default and will be removed
INFO: use --ignore-dependencies to install only the gems you list
Bulk updating Gem source index for: http://gems.rubyforge.org
ERROR: could not find rails locally or in a repository
I am running:
ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0]
Mac OS X 10.5.8
I also tried:
gem sources -r gems.rubyonrails.org
And Get:
source gems.rubyonrails.org not present in cache
Just to check...
...try doing a sudo gem update --system before installing Rails to make sure you have the latest RubyGems installed?
EDIT: Actually, if your RubyGems install is really old, you might need to follow the alternate directions on Gemcutter.
Might want to make sure you have the newest rubygems:
sudo gem install rubygems-update
sudo gem update --system
Then:
sudo gem install rails
I came across this solution on Albertux' blox. Running this script will fix it (It worked perfectly for me on an Ubuntu 9.10 machine):
#!/bin/bash
#(download the latest on http://rubyforge.org/frs/?group_id=126)
wget http://rubyforge.org/frs/download.php/43984/rubygems-update-1.3.0.gem
sudo gem install rubygems-update-1.3.0.gem
sudo update_rubygems
# now this work:
sudo gem update --system
echo "done."
I've just had the same problem trying to upgrade rubygems from 1.2.0 to 1.3.7.
Setp-1)
So I just downloaded rubygems-update-1.3.7.gem from http://rubyforge.org/frs/?group_id=126
Setp-2)
gem install rubygems-update-1.3.7.gem
Setp-3)
update_rubygems
and it work for me.

Resources