Cannot install sqlite3-1.3.6 ruby gem in windows xp - ruby-on-rails

New to Ruby on Rails. Working in Windows XP.
I have installed the rails installer from railsinstaller dot org
Working through the example from guides dot rubyonrails dot org / getting_started
Issued the command 'rails new blog'
the bundle install fails on Network error while fetching https://rubygems.org/quick/Marshal.4.8/sqlite3-1.3.6.gemspec.rz
I have downloaded the sqlite3-1.3.6 gem and tried to manually install, receiving the following error:
checking for sqlite3.h... no
sqlite3.h is missing. Install SQLite3 from http://www.sqlite.org/ first.
* extconf.rb failed *
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
I've read many different websites that tell me to make sure Sqlite3.dll is in the system path, so I've downloaded the latest Sqlite3.dll (from sqlite3 dot org, using the windows precompiled binaries) and placed them within the path, even overwriting the Sqlite3.dll file within c:\Railsinstall\Ruby1.9.3\bin but all to no avail. I've even tried registering Sqlite3.dll using regsrv32 Sqlite3.dll, only to receive the message "Sqlite3.dll was loaded, but the DllRegisterServer entry point was not found. This file can not be registered"
I have successfully been able to install Sqlite3-1.3.6-x86-mingw32.gem, however 'rails new blog' still looks for Sqlite-1.3.6
If I try 'rails new blog --skip-bundle', I can successfully create blog, but I think I'm just skirting the issue.
Anyone have any idea what I might be missing? I have the Sqlite3.dll within the path, but still can't get past the Sqlite3.h file not found error.
Thanks
(I know I may have a proxy issue, but I still should be able to install the gem file locally. I've been able to do that for every other requested gem file.)

Go to SQLite3 download page, “Precompiled Binaries For Windows” section
Download “sqlite-shell” and “sqlite-dll” archive files
Unpack them in C:\WINDOWS\system32 folder (or any other that is in your PATH)
Install the sqlite3 Ruby gem.
Having .dlls in system32 is MANDATORY

Related

Gem corruption: Zip end of central directory signature not found

i'm new with Ruby and i never used gem files. I had to install offline some gem files. Unfortunately i followed another procedure, instead of following the documentation so i wrote a script to go through the folder "gem" of my installation directory and run first "build" and then "install --force --local ". The "clean" way would have been running just this last command but in the "cache" folder of the installation directory.
I suspect this corrupted my gems. In fact, when running my software (based on this gems) i get this error:
/var/lib/gems/2.6.0/gems/rubyzip-1.3.0/lib/zip/central_directory.rb:143:in `get_e_o_c_d': Zip end of central directory signature not found (Zip::Error)
The only idea i've is to clean up and re-install the gems, but i know that bundle clean --force can not be used that easily, since it can destroy also other gems not related with this last installation.
Do you have any suggestions?
Thank you

How do I specify the path for Devkit?

I'm here on Windows 7 x64 and am trying to install Ruby on Rails from scratch. I just installed the RubyInstaller 1.9.3-p429 and now just ran the DevKit-tdm-32-4.5.2-20111229-1559-sfx. After doing ruby dk.rb install --force. I tried to test if it's setup correctly but run into:
c:\DevKit>gem install RedCloth --platform=ruby
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
The system cannot find the path specified.
ERROR: Error installing RedCloth:
ERROR: Failed to build gem native extension.
C:/Ruby193/bin/ruby.exe extconf.rb
checking for main() in -lc... no
creating Makefile
Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/RedCloth-4.2.9 for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/gems/RedCloth-4.2.9/ext/redcloth_scan/gem_make.out
And this happens to all gems that need the Devkit. I guess I have to set the path specified but I have no idea what that means. How do I do that or what's the real problem here?
P.S.
A little bit of background. I did have RailsInstaller installed but I was getting the same error so I deleted everything. I also had NodeJs installed as well but deleted that too. I erased the PATH variables completely to start from scratch.
UPDATE
Trying the RailsInstaller gives me this error:
$ gem install json -v 1.8.0
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
The system cannot find the path specified.
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
c:/RailsInstaller/Ruby1.9.3/bin/ruby.exe extconf.rb
creating Makefile
Gem files will remain installed in c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/json-1.8.0 for inspection.
Results logged to c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/json-1.8.0/ext/json/ext/generator/gem_make.out
I hate to bump an old thread, but I wish to add to the answers just in case someone else comes by (likely as this is at the top of a Google search for a "Devkit PATH error").
After extracting the DevKit into a permanent directory and after you've navigated to the install folder within your shell and entered the "ruby dk.rb init" command, make sure you actually do the next step and install the devkit. After the init command, run "ruby dk.rb install" and that should fix many similar problems.
You need to include the Devkit/bin directory in your environment path. First, find out where Devkit was installed. For this example, we'll presume it's at C:\Devkit.
Next open your Advanced System Settings (accessible under MyComputer => Properties), and click the Environment Variables button. Under the 'user variables' section, edit the 'Path' entry to include C:\Devkit\bin. Note that this entry is semicolon delimited so you'll need to add a trailing (or prepending) semicolon to this string.
I was facing the excact same problem when I tried to install Cucumber until I tried using the --verbose parameter. For some reasons this worked out for me but I cannot really explain why. I am not considering it as a solution but it is worth a try.
The best that has worked for me always in these errors is: https://github.com/oneclick/rubyinstaller/wiki/Troubleshooting#wiki-gems_fails_comspec_autorun
If you installed the devkit as per standard guidelines on https://github.com/oneclick/rubyinstaller/wiki/Development-Kit#installation-instructions, then it's not the Devkit path but the incorrect Autorun regex key OR the incorrect command processor set by other tools that interferes with ruby gem installations. Give it a go.
I had this issue, Windows 8 x64, Ruby 2.2.3.
I tried everything from many posts and many answers but only this worked for me: Deleting old devkits and installing again.
I got it working after these steps:
Delete every folder you have ever installed devkit
Install (x64 - 64bits only) DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe from http://rubyinstaller.org/downloads/
Execute and install somewhere without spaces or anything on the path (I did c:\devkit)
Go to your system environments and add to the path c:\devkit and c:\devkit\bin
Open a CMD prompt as an admin, go to c:\devkit and type:
ruby dk.rb init
ruby dk.rb install --force
https://github.com/oneclick/rubyinstaller/wiki/Troubleshooting#error-failed-to-build-gem-native-extension
That details a couple scenarios that can cause this problem. Just in case the link dies, though. The first is where your COMSPEC system variable no longer has a full path to cmd.exe. The second is where some kind of autorun is in the registry--this is where you check:
REG QUERY "HKCU\Software\Microsoft\Command Processor" /s
REG QUERY "HKLM\Software\Microsoft\Command Processor" /s
REG QUERY "HKCU\Software\Wow6432Node\Microsoft\Command Processor" /s
REG QUERY "HKLM\Software\Wow6432Node\Microsoft\Command Processor" /s
And if you see any autoruns you delete them with something like:
REG DELETE "HKCU\Software\Microsoft\Command Processor" /v AutoRun

Ruby On Rails 3.x Offline Install (without internet connection)

I really appreciate if one can provide some insight for installing ruby on rails 3.x framework to a computer without internet connection.
All the tutorials or explanations seem to assume that there is always an internet connection. Is there simple way to download a bundle with all the dependencies included and simply install the bundle.
Thanks in advance
Finally. The complete list of Gems that you need to download manually, in order to install Rails in Offline mode (or behind a proxy that prevents your "gem" commands from working).
This list assumes that you already have the following things (Windows 7):
Ruby 1.9.2
RubyGems 1.8.24
DevKit
THE LIST.
Go to rubygems.org and use the Search function to download each one of the following Gems. You don't need to type the complete name with version numbers and stuff. For example, just "actionmailer" will work and will find the latest version).
Each gem page shows you the command line you have to type when installing it normally in a computer that isn't behind a proxy. Ignore it and just click the download link.
actionmailer-3.2.6.gem
actionpack-3.2.6.gem
activerecord-3.2.6.gem
activeresource-3.2.6.gem
activesupport-3.2.6.gem
rake-0.9.2.2.gem
i18n-0.6.0.gem
multi_json-1.3.6.gem
activemodel-3.2.6.gem
arel-3.0.2.gem
tzinfo-0.3.33.gem
builder-3.0.0.gem
erubis-2.7.0.gem
journey-1.0.4.gem
rack-1.4.1.gem
rack-cache-1.2.gem
rack-test-0.6.1.gem
sprockets-2.1.3.gem
hike-1.2.1.gem
tilt-1.3.3.gem
mail-2.4.4.gem
mime-types-1.19.gem
treetop-1.4.10.gem
polyglot-0.3.3.gem
rails-3.2.6.gem
bundler-1.1.4.gem
railties-3.2.6.gem
rack-ssl-1.3.2.gem
rdoc-3.12.gem
thor-0.15.3.gem
JSON-1.7.3.gem
(31 files total)
Just keep in mind that the versions may change. I did this in June 2012 and those were the versions that worked for me.
Copy all those files to the Ruby installation dir.
Then, open a CMD console.
cd \
cd <RubyInstallDir>
gem install rails-3.2.6.gem
Installation should run normally.
It is possible that some dependencies need a different version.
In that case, the error message will show you the right version. So you just need to download the version from rubygems.org (there is a list of old versions in the gem's page) and run the gem install command again.
I hope this can help.
You can use bundler to achive that. Bundler accepts the path where you can specify the location for the gems to be installed. Run the following command where you have internet connection. It will download all the dependencies and pack them into the specified folder.
bundle install --path gems # 'gems' is the folder present in Rails.root
Now that all the dependencies are within the project, you can copy the project to the machine where you don't have internet connection. From now on use the commands like:
bundle exec rails server
bundle exec rails console
Note that you have to install the bundler gem manually in the target machine.
I know that this question refers to Rails 3, but I created PortableRails exactly because of this (which has recently been updated to support Rails 4). Just make sure that you run bundle --local instead of just bundle (which is what the new-action tries to perform).

Gem Install Rails Zlib.so Load Error

Trying to install Ruby alongside a Wamp Server so I can program in Rails. When I "gem install rails" in CMD, I get the following error:
C:/wamp/ruby/lib/ruby/1.9.1/rubygems/package.rb:10:in 'require': 126: The specified module could not be found. - C:/wamp/ruby/lib/ruby/1.9.1/i386-mswin32/zlib.so (Load Error)
I've checked and the zlib.so is definitely there. Where have I gone wrong?
You probably need the zlib DLL file. You can download it from here and copy it into the same folder as that zlib.so file as zlib.dll. It may be called zlib1.dll in the download, and there may already be a zlib1.dll on your machine that you need to rename to zlib.dll

Can't install Rmagick and Imagemagick on Windows 7

when I run gem install rmagick-2.13.1.gem from the directory in which rmagick-2.13.1.gem is I get an Error saying that it failed to build gem native extension, below which it says
c:/Ruby192/bin/ruby.exe extconf.rb
checking for Ruby version >= 1.8.5 ... yes
Unable to get Imagemagick version
***extconf.rb failed***
Could not create Makefile due to some reason, probably lack
of necessary libraries and/or headers. Check the mkmf.log file
for more details.
From what I know reading the answers to FAQs on http://rmagick.rubyforge.org/install-faq.html#os, rmagick should come bundled with ImageMagick Windows Installer. The answers also mention rmagick-win32.gem. I haven't seen it anywhere. That's why I'll assume that rmagick-2.13.1.gem is what I need since it's the only one availaible, considering that FAQs refer to the older version of rmagick. So, I'm really confused about what the damned problem is.
I also took a look at mkmf.log file and the only thing that I've found there is
checking for Ruby version >= 1.8.5 ... yes
This whole thing confuses the hell out of me. So, any help would be hugely appreciated. Thanks a lot in advance.
Download zip file from:
https://github.com/rmagick/rmagick/downloads
Unzip it in a local directory
CD to that directory and type
gem install rmagick --local
Done.
If you get errors you might want to read the Readme.html file in the Zipfile
Exactly same problem.The "Read Me" in the downloaded Zip file now contains only this:
Hi, everyone -
We are no longer able to maintain
RMagick and are looking for someone or
some people to take over maintenance
of it. If you're interested or want
more details, please let us know at
admin#obtdev.com!
It is a cool project, written in C and
Ruby, with lots of great developers
relying on it. The code, originally
written by Tim Hunter, is clean and
easy-to-understand, and there are a
lot of directions you could take it to
make it even more useful.
We've had to stop maintaining it due
to ever-increasing constraints on our
time.
Thanks,
- Benjamin and Omer.
Try
gem install win32-service --platform=mswin32
gem install rmagick --platform=mswin32
First of all clear your path environment variables. (This is the main step that people often skip, but very important). This is the main reason for the error you're facing.
Then install the rails installer (2.0.0) from here : http://railsinstaller.org/en
It'll set up ruby, rails, and everything else you need. This will also set up your environment path variables for you as well.
Next install imagemagick 6.7.9.9 or lower and while installing check the option to include C headers. Make sure you install it within the rails installer folder.
Then type this in your command prompt path=c:\RailsInstaller\ImageMagick-6.7.9-Q8;%path% or whatever version you have.
Then type
gem install rmagick -- '--with-opt-dir="c:\RailsInstaller\ImageMagick-6.7.9-Q8"'
Finally edit C:\RailsInstaller\Ruby2.0.0\setup_environment.bat to include the path to ImageMagic
At line 25: SET PATH=c:\RailsInstaller\ImageMagick-6.7.9-Q8; or whatever version you have
use rmagick2 for
Ruby 1.8.2 and later, including Ruby 1.9
ImageMagick 6.3.0-7 or later
RMagick 2 is the future of RMagick. This is the version that will get new methods and support new ImageMagick features.

Resources