This is a follow up to an earlier quesiton. I just installed Ruby on Rails using the rails installer (www.railsinstaller.org) but when I try to run any commants be it gem -v or rails new sample I get an error message saying:
Failed to load C:/Users/Zack/.gemrc due to permissions problem.
ANY ideas what to do would be very much appreciated. (Note that this is all being run on windows 7).
Was this just the only error you received in the console? Also have you checked if this file exists in the directory it is pointing to. if so what is in it. If you happen something like the following in the .gemrc you should have something like the following:
"gem": "--no-ri --no-rdoc"
This should work, providing this file exists. This can be caused when you installed Ruby using admin and then the file is created. For supported information check the following SO question this may also support you Ruby gem listed, but wont load
Probably there are two files .gemrc like in C:/Users/Zack/.gemrc and C:/ProgramData/gemrc/.gemrc. Verify and delete this last.
Related
So I'm new to Ruby and also to Rails. I have recently installed Ruby on Arch Linux.
It was mostly all fine any happy except for a few errors here and there but now when I try initializing a new rails app using rails new AppName I get the error
bash: /home/[username]/.gem/ruby/2.3.0/bin/rails: No such file or directory
I've tried creating a file and directory called rails in but get more errors.
reinstalling rails same outcome
reinstalling ruby same outcome
following any other dependencies at install also leads no wear.
Ask for any info you may need.
Thanks in advance
UPDATE
installing of gems is now stopped by a common error
$ gem install rails
Building native extensions. This could take a while...
ERROR: While executing gem ... (Errno::EACCES)
Permission denied # rb_sysopen - /usr/lib/ruby/gems/2.3.0/extensions/x86_64-linux/2.3.0/nokogiri-1.6.8/gem_make.out
and the same when I try install nokogiri
ok first check that you installed both ruby and rails well
ruby -v
and
rails -v
so if you get a respond to that you're all good
go to the place you want to create your folder att
rails new appname
then
cd appname
if that doesn't work try to generate anything
rails generate controller appname
if the generate works then your rails is ok if not then you might want to add the rails to your environment variable path.
You installed ruby on your computer. However the path is not recognized yet on it. To add it you can do this . if you are using windows my computer right click and then chose advanced system settings -> advanced at the bottom environment variables system variables PATH and then add the the path to your ruby bin folder. I am sorry i don't have enough reputation so can't add pictures but reading this will solve your problem
The overall problem is a lack of permissions to /usr/lib/ruby/. This can be fixed with
sudo chmod 777 /usr/lib/ruby
I installed rails on windows with RailsInstaller and when i try to create a new application with command e.g.
rails new blog
it creates a lot of files but after it Using turbolinks 2.2.2 it returns an error to me:
Bundler::GemspecError: Could not read gem at C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/cache/tzinfo-data-1.2014.3.gem. It may be corrupted.
How can i solve the problem?
It looks like you have a corrupted gem file (maybe due to network download issue).
Go to C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\cache\ and delete the file called tzinfo-data-1.2014.3.gem.
Then run the rails new blog command again and it should work.
I've created a new rails app using rails composer (https://github.com/RailsApps/rails-composer). however when I start my rails server (WEBrick), I get the following error:
~/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/fileutils.rb:247:in `mkdir': Permission denied
I've looked at this question and tried the steps in the selected answer but I'm getting the same issue. This seems like a conflict between RVM and Bundler since I've got ruby-1.9.3 as the top level directory and 1.9.1 as an intermediate directory. Not really sure what that means.
Any help is greatly appreciated.
This is generally the result of some directory in your Rails directory not having the correct permissions.
Here is an in-depth discussion of the permissions in Rails: https://stackoverflow.com/a/6091058/1669208
If you wanted to check to see if that was the problem. Then on a NON-PRODUCTION SERVER give 777 access to the entire rails directory.
So if I try to start my server I get the error
Could not find abstract-1.0.0 in any of the sources
Try running bundle install.
I run that and I get
Using abstract (1.0.0)
Furthermore running a bundle show abstract gives me the correct path for the gem. That path is also referenced in gem env.
I'm really not sure how it can't be found...
You might have conflicting installations of ruby. One with the proper gem which you are using in the shell but one the server is using which doesn't have it installed properly.
I would check your environment variables to see if there is a conflict.
This can also happen if you are using RVM and have switched to a different version/gemset than the default one.
What command are you using to start the server?
If rails server is what is giving you the error, I recommend trying: bundle exec rails server
If that's not the issue, another question that might help troubleshoot; are you using rvm? What does rvm info give you?
So today I've been working with RoR for the first time using the book 'Rails for PHP developers'. I'm following the tutorial in there.
I created a project, with a model Subscriber and a controller Subscribers, which has a method create. Then I ran ruby script/server to launch Mongrel.
Now, the book says that if I go to http://localhost:3000/subscribers/create I should get an error because there's no template associated (yet) for this action. The book shows this error message:
Template missing
Missing template subscribers/create.html.erb in view path /Users/derek/work/newsletter/app/views
A nice descriptive error message, really helpful. But the error I get is:
We're sorry, but something went wrong.
We've been notified about this issue and we'll take a look at it shortly.
That error is not helpful at all. I suspect it has to do with the fact that the book uses WEBrick, and I use Mongrel. But I assume it should be possible to get more descriptive errors, right? It seems quite painful to develop with errors like this.
It looks like some of your Rails install is semi borked. You might be missing the mysql gem or might not have the mysql ActiveRecord adaptor configured correctly.
Use gem list to see the gems you have installed
$ sudo gem list
you can use the gem install command to install or update gems
$ sudo gem install rails mysql
You usually want to install gems with sudo (as root) so all users can use them ( like apache or www-data)
Im sorry your first try at Rails hasn't gone smoothly, trust me it is an extremely powerful framework. Strick with it!
You probably forgot to setup the database. You can check log/development.log for further details.
you only get the first message if you are running in development mode.