tag:help.rubygems.org,2010-01-19:/discussions/problems/286-error-while-executing-gem-errnoeinval-invalid-argument-cRubyGems.org: Discussion 2011-04-07T20:59:31Ztag:help.rubygems.org,2010-01-19:Comment/25857502010-08-15T21:34:11Z2010-08-16T20:20:56ZERROR: While executing gem ... (Errno::EINVAL) Invalid argument - c:<div><p>I have been having this issue over the last few weeks when ever I do any no local gem commands. See full example below:</p>
<p>I'm running Windows Vista SP1 v 2.1f and have installed the 1.9.1p429 from the Ruby Installer.</p>
<p>Any Help would be apperciated, thanks</p>
<p> ### Start of commands ###</p>
<pre><code>C:\tools\Ruby191\lib\ruby\site_ruby\1.9.1\rubygems>ruby -v
ruby 1.9.1p429 (2010-07-02 revision 28523) [i386-mingw32]
C:\tools\Ruby191\lib\ruby\site_ruby\1.9.1\rubygems>gem -v
1.3.7
C:\tools\Ruby191\lib\ruby\site_ruby\1.9.1\rubygems>gem list --local
*** LOCAL GEMS ***
C:\tools\Ruby191\lib\ruby\site_ruby\1.9.1\rubygems>gem update --system --debug
Exception `NameError' at C:/tools/Ruby191/lib/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:164 - uninitialized constant Gem::Commands::UpdateCommand
Exception `Gem::LoadError' at C:/tools/Ruby191/lib/ruby/site_ruby/1.9.1/rubygems.rb:779 - Could not find RubyGem test-unit (>= 0)
Updating RubyGems
Exception `Errno::EINVAL' at C:/tools/Ruby191/lib/ruby/site_ruby/1.9.1/rubygems/spec_fetcher.rb:47 - Invalid argument - c:
ERROR: While executing gem ... (Errno::EINVAL)
Invalid argument - c:
C:/tools/Ruby191/lib/ruby/site_ruby/1.9.1/rubygems/spec_fetcher.rb:47:in `stat'
C:/tools/Ruby191/lib/ruby/site_ruby/1.9.1/rubygems/spec_fetcher.rb:47:in `initialize'
C:/tools/Ruby191/lib/ruby/site_ruby/1.9.1/rubygems/spec_fetcher.rb:38:in `new'
C:/tools/Ruby191/lib/ruby/site_ruby/1.9.1/rubygems/spec_fetcher.rb:38:in `fetcher'
C:/tools/Ruby191/lib/ruby/site_ruby/1.9.1/rubygems/commands/update_command.rb:168:in `block in which_to_update'
C:/tools/Ruby191/lib/ruby/site_ruby/1.9.1/rubygems/commands/update_command.rb:161:in `each'
C:/tools/Ruby191/lib/ruby/site_ruby/1.9.1/rubygems/commands/update_command.rb:161:in `which_to_update'
C:/tools/Ruby191/lib/ruby/site_ruby/1.9.1/rubygems/commands/update_command.rb:75:in `execute'
C:/tools/Ruby191/lib/ruby/site_ruby/1.9.1/rubygems/command.rb:270:in `invoke'
C:/tools/Ruby191/lib/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:134:in `process_args'
C:/tools/Ruby191/lib/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:104:in `run'
C:/tools/Ruby191/lib/ruby/site_ruby/1.9.1/rubygems/gem_runner.rb:58:in `run'
C:/tools/Ruby191/bin/gem:21:in `<main>'</code>
</pre></div>Williamtag:help.rubygems.org,2010-01-19:Comment/25857502010-08-16T20:22:01Z2010-08-16T20:22:01ZERROR: While executing gem ... (Errno::EINVAL) Invalid argument - c:<div><p>Hi there...this seems pretty strange, and it definitely shouldn't happen. I would recommend installing Ruby via the RubyInstaller instead.</p>
<p><a href="http://rubyinstaller.org/">http://rubyinstaller.org/</a></p></div>Nick Quarantotag:help.rubygems.org,2010-01-19:Comment/25857502010-08-16T22:58:08Z2010-08-16T22:58:08ZERROR: While executing gem ... (Errno::EINVAL) Invalid argument - c:<div><p>Yeah, that's the way I did it both times. I had a slight older version<br />
(1.3.5) on another computer so I just copied over the whole Ruby directory
and it's good again.</p>
<p>Very strange, I was able to repeatably reproduce the issue on the laptop<br />
with the 1.3.7 version (Ruby 1.9.1p378 and Ruby 1.9.1p429).</p>
<p>Ok, unless you have anything else for me to try; I'll say thank you for your<br />
help.</p>
<p>On Mon, Aug 16, 2010 at 1:24 PM, Nick Quaranto <<br />
<a href="mailto:tender+d8860621f73350482ea1555a1d1befbc3010edbdd@tenderapp.com">tender+d8860621f73350482ea1555a1d1befbc3010edbdd@tenderapp.com</a><<a href="mailto:tender%2Bd8860621f73350482ea1555a1d1befbc3010edbdd@tenderapp.com">tender%2Bd8860621f73350482ea1555a1d1befbc3010edbdd@tenderapp.com</a>><br />
</p>
<blockquote><p>wrote:</p></blockquote></div>William Cherrytag:help.rubygems.org,2010-01-19:Comment/25857502010-08-31T00:06:47Z2010-08-31T00:06:47ZERROR: While executing gem ... (Errno::EINVAL) Invalid argument - c:<div><p>Yeah, not sure. I would try Ruby 1.9.2 instead, now that it's stable. :)</p></div>Nick Quarantotag:help.rubygems.org,2010-01-19:Comment/25857502010-10-07T00:36:57Z2010-10-07T00:36:58ZERROR: While executing gem ... (Errno::EINVAL) Invalid argument - c:<div><p>As per here <a href="http://www.ruby-forum.com/topic/213689">http://www.ruby-forum.com/topic/213689</a> "installation of RubyGems on<br />
top of RUby 1.9.2/1.9.3 is not supported."</p>
<p>But it also does not work on Ruby 1.8.7? Maybe try 1.9.1?</p></div>Gavintag:help.rubygems.org,2010-01-19:Comment/25857502010-10-08T00:56:11Z2010-10-08T00:56:11ZERROR: While executing gem ... (Errno::EINVAL) Invalid argument - c:<div><p>Yeah, RubyGems comes with Ruby 1.9+ but you can still upgrade it. Is there still a problem here? Would love to close this out.</p></div>Nick Quarantotag:help.rubygems.org,2010-01-19:Comment/25857502010-11-03T07:01:44Z2010-11-03T07:01:47ZERROR: While executing gem ... (Errno::EINVAL) Invalid argument - c:<div><p>To set up a ROR development environment in Windows 7 and test it by creating an application called blog using mysql for your database, perform the following steps exactly as outlined below:</p>
<p>Download and install rubyinstaller-1.9.2-p0.exe from <a href="http://rubyforge.org/frs/?group_id=167">http://rubyforge.org/frs/?group_id=167</a>.<br />
I installed mine to the default location (c:\ruby192).<br />
I also checked both check boxes about system path and associating files to ruby.<br />
You do not need to install rubygems separately. It is included in rubyinstaller-1.9.2-p0.exe.<br />
If you do install it separately, the below steps will not work. The only file you<br />
need to download and install is rubyinstaller-1.9.2-p0.exe. (Trust me.)</p>
<p>Open command prompt</p>
<p><strong> Perform the below Run commands in your command prompt (do not type Run: or # comment... of course) </strong></p>
<p>Run: gem install rails # rails will install...takes a couple of minutes</p>
<p>Run: gem install mysql # installs the mysql2 gem</p>
<p>Open another command prompt</p>
<p>Run: rails server # wait for server to start</p>
<p><strong> Open browser and open localhost:3000 in url field </strong> # checks that server works with Riding On Rails Page opening</p>
<p>Run: cd 'to_where_ever_you_want_to_install_your_application' # where you want to create your blog application in next step</p>
<p>Run: rails new blog -database=mysql # creates application named blog</p>
<p>Run: cd blog # changes directory to your new application named blog</p>
<p><strong> open blog\config\database.yml in your text editor and correct mysql2 usernames and passwords if necessary and save file </strong></p>
<p>Run: rake db:create:all # creates all databases</p>
<p>Run: rake db:migrate # checks database connection...ok if no complaint by rails</p>
<p>Run: rails generate model Article # open blog\db\migrate###...###_create_articles.rb and make changes as follows and save file:<br />
class CreateArticles < ActiveRecord::Migration<br />
def self.up</p>
<pre><code>create_table :articles do |t|
t.string :title # add this line
t.text :body # add this line
t.datetime :published_at # add this line
t.timestamps
end</code></pre>
<p> end</p>
<p> def self.down</p>
<pre><code>drop_table :articles</code></pre>
<p> end
end</p>
<p>Run: rake db:migrate # creates articles table in blog_development database as per previous step</p>
<p>Run: rails generate controller articles</p>
<p>Run: rails generate scaffold Article title:string body:text published_at:datetime --skip-migration</p>
<p>** Open browser and open localhost:3000/articles in url field # should open blog web page Listing Articles</p>
<p>Click on link "New Article" # should open page with form for entering article information</p>
<p>All the above worked great for me! Good Luck!<br />
</p></div>Johntag:help.rubygems.org,2010-01-19:Comment/25857502010-11-04T17:12:33Z2010-11-04T17:12:33ZERROR: While executing gem ... (Errno::EINVAL) Invalid argument - c:<div><p>Those instructions are probably better in a blog post somewhere :) Closing this one out for now.</p></div>Nick Quaranto