When I type commands such as "rails server" or "rails console", I receive a large error message.
The error message
Failed to load /Users/user_name/.gemrc because it doesn't contain valid YAML hash
The trouble started when I ran these series of commands about an hour earlier.
sudo gem update --system
9934 gem install gemcutter
9935 gem tumble
9936 gem update --system
Based on my research I am speculating that this has something to do with my .gemrc file which is currently blank.
I am out of my depth and would appreciate any assistance.
Thank you
I resolved the issue.
I did some additional research in the rdoc and found a solution.
I was placing the YAML file in the wrong user.
Thank you ##Kashyap.
I now understand the difference between system and user installations.
Related
So, I have no Ruby experience at all. However, I'm being asked to look after some Ruby on Rails / Ruby source code that was left behind by my predecessor. I'd like to at least get it to install and run within its Docker container.
From what I can tell, it is failing because of the mimemagic problem from a couple of years ago. It has a dependency on mimemagic v0.3.0 . I know the right thing to do would be to move on to the recent versions that have not been yanked. But, with my limited experience with Ruby, I'd like to at least get my predecessor's code to install and run.
Since moving up to the earliest mimemagic that is available (v0.3.7) appears to break other things, I have been trying to install v0.3.0 using the GitHub reference as a work around.
This:
gem 'mimemagic', github: 'mimemagicrb/mimemagic', ref: 'a4b038c6c1b9d76dac33d5711d28aaa9b4c42c66'
complains that I'm transmitting without encryption. It ultimately fails to fetch with a connection time out.
Meanwhile, this:
gem 'mimemagic', git: 'git#github.com:mimemagicrb/mimemagic.git', ref: 'a4b038c6c1b9d76dac33d5711d28aaa9b4c42c66'
complains that the host key verification has failed.
Finally, this gets me a little further:
gem 'mimemagic', git: 'https://github.com/mimemagicrb/mimemagic.git', ref: 'a4b038c6c1b9d76dac33d5711d28aaa9b4c42c66'
but an error later on looks like this:
rake aborted!
Bundler::GitError: The git source https://github.com/mimemagicrb/mimemagic.git is not yet checked out. Please run `bundle install` before trying to start your application
I have this feeling that "quickly getting it to work" isn't a reality and perhaps all of this will take a lot more than the 1-2 days I've spent so far. I just would like to check what the correct gem/git commands are, and if any of the above three are close.
Thank you!
As the error suggests, you must run the bundle install command before starting the application server or accessing the console.
The reference in the Gemfile is added correctly.
gem 'mimemagic', git: 'https://github.com/mimemagicrb/mimemagic.git', ref: 'a4b038c6c1b9d76dac33d5711d28aaa9b4c42c66'
If you've already executed the mentioned command, can you update the question to have the output for this command?
P.S. Read more about the bundle install command here.
I have been having this problem the whole day. whenever i try to do a rake db:migrate command on rails i keep getting this error.
"error while loading the hoe gem.
Please install it by running the following:
$ [sudo] gem install hoe".
But everytime i run and update all my gems i still get the same error.
The hoe gems i have already installed is the latest version (hoe 3.15.3)
Please help.
Am running rails 5.0.0.1this is the error i keep getting
Do you have the correct version? check your Gemfile.
Use bundle install to install correct version
I kind of found a way around it. I just deleted the previous app folder, created a new one and the problem was fixed. Good thing i was just starting out.
After running the Rails installer on my Windows 7 laptop, the command line with directory set to C:\Sites appears. I try to run the command below
gem install rails
But I get the error below:
Error executing gem ...
(Errno::EMSGSIZE) A message sent on a datagram socket was larger than the internal message buffer or some other network limit, or the buffer used to receive a datagram into was smaller than the datagram itself. - recvfrom(2)
Here is screen shot:
How do I fix this?
Thanks in advance
I'm on Windows 10 and I had exactly the same error:
The same buffer issue is being addressed here: https://github.com/juthilo/run-jekyll-on-windows/issues/40 as commented out by Tim, however, the gem being installed is jekyll.
I thought I'd install it on my end too and interestingly it worked:
So I thought I'd try to do an update. The holy grail (at least for me) is:
gem update --system
and then do an install on your rails gem:
gem install rails --no-ri --no-doc
worked like a charm! I had --version 4.0.0 appended as I needed a rather older version of the rails. I'm expanding my skill set and I'm just getting started with ROR.
Hope it helps!
I am trying to run the rails server on windows instance (I am using gitbash). I already install ruby (1.9.3), rails(4.2.0) and gem (1.8.29). I have took a screen shots of my error and my Gemfiles so you guys can look at it. I dig into the error and it seems like PTY files which are required on the slave.rb files is not supported on the windows! Does anyone know the way around this problem?
Thanks!
To solve this for the time being comment out the web-console gem as this has reference to the pty gem but please take note of my comment on your question
# gem 'web-console'
You might then want to run bundle install again
I am super, super new at programming and I have been trying to get everything set-up on my computer. I have installed RailsInstaller, go to >railsinstaller_demo, and type in rails s. I get the following error though could not find gem 'uglifier <>= 1.0.3> x86-mingw32'
I looked through the forum and found how to do a gem list and i noticed it was not there. I then went to gembundler and ran $ gem install bundler. I tried again but it did not work.
I am sure the answer is on this site, but i am so new that i see all these lines of code I actually have no idea where to type it in.. I am running Windows 7.
thanks for taking the time to help out a real beginner.
Have you gone to the $ railsinstaller_demo directory and run the bundle install command? This will install the gem dependencies for the application; you will not be able to run the server until you've bundled the gems. Additionally, if you're still having issues with the uglifier gem, go ahead and remove the line in the Gemfile and then run bundle install
If you need further help with the Command Prompt, you an find out more at http://bit.ly/ZajVeW.
Thanks,
Evan