ugh! In the course of working in my perfectly good rails environment, I did something bad:
While running my local sandbox, looking in Chrome developer tools/sources (this is for our own codebase), I clicked an item in the sources list and doing so prompted downloading a file: Roboto-Regular-e60d1ba1cef90e4a4da5c9e2fe1ec3b1.woff2
I got a "threat detected" popup
I submitted the screen I was on, and saw an error to the effect of 'no data', and rails server had stopped
Now I'm having the following symptoms:
Typing "rails server" (or even just "rails") gives me a "No such file or directory" error for /usr/local/Cellar/rbenv/1.1.1/libexec/rbenv.
the following script (with no modifications since its original create date last year) has the line looking for that file : /.rbenv/shims/rails
in the directory in question (libexec), I don't see a plain "rbenv" file, only these with more specific names: rbenv---version, rbenv-help, rbenv-realpath.dylib, rbenv-version, rbenv-version-origin, rbenv-commands, rbenv-hooks, rbenv-root, rbenv-version-file, rbenv-versions, rbenv-completions, rbenv-init, rbenv-sh-rehash, rbenv-version-file-read, rbenv-whence, rbenv-exec, rbenv-local, rbenv-sh-shell, rbenv-version-file-write, rbenv-which rbenv-global, rbenv-prefix, rbenv-shims, rbenv-version-name
I've just used homebrew to upgrade rbenv, but the symptom is still the same.
My $PATH variable has:
-bash: /Users/drkaplan/.rvm/gems/ruby-2.2.2/bin:/Users/drkaplan/.rvm/gems/ruby-2.2.2#global/bin:/Users/drkaplan/.rvm/rubies/ruby-2.2.2/bin:/Users/drkaplan/.rvm/bin:/Users/drkaplan/.nvm/versions/node/v6.11.2/bin:/Users/drkaplan/google-cloud-sdk/bin:/Users/drkaplan/.rbenv/shims:/Users/drkaplan/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin:/Applications/Postgres.app/Contents/Versions/latest/bin: No such file or directory
Ideas for where to look next?
The solution in this case was to reinstall rails:
gem install rails
Related
I'm currently evaluating RubyMine 7.0.4 on Mac OS X 10.8.5, and I'm trying to get my Ruby on Rails project up and running in the editor but after I try to bundle, I get "Error Copying Gems". Locally I use rbenv but this project uses Vagrant with Ruby 2.1.
I've gone into RubyMine Preferences -> Languages and Frameworks -> Ruby SDK and Gems and set up a "Remote Interpreter" which looks like it is correctly pulling in my Vagrant / SSH information.
After I click OK, it looks like it correctly pulls down the gems, and copies them to the vendor/bundle folder, but then the IDE pops up an error message saying :
"Error Copying Gems - Unknown message with code 'Could not determine the type of file sftp://127.0.0.0.1:2222/......'"
or sometimes I'll get a more detailed error:
"Error Copying Gems - Could not copy sftp://127.0.0.1:2222/usr/bin/sudoedit to file://Users/my.username/Library/Caches/RubyMine70/ruby_stubs/....."
It feels like it is trying to copy them to a local cache folder on my Mac but failing for some reason.
I was facing a similar albeit different problem, maybe you are making the same mistake:
When setting up RubyMine to work with Vagrant, I am assuming you are adding a remote interpreter using the Vagrant dialogue. There it asks you to input the path to ruby executible. This is misleading, what you need is the path to where the gems are installed.
I'm also assuming you using RVM on your VM, as you indicate that you are not using rbenv on your VM.
I solved this by following the symlink steps found http://randycoulman.com/blog/2013/11/05/rubymine-and-vagrant/
Basically, RubyMine isn't trying to save things on your host machine. Its trying to save things to that particular path on your guest OS. I worked around this issue by creating the /Users/user_name/... directory on my guest OS, and then symlinking the directory that has the projects to /vagrant (Again, on the guest OS)
I have a problem with all my three! Ubuntu systems. I can't create any Rails projects anymore with the following command
rails new abcde
I get the following error message.
Can't initialize a new Rails application within the directory of another, please change to a non-Rails directory first
I know the error message is really clear, I googled and checked all the entries here on StackOverflow. No one had another explanation other than there is a project in a parent folder, which is not the case in my systems!
I checked all folders back to root for any hidden files resembling a rails project. Nothing! I even created a new folder under root /projects and tried to create a project in there, same error. I don't know what to do anymore, I have the same problem on all three of my Ubuntu computers. Has anyone ever had this problem and could fix it? What could be another cause of this. Because there is no project in any of parent folders.
The only possible solution for me is, that there is maybe a PATH variable for Rails that I don't know about and there is maybe a project in there?
SUGGESTIONS:
0) I'm assuming you're typing these commands from a console window, and not executing a shell script, shortcut, or "something else". Correct?
1) Please update your post with the following: ruby -v; rails -v (Ruby and Rails version info)
2) Please try another test project, and copy/paste any error or warning messages you see:
cd /tmp
rails new abc -f
<= another test "rails new", with "--force" option
3) Assuming you've installed RVM, and assuming your "rails new" is calling "run bundle install", then also make sure your user is a member of the "rvm" group:
sudo usermod -G rvm -a MYUSER
4) If you haven't already, please also look at these links:
can't initialize a new rails application within the directory of another
Problems with RVM and Rails when creating new app
Trying to teach myself Ruby and using the Book Apress Beginning Ruby. I bought TextMate 2 and in the very beginning of Chap. 4 I am being asked for following:
Launch Terminal (Completed)
Use cd to navigate to the folder where you placed example1.rb, like so:cd ~/ruby. This tells Terminal to take you to the ruby folder located off of your home user folder. (Can't figure this out. What is "cd". Where do I type this TextMate 2 or Terminal. Do I type irb prior? I saved the example1.rb on my desktop, tried to drag and drop, says permission denied).
Type ruby example1.rb and press Enter to execute the example1.rb Ruby script.
If you get an error such as ruby:No such file or directory -- example1.rb (LoadError), you aren’t in the same folder as the example1.rb source file, and you need to establish where you have saved it. (Obviously I get this error, but I can't complete step 2).
Was super excited getting through chap 1-3 and using irb and now I bought TextMate2 and I get stuck trying to start my first ruby app.
Can anyone help explain Step 2 so I can complete 3 and 4?
What is "cd"
cd is change directory command. Type it in your terminal like this:
cd /dir/that/has/example1.rb
If example1.rb is in your Desktop and you are using Mac and your username is tom, then cd command would be:
cd /Users/tom/Desktop
Then from the terminal again, type:
ruby example1.rb
to run your Ruby script.
I installed ruby 1.9.3 w/ rubyinstaller-1.9.3-p194.exe, and then installed RubyMine right after, as per directions:
http://www.jetbrains.com/ruby/quickstart/index.html
and
http://rubyinstaller.org/
I have git hub for windows already installed which I don't know if that could cause the problem.
I have also installed ruby and rails several times but I looked through the PATH environment variable for any no longer existing installations and removed them (after having already had this error) which didn't help.
Here are the settings I select in RubyMine.
The error message:
"C:\Ruby193\bin\ruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) C:\Ruby193\bin/rails 3.2.6 new "D:/Program Files (x86)/Git/Rails App/asfasf" --skip-test-unit --javascript=jquery --skip --database=postgresql
exist D:/Program Files (x86)/Git/Rails App/asfasf
Could not find "README" in any of your source paths. Your current source paths are:
C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/generators/rails/app/templates
Process finished with exit code 1"
I apologize if I come across as angry / frustrated (I edited this several times to remove it) as I have been trying to get RubyMine to work on Windows 7 or Ubuntu 12.04 and neither have been successful.
Any advice would be greatly appreciated!
I continued searching through the web for information and remembered somewhere installing rails on windows previously that for some reasons files couldn't have spaces in them.
Long story short: make sure your path doesn't have spaces in the name because it breaks rubymine or rails or something along the way.
Changing my project folder to a destination with no spaces solved the problem.
I just installed ruby on rails on my new computer ( I was using instantrails before) and I'm trying to get everything setup.
Im running Windows 7. So I followed the instructions from this tutorial.
http://blogupstairs.com/ruby-on-rails/installing-ruby-on-rails-on-windows-7/
The problem i'm guessing is step 3
"Add the newly installed bin directory to your path in your windows system : Open windows explorer-> right click the icon computer-> choose Properties -> in the contol panel Home, Click Advanced system settings and then click Envitonment Variables button->in the system variables click new and add new system variables like this : Variable name : RUBY_HOME , Variable Value : C:\Ruby, after that add it in to the path and add the bin after a semicolon to the “Path” variable like this : C:\Program Files\Common Files\Adobe\AGL;%JAVA_HOME%\bin;%ANDROID_HOME%\tools;%RUBY_HOME%\bin"
I set created the system variables but when I try to run script/generate in the main directory of my app I get the error
"Ruby: no such file or directory --script/generate"
I checked the apps directory and the script folder is in there. How can I run the "ruby script/generate" commands from the control panel?
I was guessing it was something with the path but I dont know any ways to check to find out whats going wrong.
Are you using Rails 3.0+? In this version of rails and up, the script/* folder has been deprecated in favor of rails generate, rails server, etc. See here.
In 99.99999% of all cases, if a computer tells you that it cannot find a file at a specific location, it is because that file is not at that specific location.
So, is there actually a file named generate in a directory named script in the current directory?
I have recently installed RoR on my "clean" Win7 as well.
What IDE are you using?
I suggest trying JRuby with NetBeans/RubyMine:
JRuby installer does all the work (even adds the proper variables to your path in system environment settings...,
IDEs take care of gems, setting up servers etc.
As for the commands, as Nuclearsandwitch mentioned, there is no script/generate or script/server in Rails 3. Just make sure you in the directory with your Rails app and then try running rails server. It should work :-)