The solution seems to be installing version 1.2.3 of the sqlite3-ruby gem. Is there a way to get version 1.2.4 installed on XP? Does it matter if I have 1.2.3?
jgn
· 1 year ago
Were you able to get 1.2.3 installed properly?
douglashall
· 1 year ago
Yes, 1.2.3 installed with no problems.
jgn
· 1 year ago
Great. I updated the assignment a bit, expanded the "versions" program -- let me know how it works for you. -John.
douglashall
· 1 year ago
My setup is looking good. Thanks!
plu
· 1 year ago
Is sqlite version 3.4.0 the required version? The latest download release is 3.6.2. If 3.4.0 is the required version, where may I find that version? Thanks!
jgn
· 1 year ago
I have updated the assignment to require 3.4.0 or later. So 3.6.2 should be fine.
philadelphia
· 1 year ago
Hi,
I've installed Ruby and the Gems as described above (rails, sqlite3-ruby, mongrel). No errors reported on the installations.
When I run the versions.rb script, I get an error: "Sqlite: Exception: (eval):1:in ``': No such file or directory - sqlite3 -version"
The full output is below.
Mike
Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp.
IF YOU HAVE ALREADY INSTALLED Sqlite3, then you may need to add it to your path: Control Panel / System / Advanced tab / Environment Variables button
Then find Path under "System variables" click the edit button, and add the path at the end, e.g., if your path is, say:
C:\PROGRAM FILES\FOOBAR [probably very long . . .]
change it to
C:\PROGRAM FILES\FOOBAR;C:\path\to\sqlite3
Don't forget the semi-colon that goes between each path.
philadelphia
· 1 year ago
Hi,
Yep... used the "One-Click Installer", followed by the gem install on the various Gems.
I downloaded sqlite3.exe and sqlite3.dll from the site you suggested and placed them into the sqlite3 lib directory created as part of the gem install. I added in this directory into the PATH.
All appears to be OK now.
Thanks! Mike
jgn
· 1 year ago
I added some notes on the assignment page. Thanks.
hogganbeck
· 1 year ago
For those who are doing this in OSX 10.5, make sure you update Gems before you use it to update Rails. If you don't use the updated version of Gems to execute 'gem update rails', it doesn't seem to know which version it has and you will end up with two versions of rails and some broken links in whatever system variables Rails is using to know which version it is. The rails website leads you to believe that you should run 'gem update rails' as the first step then run the setup.rb script to update gems.
If you do go down this path, run 'gem uninstall rails' and pick the latest version. Then use the newly installed Gems to re-run 'gem update rails'. After that, everything should work OK.
It's Dave, actually. I may be off the map for what the book says. I haven't bought it yet, and I don't want to mislead anyone. But I think a pretty solid overall point to make is that Gems gets updated first.
Step 1 is actually making sure that XCode is installed on your system. That sets you up with Rails 1.2.6 and Gems 1.0.
I didn't realize that Gems had a flag for self-updating. What I did was per the ruby on rails download page.. Instead of updating Rails first, I went to the link for downloading Gems
Then I used Gems to update Rails. In Terminal type "gem update rails". Gems is pretty key because its the package manager.
jgn
· 1 year ago
Thanks Dave -- Sorry about the name mistake.
There are a lot of good reasons to update the gem system first (with gem update --system). Among them is the fact that newer versions of gem automatically pull in all dependent packages; before, you would have to ask explicitly for dependency inclusion.
katemuse
· 1 year ago
An older version of XCode on my Mac prevented me from installing sqlite3-- "C compiler cannot create executables" was the error at the configure stage. Only after I updated XCode did the install run smoothly.
I cannot execute the puts `gems list --local` command from irb command line; it errors out as in the upper right corner in the picture: Exec format error - gem list --local(Errno::ENOEXEC) from version.rb:33
I CAN type gem list at the system cmd line and get the output you see in green text (all my gems).
I have the correct environment paths (seen in picture), and I have closed the command windows and reopened them. Not sure what to do next. The error happens whether I run versions.rb in the SCiTe program or from the command line (ruby versions.rb).
MaureenB
· 1 year ago
Also I have no idea what the password to the download section is...I've been looking but still...nope. Don't have it :)
MaureenB
· 1 year ago
I can run
puts 'dir'
fine, from within a ruby program or irb command line.
So specifically, a puts `gems....` is not working within ruby execution.
MaureenB
· 1 year ago
Well, before I go to bed...I saved the command
gem list --local
into a batch file and named it gemlist.bat
in my versions.rb I changed the last line to
puts 'gemlist.bat'
and that works fine. So I guess windows can execute gems commands in windows space but ruby tools cannot.
Ideas appreciated :)
MaureenB
· 1 year ago
FIXED
In order to execute puts 'gem list --local' in a ruby program, I have to replace it with a slightly different version of the command....
puts 'gem.bat list --local' <--this works from within versions.rb
Interesting. I guess ruby doesn't play perfectly with windows - no execution bit to tell it what to do like in Linux? So it has to have the .bat extension? Ahhh, the mystery.
jgn
· 1 year ago
Maureen -- I just changed the script above to say "gem list" (without --local, which is the default).
mchiarella
· 1 year ago
hi john, i'm on the waitlist, but would like to keep up in the hopes of getting in. Will the lectures be made available through this site (for all until the registration closes). thanks
jgn
· 1 year ago
The lectures are in the password-protected "downloads" page -- send an e-mail to at john at 7fff dot com and I will send you the password.
swithin
· 1 year ago
When I run the "ruby versions.rb" command I get C:\>ruby versions.rb ----- Software version check as Thu Sep 18 09:51:45 -0400 2008 Ruby: 1.8.6 RebyGems: 1.2.0 Rails: 2.1.1 Mongrel: 1.1.5 Sqlite: 3.6.2 And . . . Connect to Sqlite says version is: 3.6.2 versions.rb:33:in ''':Exec format error - gem list <Errno::ENOEXEC> from versions.rb:33 C:\>
Please assist.
jgn
· 1 year ago
What happens when you type
gem list
from the command prompt?
swithin
· 1 year ago
I am still getting the error: Sqlite: 3.6.2 And . . . Connect to Sqlite says version is: 3.6.2 versions.rb:33:in ''':Exec format error - gem list <Errno::ENOEXEC> from versions.rb:33
When I type in gem list then I get the following: C:\>gem list
I did the same earlier in this little game but that didn't do it for me. still had to use .bat extension.
jgn
· 1 year ago
Maureen: If you have a laptop, bring it to the first section. We'd like to look at your setup.
Rooby
· 1 year ago
It works if you use puts `gem.bat list` on WindowsXP.
philadelphia
· 1 year ago
FYI...
On Linux... inadvertently installed an older version of rails. Trying to update was a problem, as gem was complaining about gem_runner.
I had to add "require 'rubygems/gem_runner' to the /usr/bin/gem script. Allowed me then to install the correct rails version, with no gem_runner complaints. All working now. Posting in case anyone encounters the same problem.
Student1
· 1 year ago
I followed AWDR for MAC. It did not mention mongrel. But in ruby versions.rb, I got Mongrel 1.1.4. AWDR does not mention updating Mongrel.
Should I do gem update Mongrel or gem install Mongrel
I proceed with the assignment, and it seems to work. So, I don't know if I should leave it as it is.
Thanks,
jgn
· 1 year ago
Mongrel has been stable for some time; so it's ok with what you have, but please do update it (sudo gem update mongrel).
Nice pseudonym.
Morris
· 1 year ago
Trying to install the sqlite3-ruby gem, I got an error, and successfully installed it using the "--version 1.2.3" flag. But then, when I try to install mongrel, I get the same error.
Is your rubygems up to date? (gem update --system)
Morris
· 1 year ago
Yes.
C:\>gem --version 1.2.0
The problem seems to have been the one DavidLo reports, below.
DavidLo
· 1 year ago
I’m using Windows XP SP 3.
I had great difficulty with the Zlib::BufError problem. It would even happen running “gem update –system” a second time.
Finally I uninstalled everything to start again (remembering to also delete the .gem directory in my windows home directory "\Documents and Settings\myname").
The solution that worked for me was to reboot after each and every gem update operation. I don’t know why that worked but it did (and nothing else had). This problem is discussed extensively on the web but there’s no universal solution.
Morris
· 1 year ago
Thanks for mentioning this, David. I didn't have to uninstall anything. I merely shut down my system on Friday, and after booting this evening, when I tried installing the mongrel gem again, it installed with no problems at all.
Ana
· 1 year ago
Hi guys, can I get some clarification on when assignments 0 & 1 are due?
- On the syllabus it says: Sunday, Oct. 5: Assignment 1 (Ruby One-Liners) due and there is no date for Assignment 0 - On the assignment 0 page it says due Sunday, Oct. 5 - On the assignment 1 page it says due Sunday night, Oct. 19.
So I just want to be sure. Do I hand in BOTH assignments 0 & 1 on Oct 5?
Thanks! --Ana
jgn
· 1 year ago
My (John) bad: #0 is due Sunday Sept. 28; One-liners due Oct. 5. I will update the various pages.
Ana
· 1 year ago
Thanks! --Ana
Mario
· 1 year ago
With a great deal of effort, I've been able to get the Windows Ruby environment setup from InstantRails, but sqlite3-ruby appears unwilling to update. Is there some simple solution to the errors I'm seeing below? I prefer not to go manually installing nmake and the other tools it mentions. Thanks for any reply! --MC
C:\Ruby\rails_apps>gem update sqlite3-ruby Updating installed gems Updating sqlite3-ruby Building native extensions. This could take a while... ERROR: While executing gem ... (Gem::Installer::ExtensionBuildError) ERROR: Failed to build gem native extension.
C:/Ruby/ruby/bin/ruby.exe extconf.rb update sqlite3-ruby checking for fdatasync() in rt.lib... no checking for sqlite3.h... no
nmake 'nmake' is not recognized as an internal or external command, operable program or batch file.
Gem files will remain installed in C:/Ruby/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.4 for inspection. Results logged to C:/Ruby/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.4/ext/sqlite3_api/gem_make.out
C:\Ruby\rails_apps>
Mario
· 1 year ago
Sorry for posting too quickly - I installed sqlite3-ruby 1.2.3 and I'm all set. -- MC
jgn
· 1 year ago
No worries -- great. Whew.
cyberwisdom
· 1 year ago
I got a very similar error in Mac OS X Leopard (10.5) and wanted to post the solution in case someone else runs into the same problem: ----------------------------------------------------------------------- mymachostname$ sudo gem install sqlite3-ruby
Building native extensions. This could take a while... ERROR: Error installing sqlite3-ruby: ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb install sqlite3-ruby can't find header files for ruby.
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.2.4 for inspection. Results logged to /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.2.4/ext/sqlite3_api/gem_make.out ----------------------------------------------------------------------- SOLUTION: I fixed it after I found this similar error in the Ruby Forums: http://railsforum.com/viewtopic.php?id=22116
After installing Xcode, it magically worked. Beware that Xcode is a 1GB DVD sized download. Also, I had to register for an Apple Developer account to download.
Another note worth mentioning: AWDR says to go to http://darwinports.com/install/ to install darwin ports. However, the site has been down for a few days and now it's back online, but the downloads are still not working. So I may have resolved it quicker with darwin ports, but it's still not available.
I still think Xcode was worth it since it's in the list of IDE's in AWDR. I'm gonna give it try along with the other ones.
nocsav
· 1 year ago
I've been doing assignment 0 on Ubuntu Linux.
I had to install a couple of extra packages to get mine working: $ sudo apt-get install ruby1.8-dev $ sudo apt-get install rails
Also, I had to run "rails" with a special argument to force it to use sqlite3. By default, it tried using MySQL.
$ rails -D sqlite3 assn0
Hope this helps...
jgn
· 1 year ago
For your Linux setup: What are you currently getting for
rails -v sudo gem -v
nocsav
· 1 year ago
Ruby version 1.8.6 (x86_64-linux) RubyGems version 1.1.1 Rails version 2.0.2
jgn
· 1 year ago
You need to bump up your version of Rails. Do
gem update rails
Then new apps should get Sqlite3 not MySQL.
nocsav
· 1 year ago
Thanks for the tip! It turned out I had two versions of rails installed by mistake. I didn't have gems in my PATH, so I ended up getting 2.0.2 from /bin.
Mario
· 1 year ago
Fedora 9 Linux : For those of us that don't know when to quit, you should install ruby-devel , as well as GCC , in addition to the standard RPMs ( ruby , ruby-lib , ... )
# yum install gcc # yum install ruby-devel
ruby-devel includes the 'ruby.h' file which was preventing my proper installation of Mongrel and FastThread .
The ruby versions.rb works on my laptop, but thwn I do the same exact steps on my desktop I get:
And . . . Connect to Sqlite says version is: 3.6.2 versions.rb:33:in ``': Exec format error - gem list (Errno::ENOEXEC) from versions.rb:33
Anyone else get this error ?
bob d
· 1 year ago
I changed versions.rb to puts `gem.bat list` and it worked.
As C&C Music factory would say "things that make you say hmmmm" !
Felipe Loya
· 1 year ago
Hi, I installed Ruby One-Click Installer with no problem using my Laptop running Win2000. However, when I tried to install sqlit3 3.6.3 it gives me the following error:
C:\Documents and Settings\floya\Desktop\Harvard\CSCI E-168 Fall 2008\Ruby\bin> gem install sqlite3-ruby Building native extensions. This could take a while... ERROR: Error installing sqlite3-ruby: ERROR: Failed to build gem native extension.
C:/Documents and Settings/floya/Desktop/Harvard/CSCI E-168 Fall 2008/Ruby/bin/ruby.exe extconf.rb install sqlite3-ruby 'C:/Documents' is not recognized as an internal or external command,operable program or batch file.
Gem files will remain installed in C:/Documents and Settings/floya/Desktop/Harva rd/CSCI E-168 Fall 2008/Ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.4 for inspection. Results logged to C:/Documents and Settings/floya/Desktop/Harvard/CSCI E-168 Fall 2008/Ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.4/ext/sqlite3_api/gem_make.out
I followed all instructions from the video, still no positive results. Any suggestions to solve this problem? Thanks.
jgn
· 1 year ago
Two things:
(1) I say about, if you have issues with the sqlite3-ruby gem, try an earlier version:
gem install --version 1.2.3 sqlite3-ruby
(that's two dashes)
(2) If it still doesn't work: What is very very likely to be happening is that something is objecting to the spaces in the path.
I would strongly suggest that you install everything at the root. I.e., Ruby should be in C:\Ruby, Sqlite3 in C:\sqlite3, etc.
John
Felipe Loya
· 1 year ago
Thanks for your help, I got it working with: gem install --version 1.2.3 sqlite3-ruby .
SA
· 1 year ago
I have installed everything, but when I type rails test or rails assn0, I get an error that there is no inernal command as rails. My ruby script/server is not running either.
jgn
· 1 year ago
How did you install Rails? Can you find the rails command on your disk?
Windows? OSX? Linux? Help us out!
SA
· 1 year ago
I got the problem fixed. I reinstalled ruby on windows, and somehow it worked the second time.
I placed both the sqlite3.dll and the sqlite3.exe into the ruby/bin directory and installed the gem without issue so I'm unsure why this error is occurring. I would greatly appreciate any suggestions or help anyone might have.
jgn
· 1 year ago
Here are some questions and suggestions:
0. If you are local and you're on a laptop, bring it to section. 1. What happens when you type "sqlite3" into the DOS prompt? Does that work? 2. Review the screencast, and consider installing Sqlite3 the way it is done there. Incidentally, there is also a .def file -- did you put that in ruby/bin as well? In any case, I think you'll be happier in the long run if you put sqlite3 in its own directory and change your path (see the screencast).
MJG
· 1 year ago
Thank you its working now - the screencast says to place the files into the Ruby>Bin directory, however that didn't work for me so I did what you suggested above (place the three files into the sqlite3 directory created by the gem install, changed the path) and now versions.rb runs without generating that error.
http://www.phwinfo.com/forum/comp-lang-ruby/295...
The solution seems to be installing version 1.2.3 of the sqlite3-ruby gem. Is there a way to get version 1.2.4 installed on XP? Does it matter if I have 1.2.3?
I've installed Ruby and the Gems as described above (rails, sqlite3-ruby, mongrel). No errors reported on the installations.
When I run the versions.rb script, I get an error: "Sqlite: Exception: (eval):1:in ``': No such file or directory - sqlite3 -version"
The full output is below.
Mike
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\mcook1590>cd c:\ruby
C:\Ruby>ruby -v
ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32]
C:\Ruby>ruby versions.rb
----- Software version check at Wed Sep 17 11:39:44 -0400 2008
Ruby: 1.8.6
RubyGems: 1.2.0
Rails: 2.1.1
Mongrel: 1.1.5
Sqlite: Exception: (eval):1:in ``': No such file or directory - sqlite3 -version
*** LOCAL GEMS ***
actionmailer (2.1.1)
actionpack (2.1.1)
activerecord (2.1.1)
activeresource (2.1.1)
activesupport (2.1.1)
cgi_multipart_eof_fix (2.5.0)
fxri (0.3.6)
fxruby (1.6.16)
gem_plugin (0.2.3)
hoe (1.7.0)
hpricot (0.6)
log4r (1.0.5)
mongrel (1.1.5)
ptools (1.1.6)
rails (2.1.1)
rake (0.8.2)
ruby-opengl (0.60.0)
rubyforge (1.0.0)
sqlite3-ruby (1.2.3)
test-unit (2.0.0)
win32-api (1.2.0)
win32-clipboard (0.4.4)
win32-dir (0.3.2)
win32-eventlog (0.5.0)
win32-file (0.5.5)
win32-file-stat (1.3.1)
win32-process (0.5.9)
win32-sapi (0.1.4)
win32-sound (0.4.1)
windows-api (0.2.4)
C:\Ruby>ruby -v
ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32]
C:\Ruby>ruby versions.rb
----- Software version check at Wed Sep 17 11:39:44 -0400 2008
Ruby: 1.8.6
RubyGems: 1.2.0
Rails: 2.1.1
Mongrel: 1.1.5
Sqlite: Exception: (eval):1:in ``': No such file or directory - sqlite3 -version
*** LOCAL GEMS ***
actionmailer (2.1.1)
actionpack (2.1.1)
activerecord (2.1.1)
activeresource (2.1.1)
activesupport (2.1.1)
cgi_multipart_eof_fix (2.5.0)
fxri (0.3.6)
fxruby (1.6.16)
gem_plugin (0.2.3)
hoe (1.7.0)
hpricot (0.6)
log4r (1.0.5)
mongrel (1.1.5)
ptools (1.1.6)
rails (2.1.1)
rake (0.8.2)
ruby-opengl (0.60.0)
rubyforge (1.0.0)
sqlite3-ruby (1.2.3)
test-unit (2.0.0)
win32-api (1.2.0)
win32-clipboard (0.4.4)
win32-dir (0.3.2)
win32-eventlog (0.5.0)
win32-file (0.5.5)
win32-file-stat (1.3.1)
win32-process (0.5.9)
win32-sapi (0.1.4)
win32-sound (0.4.1)
windows-api (0.2.4)
windows-pr (0.9.3)
C:\Ruby>
But it apparently requires a separate install of Sqlite3. The install packages for Sqlite3 are here: http://www.sqlite.org/download.html
See under "Precompiled binaries for Windows."
Try the install, and see what happens.
IF YOU HAVE ALREADY INSTALLED Sqlite3, then you may need to add it to your path: Control Panel / System / Advanced tab / Environment Variables button
Then find Path under "System variables" click the edit button, and add the path at the end, e.g., if your path is, say:
C:\PROGRAM FILES\FOOBAR [probably very long . . .]
change it to
C:\PROGRAM FILES\FOOBAR;C:\path\to\sqlite3
Don't forget the semi-colon that goes between each path.
Yep... used the "One-Click Installer", followed by the gem install on the various Gems.
I downloaded sqlite3.exe and sqlite3.dll from the site you suggested and placed them into the sqlite3 lib directory created as part of the gem install. I added in this directory into the PATH.
All appears to be OK now.
Thanks!
Mike
If you do go down this path, run 'gem uninstall rails' and pick the latest version. Then use the newly installed Gems to re-run 'gem update rails'. After that, everything should work OK.
At least, that has been my experience.
I may be off the map for what the book says. I haven't bought it yet, and I don't want to mislead anyone. But I think a pretty solid overall point to make is that Gems gets updated first.
Step 1 is actually making sure that XCode is installed on your system. That sets you up with Rails 1.2.6 and Gems 1.0.
I didn't realize that Gems had a flag for self-updating. What I did was per the ruby on rails download page.. Instead of updating Rails first, I went to the link for downloading Gems
Then I used Gems to update Rails. In Terminal type "gem update rails". Gems is pretty key because its the package manager.
There are a lot of good reasons to update the gem system first (with gem update --system). Among them is the fact that newer versions of gem automatically pull in all dependent packages; before, you would have to ask explicitly for dependency inclusion.
I cannot execute the puts `gems list --local` command from irb command line; it errors out as in the upper right corner in the picture: Exec format error - gem list --local(Errno::ENOEXEC) from version.rb:33
I CAN type gem list at the system cmd line and get the output you see in green text (all my gems).
I have the correct environment paths (seen in picture), and I have closed the command windows and reopened them. Not sure what to do next. The error happens whether I run versions.rb in the SCiTe program or from the command line (ruby versions.rb).
puts 'dir'
fine, from within a ruby program or irb command line.
So specifically, a puts `gems....` is not working within ruby execution.
gem list --local
into a batch file and named it gemlist.bat
in my versions.rb I changed the last line to
puts 'gemlist.bat'
and that works fine. So I guess windows can execute gems commands in windows space but ruby tools cannot.
Ideas appreciated :)
In order to execute
puts 'gem list --local' in a ruby program, I have to replace it with a slightly different version of the command....
puts 'gem.bat list --local' <--this works from within versions.rb
Interesting. I guess ruby doesn't play perfectly with windows - no execution bit to tell it what to do like in Linux? So it has to have the .bat extension? Ahhh, the mystery.
thanks
C:\>ruby versions.rb
----- Software version check as Thu Sep 18 09:51:45 -0400 2008
Ruby: 1.8.6
RebyGems: 1.2.0
Rails: 2.1.1
Mongrel: 1.1.5
Sqlite: 3.6.2
And . . . Connect to Sqlite says version is: 3.6.2
versions.rb:33:in ''':Exec format error - gem list <Errno::ENOEXEC>
from versions.rb:33
C:\>
Please assist.
gem list
from the command prompt?
Sqlite: 3.6.2
And . . . Connect to Sqlite says version is: 3.6.2
versions.rb:33:in ''':Exec format error - gem list <Errno::ENOEXEC>
from versions.rb:33
When I type in
gem list
then I get the following:
C:\>gem list
*** LOCAL GEMS ***
actionmailer (2.1.1)
actionpack (2.1.1)
activerecord (2.1.1)
activeresource (2.1.1)
activesupport (2.1.1)
cgi_multipart_eof_fix (2.5.0)
fxri (0.3.6)
fxruby (1.6.12)
gem_plugin (0.2.3)
hpricot (0.6)
log4r (1.0.5)
mongrel (1.1.5)
rails (2.1.1)
rake (0.8.2, 0.7.3)
rubygems-update (1.2.0)
sources (0.0.1)
sqlite3-ruby (1.2.3)
win32-api (1.0.4)
win32-clipboard (0.4.3)
win32-dir (0.3.2)
win32-eventlog (0.4.6)
win32-file (0.5.4)
win32-file-stat (1.2.7)
win32-process (0.5.3)
win32-sapi (0.1.4)
win32-sound (0.4.1)
windows-api (0.2.0)
windows-pr (0.7.2)
C:\>
On Linux... inadvertently installed an older version of rails. Trying to update was a problem, as gem was complaining about gem_runner.
I had to add "require 'rubygems/gem_runner' to the /usr/bin/gem script. Allowed me then to install the correct rails version, with no gem_runner complaints. All working now. Posting in case anyone encounters the same problem.
AWDR does not mention updating Mongrel.
Should I do
gem update Mongrel
or
gem install Mongrel
I proceed with the assignment, and it seems to work. So, I don't know if I should leave it as it is.
Thanks,
Nice pseudonym.
On Windows XP, with Service Pack 3:
C:\blahblahblah>gem install mongrel
ERROR: While executing gem ... (Zlib::BufError)
buffer error
Is there something else I should be doing?
C:\>gem --version
1.2.0
The problem seems to have been the one DavidLo reports, below.
I had great difficulty with the Zlib::BufError problem. It would even happen running “gem update –system” a second time.
Finally I uninstalled everything to start again (remembering to also delete the .gem directory in my windows home directory "\Documents and Settings\myname").
The solution that worked for me was to reboot after each and every gem update operation. I don’t know why that worked but it did (and nothing else had). This problem is discussed extensively on the web but there’s no universal solution.
I didn't have to uninstall anything. I merely shut down my system on Friday, and after booting this evening, when I tried installing the mongrel gem again, it installed with no problems at all.
- On the syllabus it says: Sunday, Oct. 5: Assignment 1 (Ruby One-Liners) due and there is no date for Assignment 0
- On the assignment 0 page it says due Sunday, Oct. 5
- On the assignment 1 page it says due Sunday night, Oct. 19.
So I just want to be sure. Do I hand in BOTH assignments 0 & 1 on Oct 5?
Thanks!
--Ana
--Ana
C:\Ruby\rails_apps>gem update sqlite3-ruby
Updating installed gems
Updating sqlite3-ruby
Building native extensions. This could take a while...
ERROR: While executing gem ... (Gem::Installer::ExtensionBuildError)
ERROR: Failed to build gem native extension.
C:/Ruby/ruby/bin/ruby.exe extconf.rb update sqlite3-ruby
checking for fdatasync() in rt.lib... no
checking for sqlite3.h... no
nmake
'nmake' is not recognized as an internal or external command,
operable program or batch file.
Gem files will remain installed in C:/Ruby/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.4 for inspection.
Results logged to C:/Ruby/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.4/ext/sqlite3_api/gem_make.out
C:\Ruby\rails_apps>
-----------------------------------------------------------------------
mymachostname$ sudo gem install sqlite3-ruby
Building native extensions. This could take a while...
ERROR: Error installing sqlite3-ruby:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb install sqlite3-ruby
can't find header files for ruby.
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.2.4 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.2.4/ext/sqlite3_api/gem_make.out
-----------------------------------------------------------------------
SOLUTION: I fixed it after I found this similar error in the Ruby Forums:
http://railsforum.com/viewtopic.php?id=22116
After installing Xcode, it magically worked. Beware that Xcode is a 1GB DVD sized download. Also, I had to register for an Apple Developer account to download.
Another note worth mentioning: AWDR says to go to http://darwinports.com/install/ to install darwin ports. However, the site has been down for a few days and now it's back online, but the downloads are still not working. So I may have resolved it quicker with darwin ports, but it's still not available.
I still think Xcode was worth it since it's in the list of IDE's in AWDR. I'm gonna give it try along with the other ones.
I had to install a couple of extra packages to get mine working:
$ sudo apt-get install ruby1.8-dev
$ sudo apt-get install rails
Also, I had to run "rails" with a special argument to force it to use sqlite3. By default, it tried using MySQL.
$ rails -D sqlite3 assn0
Hope this helps...
rails -v
sudo gem -v
RubyGems version 1.1.1
Rails version 2.0.2
gem update rails
Then new apps should get Sqlite3 not MySQL.
# yum install gcc
# yum install ruby-devel
ruby-devel includes the 'ruby.h' file which was preventing my proper installation of Mongrel and FastThread .
[mmm.lkjlkj.net:~] # grep -i ruby rpm.list.txt
rubygems-0.9.4-1.fc8.noarch
ruby-ri-1.8.6.230-4.fc9.i386
ruby-irb-1.8.6.230-4.fc9.i386
ruby-libs-1.8.6.230-4.fc9.i386
ruby-1.8.6.230-4.fc9.i386
ruby-rdoc-1.8.6.230-4.fc9.i386
ruby-devel-1.8.6.230-4.fc9.i386
[mmm.lkjlkj.net:~] #
And . . . Connect to Sqlite says version is: 3.6.2
versions.rb:33:in ``': Exec format error - gem list (Errno::ENOEXEC)
from versions.rb:33
Anyone else get this error ?
As C&C Music factory would say "things that make you say hmmmm" !
C:\Documents and Settings\floya\Desktop\Harvard\CSCI E-168 Fall 2008\Ruby\bin>
gem install sqlite3-ruby
Building native extensions. This could take a while...
ERROR: Error installing sqlite3-ruby:
ERROR: Failed to build gem native extension.
C:/Documents and Settings/floya/Desktop/Harvard/CSCI E-168 Fall 2008/Ruby/bin/ruby.exe extconf.rb install sqlite3-ruby
'C:/Documents' is not recognized as an internal or external command,operable program or batch file.
Gem files will remain installed in C:/Documents and Settings/floya/Desktop/Harva
rd/CSCI E-168 Fall 2008/Ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.4 for inspection.
Results logged to C:/Documents and Settings/floya/Desktop/Harvard/CSCI E-168 Fall 2008/Ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.4/ext/sqlite3_api/gem_make.out
I followed all instructions from the video, still no positive results. Any suggestions to solve this problem? Thanks.
(1) I say about, if you have issues with the sqlite3-ruby gem, try an earlier version:
gem install --version 1.2.3 sqlite3-ruby
(that's two dashes)
(2) If it still doesn't work: What is very very likely to be happening is that something is objecting to the spaces in the path.
I would strongly suggest that you install everything at the root. I.e., Ruby should be in C:\Ruby, Sqlite3 in C:\sqlite3, etc.
John
Windows? OSX? Linux? Help us out!
C:\Ruby\bin>versions.rb
require failed: 127: The specified procedure could not be found. - Init_sqlite3./sqlite3.dll
----- Software version check at Tue Sep 23 14:41:20 -0400 2008
Ruby: 1.8.6
RubyGems: 1.2.0
Rails: 2.1.1
Mongrel: 1.1.5
Sqlite: 3.6.3
*** LOCAL GEMS ***
actionmailer (2.1.1)
actionpack (2.1.1)
activerecord (2.1.1)
activeresource (2.1.1)
activesupport (2.1.1)
cgi_multipart_eof_fix (2.5.0)
fxri (0.3.6)
fxruby (1.6.16)
gem_plugin (0.2.3)
hoe (1.7.0)
hpricot (0.6)
log4r (1.0.5)
mongrel (1.1.5)
ptools (1.1.6)
rails (2.1.1)
rake (0.8.2)
ruby-opengl (0.60.0)
rubyforge (1.0.0)
sqlite-ruby (2.2.3)
sqlite3-ruby (1.2.3)
test-unit (2.0.0)
win32-api (1.2.0)
win32-clipboard (0.4.4)
win32-dir (0.3.2)
win32-eventlog (0.5.0)
win32-file (0.5.5)
win32-file-stat (1.3.1)
win32-process (0.5.9)
win32-sapi (0.1.4)
win32-sound (0.4.1)
windows-api (0.2.4)
windows-pr (0.9.3)
I placed both the sqlite3.dll and the sqlite3.exe into the ruby/bin directory and installed the gem without issue so I'm unsure why this error is occurring. I would greatly appreciate any suggestions or help anyone might have.
0. If you are local and you're on a laptop, bring it to section.
1. What happens when you type "sqlite3" into the DOS prompt? Does that work?
2. Review the screencast, and consider installing Sqlite3 the way it is done there. Incidentally, there is also a .def file -- did you put that in ruby/bin as well? In any case, I think you'll be happier in the long run if you put sqlite3 in its own directory and change your path (see the screencast).
Thanks for your help!