I just ran:
rails g bootstrap:install
and then tried to run a rails server, and got this weird error:
rails s
/Users/makersacademy/.rvm/gems/ruby-1.9.3-p392#global/gems/rubygems-bundler-1.1.1/lib/rubygems-bundler/noexec.rb:33:in `pwd': No such file or directory - getcwd (Errno::ENOENT)
from /Users/makersacademy/.rvm/gems/ruby-1.9.3-p392#global/gems/rubygems-bundler-1.1.1/lib/rubygems-bundler/noexec.rb:33:in `<module:Noexec>'
from /Users/makersacademy/.rvm/gems/ruby-1.9.3-p392#global/gems/rubygems-bundler-1.1.1/lib/rubygems-bundler/noexec.rb:32:in `<top (required)>'
from /Users/makersacademy/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
Can someone help? I don't know what I need to do to get the rails server working... Thanks!
Really silly. It was answered here:
http://shriikant.blogspot.co.uk/2010/04/shell-init-error-retrieving-current.html
You just need to do cd and then go back in and it seems to resolve itself... Not sure why...
Related
I'm on Windows 10 and am a complete beginner programmer. I am using Ruby 2.4.2, Rails 5.1.4 and am following a Lynda course on how to run Rails 5 on Windows.
There's a part near the end where the tutor says to enter:
>rails db:schema:dump
to test whether you've established a connection to the MySQL by create a file inside the created project.
This is what I get when I enter the above command:
C:\Users\notmyactualuser\Documents\Sites\demo_project>rails db:schema:dump
rails aborted!
LoadError: cannot load such file -- mysql2/2.4/mysql2
C:/Users/notmyactualuser/Documents/Sites/demo_project/config/application.rb:7:in `<top (required)>'
C:/Users/notmyactualuser/Documents/Sites/demo_project/Rakefile:4:in `require_relative'
C:/Users/notmyactualuser/Documents/Sites/demo_project/Rakefile:4:in `<top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'
(See full trace by running task with --trace)
The tutor doesn't address what to do with potential errors and I can't seem to find an answer. I want to build a login form using RoR and am trying to grasp the basics (clearly failing). If possible, can I get help with the above and be directed to an easy, simple, "how-to" on building a login form?
Thanks a lot.
P.S. My first post, so please go easy on me, lol.
UPDATE: So I used the command on CMD and it looks like it's successful. Can somebody point me to how to get it working with Rails?
UPDATE 2: I put in the command that Hoa requested and I got this:
ERROR: "bundle install" was called with arguments ["mysql2"]
Usage: "bundle install [OPTIONS]"
UPDATE 3: I did as Satishkakumar said and I got this:
You've installed the binary version of mysql2.
It was built using MySQL Connector/C version 6.1.6.
It's recommended to use the exact same version to avoid potential issues.
At the time of building this gem, the necessary DLL files were retrieved from:
http://cdn.mysql.com/Downloads/Connector-C/mysql-connector-c-6.1.6-win32.zip
This gem includes vendor/libmysql.dll with redistribution notice in vendor/README.
======================================================================================================
Looks like it's all sorted now? Please let me know if there's any more.
I think its issue of installing mysql2 gem in system. Follow below steps to install.
In Gemfile add the line
gem 'mysql2', '0.3.21'
And run bundle install from project folder in CMD.
bundle install mysql2
This might solve your issue. Let me know in comment section if your issue still persists.
Getting this error even when I create a new project. I installed Ruby and RoR through RVM
cannot load such file -- /var/lib/gems/2.3.0/gems/passenger-5.0.30/src/ruby_supportlib/phusion_passenger (LoadError)
/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/var/lib/gems/2.3.0/gems/passenger-5.0.30/src/helper-scripts/rack-preloader.rb:74:in `init_passenger'
/var/lib/gems/2.3.0/gems/passenger-5.0.30/src/helper-scripts/rack-preloader.rb:155:in `<module:App>'
/var/lib/gems/2.3.0/gems/passenger-5.0.30/src/helper-scripts/rack-preloader.rb:30:in `<module:PhusionPassenger>'
/var/lib/gems/2.3.0/gems/passenger-5.0.30/src/helper-scripts/rack-preloader.rb:29:in `<main>'
I think I found that the problem is in the directory of the gems. I do not know how to change it on Ubuntu
I would first try to understand if you have a problem with the app or the environment.
Try to run the simplest app by:
rails new simple_app
if it doesn't work - the problem is the environment.
if it does work - probably you have some problem with the initializers or config files
Let us know how it works for you!
Have you try gem install passenger ?
or gem install bundler
Your error message:
cannot load such file -- /var/lib/gems/2.3.0/gems/passenger-5.0.30/src/ruby_supportlib/phusion_passenger (LoadError)
Suggests a permission problem with files in the gem /var/lib/gems/2.3.0/gems/passenger-5.0.30. Either, the files don't exist, or they aren't readable.
If you query the permissions for that file (make sure to append '.rb'):
ls -l /var/lib/gems/2.3.0/gems/passenger-5.0.30/src/ruby_supportlib/phusion_passenger.rb
You'll probably find it's not world readable, or at least not readable by the web server process' user. If it doesn't exist, then you should reinstall.
I saw this error on a system that had a umask of 0066, which caused passenger's gem files to be root:root with mode -rw-------.
I'm trying to install Ruby on Rails, but when I want to use Ruby, install bundle, or create a Rails app, I get this error:
C:/Ruby22-x64/lib/ruby/2.2.0/win32/registry.rb:71:in `find': unknown encoding name - CP720 (ArgumentError)
from C:/Ruby22-x64/lib/ruby/2.2.0/win32/registry.rb:71:in `<module:Win32>'
from C:/Ruby22-x64/lib/ruby/2.2.0/win32/registry.rb:3:in `<top (required)>'
from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from dk.rb:1:in `<main>'
Welcome to Stack Overflow! Very glad that you decided to try Ruby and Rails.
Long story short, you're on Windows and there's a lot of caveats to get the Ruby on Rails stack running on this OS. I think you probably tried to install Ruby just by itself... Could you please try removing that and installing the bundle from http://railsinstaller.org/en instead? It will save you a lot of headaches like these in the long run. I've used it and it's a very well thought out package.
Let me know how it works out for you, cheers!
this is because of the default code page of your command terminal.
use the below command to change the code page to Windows-1252 and you will not longer get that error
chcp 1252
I'm getting this error when trying to run the gem command. Does anyone know what is causing this? It's causing me to be not able to run rails g migration commands (I get a similar error), and I'd imagine probably a lot more.
Error loading RubyGems plugin "/Users/storwell/.rvm/gems/ruby-2.0.0-p247#global/gems/executable-hooks-1.2.2/lib/rubygems_plugin.rb": undefined method `stubs' for Gem::Specification:Class (NoMethodError)
/Users/storwell/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/dependency.rb:255:in `matching_specs': undefined method `stubs' for Gem::Specification:Class (NoMethodError)
from /Users/storwell/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/dependency.rb:279:in `to_specs'
from /Users/storwell/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/dependency.rb:309:in `to_spec'
from /Users/storwell/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:53:in `gem'
from /Users/storwell/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rubygems.rb:572:in `load_yaml'
from /Users/storwell/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/config_file.rb:327:in `load_file'
from /Users/storwell/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/config_file.rb:196:in `initialize'
from /Users/storwell/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/gem_runner.rb:74:in `new'
from /Users/storwell/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/gem_runner.rb:74:in `do_configuration'
from /Users/storwell/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/gem_runner.rb:39:in `run'
from /Users/storwell/.rvm/rubies/ruby-2.0.0-p247/bin/gem:21:in `<main>'
Update: I've also tried the rake command and it throws the same error.
I found an older link related to the same problem
, and it seems that it might be either a (1) Ruby installation issue, or (2) RubyGem issue. If it a Ruby issue, you need to uninstall and reinstall Ruby by using RVM (Ruby Version Manager) it seems that it worked for some. If it's (2) RubyGem issue (which it probably is), you either have to delete '/Users/storwell/.rvm/gems/ruby-2.0.0-p247#global/gems/executable-hooks-1.2.2/' folder or change the content in rubygems_plugin.rb file.
One of the users suggested (you can find from the link):
*"When I use "gem -v", the response will give me the error "Error loading RubyGems plugin "/Users/mercury/.rvm/gems/ruby-1.9.3-p194#global/gems/rubygems-bundler-0.2.8/lib/rubygems_plugin.rb": cannot load such file -- rubygems_bundler/rubygems_bundler_installer (LoadError)
So I edit "rubygems_plugins.rb", and I change the require path of rubygems_bundler, the path after modified is "./rubygems_bundler/{file_name}", and the problem solved."*
I hope these instructions + link will help you to solve the problem. I did go through the same tutorial book by Michael Hartl last summer. I think I have encountered a similar issue. I think I might have deleted one folder in order solve the issue, and perhaps reinstalled something as well (but I am not 100% because it has been a while) .
Try calling
$gem update --system
This question already has an answer here:
Trying to install rails- EISDIR error
(1 answer)
Closed 9 years ago.
I have installed Ruby successfully, RVM, rbenv, homebrew, git, and i've tried to install Rails in so many ways (hopefully i didn't mess anything up) but every time i try to do:
gem install rails
I get the following:
/usr/local/rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/rubygems/config_file.rb:253:in `read': Is a directory - /Users/MARS/.gemrc (Errno::EISDIR)
from /usr/local/rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/rubygems/config_file.rb:253:in `load_file'
from /usr/local/rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/rubygems/config_file.rb:191:in `initialize'
from /usr/local/rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/rubygems/gem_runner.rb:78:in `new'
from /usr/local/rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/rubygems/gem_runner.rb:78:in `do_configuration'
from /usr/local/rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/rubygems/gem_runner.rb:51:in `run'
from /usr/local/rvm/rubies/ruby-1.9.3-p484/bin/gem:21:in `<main>'
I don't understand what this means and i'm just not sure what else i need to do to get Rails. 4.0.0 installed.
Any help or advice would be greatly appreciated.
The error says cleanly: Is a directory - /Users/MARS/.gemrc (Errno::EISDIR), and .gemrc file placed in your home folder MUST be a file, not a folder. So either make it a file, or remove folder with such name.