Problem during SQLite3 installation on Windows XP - ruby-on-rails

As shown in a blog I followed the instructions of setting up SQLite3 on my Windows, but after I pasted the necessary files in Bin folder of Ruby, which I downloaded from http://www.sqlite.org/download.html, I get the following error when I use the following commmands:
C:\gem install sqlite3-ruby --version=1.2.3
ERROR: http://rubygems.org does not appear to be a repository
ERROR: Could not find a valid gem 'sqlite3-ruby' (= 1.2.3) in any repository
Please help me out with this problem and suggest me alternate methods for gem installing SQLite3.
Thanks.

Check that you have the latest version of rubygems: gem -v executed in a command prompt should return 1.3.7. If it does not, you have several options (also explained on rubygems.org):
gem update --system
or
gem install rubygems-update
update_rubygems
Secondly, if you have the correct version and you are on a network with a proxy, you have to tell gem to use that proxy.
There are two ways to do that. First, you could do
gem install sqlite3-ruby -p http://yourproxyserver:port`
or you could define an environment variable
set HTTP_PROXY=http://yourproxyserver:port
and then this setting is saved (and you do not have to specify it explicitly anymore).
Hope this helps.

Try doing this: gem install sqlite3-ruby --version=1.2.3 --source http://gemcutter.org
If that does not work head over to http://gemcutter.org and download the particular version of the gem file, go to the destination to where you copied it to in the command line and install it locally using gem install sqlite3-ruby -l

Related

ERROR: Could not find a valid gem 'LocalGem' (>= 0) in any repository

I've done a good search now and I haven't come across anything that quite relates.
I'm trying to install a local decimal to roman numeral gem I compiled myself using bundler to wrap the gem, on a Rails 4 application. I used bundle install with as many different variants in the gemfile as I could find/think of, but the error I get is the single line
ERROR: Could not find a valid gem 'AoifesRoman' (>= 0) in any repository
even using the sudo command wont work.
I used: gem search -l AoifesRoman
and it shows
*** LOCAL GEMS ***
AoifesRoman (0.0.1)
I found a command here http://help.rubygems.org/kb/rubygems/installing-gems-with-no-network
gem install --force --local *.gem
But its for installing a gem on a machine, does anyone think this would work or will it just break something?
Many Thanks
Kindly try this command,
gem install gem_name --source http://rubygems.org
Yes, gem install --local aoifes_roman.gem should work, if you want to install the gem locally, from your local directory.
Then you can reference it in your Gemfile as usual.

Why won't bundler install JSON gem?

I get the following error when attempting to run cap production deploy.
DEBUG [dc362284] Bundler::GemNotFound: Could not find json-1.8.1.gem for installation
DEBUG [dc362284] An error occurred while installing json (1.8.1), and Bundler cannot continue.
DEBUG [dc362284] Make sure that `gem install json -v '1.8.1'` succeeds before bundling.
It may be important to note that this deployment was working, than I upgraded to Ruby 2.1.0 to remove an encoding error. I upgraded locally which worked fine. I ran rvm install 2.1.0 and rvm use 2.1.0 then changed my .ruby-version file to reflect this Ruby upgrade.
The bundle install command works locally, but produces the same above error when I ssh onto the destination server and run this command.
If I run gem list I can see this in the list of gems.
...
jquery-rails (3.0.4)
json (1.8.1)
less (2.3.2)
...
If I try the recommended solution gem install json -v '1.8.1' Locally and on the destination server I get the following output:
Building native extensions. This could take a while...
Successfully installed json-1.8.1
Parsing documentation for json-1.8.1
Done installing documentation for json after 0 seconds
1 gem installed
So it appears the gem is installed, right? Why is this happening? How can I solve this? Any help would be greatly appreciated.
$ bundle update json
$ bundle install
So after a half day on this and almost immediately after posting my question I found the answer. Bundler 1.5.0 has a bug where it doesn't recognize default gems as referenced here
The solution was to update to bundler 1.5.1 using gem install bundler -v '= 1.5.1'
Run this command then everything will be ok
sudo apt-get install libgmp-dev
if you are in MacOS Sierra and your ruby version is 2.4.0.The ruby version is not compatible with json 1.8.3.
You can try add this line in your Gemfile:
gem 'json', github: 'flori/json', branch: 'v1.8'
This works for me!
To solve this problem, simply run:
bundle update
It will update the version of your bundler. Then run:
bundle install
Your problem will get solve. Solution is well explained here.
I found the solution here. There is a problem with json version 1.8.1 and ruby 2.2.3, so install json 1.8.3 version.
gem install json -v1.8.3
You should try
$ sudo gem install json -v '1.8.2'
in my case (Ubuntu 14.04) that didn't work directly and I had to do this:
$ sudo apt-get install ruby-dev
and then I could install the gem and continue. Had one more problem that was fixed by:
$ sudo apt-get install libsqlite3-dev
Hoping helps.
If the recommended answer didn't help because you are already using a newer version of bundler. Try the solution that worked for me.
Delete everything inside your vendor folder.
Add a line to your gemfile
gem 'json', '1.8.0'
Then run - bundle update json.
It seems to be an issue with 1.8.1 so going back to 1.8.0 did the trick for me.
I ran into this error while trying to get a project to run on my local dev box (OSX 10.6), using Sinatra and Postgresql (through activerecord), running on an rvm'd ruby 2.1. I found my answer here: https://github.com/wayneeseguin/rvm/issues/2511
My exact problem (after the first block of log entries):
I also get an error when trying to build native extensions for gems
The answer:
rvm reinstall 2.1.0 --disable-binary
The explanation:
OSX does not have a package manager so all libraries have to be installed manually by user, this makes it virtually impossible to link the binary dynamically, and as you can see there are problems with the (pseudo)statically linked binary.
For the sake of completeness, I had first forgotten to update rvm (rvm get head), which yielded some other errors, but still needed the --disable-binary flag once I had done so.
bundle update json. Helped to get through.
When I tried to install the json gem using gem install json separate from just using bundle install I got ERROR: Failed to build gem native extension., looking that up I found using
apt-get install ruby-dev
did the trick
For OS X make sure you have coreutils
$ brew install coreutils
$ bundle
This appears to be a bug in Bundler not recognizing the default gems installed along with ruby 2.x. I still experienced the problem even with the latest version of bundler (1.5.3).
One solution is to simply delete json-1.8.1.gemspec from the default gemspec directory.
rm ~/.rubies/ruby-2.1.0/lib/ruby/gems/2.1.0/specifications/default/json-1.8.1.gemspec
After doing this, bundler should have no problem locating the gem. Note that I am using chruby. If you're using some other ruby manager, you'll have to update your path accordingly.
I was missing C headers solution was to download it for Xcode, this is the best way.
xcode-select --install
Hope it helps.
Bundle was failing to install json -v '1.8.1' and deleting my Gemfile.lock and running bundle again solved this issue for me.
I installed the latest version of json:
gem install json
Then deleted the line json(1.8.1) from the Gemfile.lock and did a
bundle install
And then the Gemfile.lock file uses json(1.8.3) without erros
Switch ruby version from 1.9 to 2.2 with rvm did the job for me
For me, some of the answers mentioned earlier were helpful from understanding point of view, but those didn't solve my problem.
So this is what I did to solve issue.
Modified gemfile.lock to update json (2.0.2) (Earlier, it was 1.8.3)
Check the Bundler version installed (Bundler -v command). I had version 1.12.5 installed
Install bundler version 1.11.2 (using gem install bundler -v '1.11.2')
Then run bundle install
For macOS Sierra:
I ran into this error When i used bundler(v1.15.3) in Rails(v4.2) project.
The solution for me is gem uninstall bundler -v '1.15.3' and gem install bundler -v '1.14.6'.

Installe RMagick gem locally but unable to do the same using bundle install [windows 7(32 bit)]

I was able to install the rmagick-2.6.0-x86-mswin32.gem gem in my windows 7 machine using gem install command and I got the following success messages:
D:\dev>gem install rmagick-2.6.0
Successfully installed rmagick-2.6.0-x86-mswin32
1 gem installed
Installing ri documentation for rmagick-2.6.0-x86-mswin32...
Installing RDoc documentation for rmagick-2.6.0-x86-mswin32...
But when I try to install using bundle install (with the same version mentioned in the Gemfile) it throws the following error messages:
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension
. D:/Ruby187/bin/ruby.exe extconf.rb
checking for Ruby version >= 1.8.2... yes
checking for gcc... yes
checking for Magick-config... no
Can't install RMagick 2.6.0. Can't find Magick-config in D:\Ruby187\bin;D:\Ruby1
....
I already have ImageMagick installed and its paths included in the env vars, but the paths mentioned in the error message above seem to be different somehow(?!)
When i type rails -v now, I get the following message:
D:\dev>rails -v
←[31mCould not find gem 'rmagick (= 2.6.0) x86-mingw32' in the gems available on
this machine.←[0m
←[33mRun `bundle install` to install missing gems.←[0m
Do i need to make any other changes/ setups to install this gem with my gemfile using bundle install?
Also I actually need an earlier gem '2.5.2' but the win32 specific version of that gem does not seem to available, is there any way to get it?
I need to do this development on windows for the moment so I can switch to any other OS for the moment. Also since this is a legacy app I am working on, I will need to stick with rmagick and can't switch to any other solution.
Env info:
Ruby: 1.8.7
Rails:
Please help!
Many thanks.
Hey have you tried installing Devkit, for installing gems with native extensions on windows.
Try the steps in the following link, and check whether the Devkit has been installed in your path variable, try opening a new command shell and install the gems.
http://doelsengupta.blogspot.in/2010/10/unable-to-download-gem-with-native.html
all the best!!
I kept having this problem but was finally able to get around it using the following solution from #Martin Cohen - after modifying the gemspec file as he has suggested and rebuilding it, i was able to successfully install rmagick gem using bundle install...
https://stackoverflow.com/a/5595274/1865578
cheers!

How do I make bundler recognize installed curb gem?

I've successfully installed the curb gem on Mac OS X using sudo env ARCHFLAGS="-arch x86_64" gem install curb but when trying to run bundle install I still get this error:
Installing curb (0.7.16) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
I've done some digging and it looks like feedzirra is requiring the gem (it's not listed in the Gemfile). I've tried adding the gem to the Gemfile and pointing it to vendor/gems but that didn't help.
Any help would be greatly appreciated. Also, sorry if there's more clarification needed. This is my first question and I'm fairly new to Ruby on Rails. I'll be glad to provide more details if necessary.
Apparently it needs SSL support for curl, as I had the same error and fixed it with:
sudo apt-get install libcurl4-openssl-dev
You might want to try a standard "gem install curb" to see if that works before "bundle install".
in your Gemfile:
gem 'curb', '= 0.7.16', :path => 'vendor/gems/curb'
As long as that's where you installed the gem to.

updating the ruby gem 1.8.5

hiii
i am trying to update my gem file. Current version of gem is 1.8.5
When i am trying to update it using command " gem install rubygems-update -v 1.8.5 " it is giving following error
**
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
SocketError: getaddrinfo: Name or service not known
(http://rubygems.org/gems/rubygems-update-1.8.5.gem)
**
I am working on ubuntu 10.04
also i tried to update using command " gem update --system "
it is giving the error as below
Updating rubygems-update
**
ERROR: While executing gem ... (Gem::GemNotFoundException)
Could not find a valid gem 'rubygems-update' (1.8.6) locally or in
a repository
**
i also tried the solution given on the link http://lightyearsoftware.com/2009/07/updating-rubygems-to-recent-1-3-x/
please help me to resolve the problem..
If you are under Windows 7, run the command prompt as Administrator.
Read this thread. The error reported is the same of yours.
Try to apply the Google DNS configuration to your connection.
Otherwise you can try to install locally the gem, downloading it on rubygems.org. After this, in the directory you downloaded the gem, try to install it locally with the command: gem install gem_name --local
I also had this error. I resolved it with
gem uninstall rubygems-update
(you may need to be sudo) and then reinstalled with
gem install rubygems-update
now it's working fine, hope this is helpful
Try this:
Manually uninstall the gem you want to remove: gem uninstall [gemToUinistall]
Download the gem manually from http://rubygems.org/
try to install the gem from local : gem install [gemToInstall]

Resources