I have a script in my lib/config/my_script.rb which make a synchronization from MAIN database to my Database.
How i can run it from command line? And it will be working?
ruby my_script.rb
I also wanted to provide a Ruby quick reference guide that will give you additional information on command line arguments for the ruby command as well as a wealth of other information on Ruby.
Ruby Quick Reference Guide: http://www.zenspider.com/Languages/Ruby/QuickRef.html
ruby lib/config/my_script.rb
or
./lib/config/my_script.rb
Related
While navigating through http://installfest.railsbridge.org/installfest/linux I made it to step 4 and instead of rvm install 2.3 I used rvm install 2.4.4 in the Ubuntu command prompt and everything ran fine. Once output was finished, the last two lines said: Install of ruby-2.4.4 - #complete
Ruby was built without documentation, to build it run: rvm docs generate-ri What do you fine people think? Build or not? The above link is meant to be part of an installation process for The Odin Project, which is just a free online web dev course if that helps put things into perspective.
I use RubyMine. When I'm curious about a method, such as render, I put the text caret on it and hit Control+B. RubyMine takes me to the method's definition, where I can read the comment which generates that documentation.
I always build Ruby and Gems with full documentation, and I never bother to read their output...
I'm a newbie trying to train my self using ruby on rails. I am trying to follow an instruction where I am require to type in "subl Gemfile" on Git Bash but it constantly keeps showing 'sh.exe": subl: command not found'. Kindly advice the way forward.
P/S: I am a beginner in programming
go to the directory where you're creating your RoR app.
suppose you're creating your app at
/Users/LocalUser/workspace/YourApp
Then, there typing subl Gemfile would work
first type pwd in your command terminal and check where are you right now
also if you're running it from there, then try following link solution
https://danlimerick.wordpress.com/2014/01/07/git-for-windows-tip-opening-sublime-text-from-bash/
I'm trying to learn to use Ruby on Rails (going through Hartl's tutorial for 3.2) and I'm trying to get some command line tools to work from the command prompt in Terminal. In this particular example I'm trying to get Sublime Text 2 to work. Everything is setup, but when I run subl --help, for example it returns
-bash: subl: command not found
I followed all the directions in this link - http://www.sublimetext.com/docs/2/osx_command_line.html
and I also used Stack Overflow to try to figure out how to solve this error and it seems to be a bash profile problem, but I don't know how to access, or modify this profile to get things working. Can you offer any help?
Thanks!
If you're using OSX Lion, you may not have a .bash_profile file. Use the answers to this question for help in creating/using one, and then put the exports suggested by the howto at sublimetext.com in it.
When I rake my db in emacs, it fails– although it works fine in terminal. The error is related specifically to an environment variable that emacs doesn't seem to be picking up on. What is the best way to resolve this in .emacs? Do I need to source my profile every time I start emacs?
Which emacs shell are you using? There are a few different types which are good for different cases. I recently read this article which you may find informative: http://www.masteringemacs.org/articles/2010/11/01/running-shells-in-emacs-overview/
I suggest trying simply M-x shell which will simply run your default shell in emacs (usually bash).
I'm using a public Windows computer where the command line has been disabled. By using Instant Rails I'm able to create customize and test rails apps to some degree but can't use the Rails commands.
Question:
How do I use these commands with a disabled command line?
I've tried using SciTe, Notepad++ but all these just access the same disabled cmd so those won't work.
Some editors that deal with Rails specifically can do this. Netbeans, RadRails and RubyMine come to mind.
However, if your command line is disabled, you're probably not going to be able to `install them either.
As EmFi said, NetBeans has both a built-in Rails console and the ability to run migrations and Rake tasks from a menu. So with NetBeans, you'd be able to run migration and Rake tasks without needing a command line at all.
Here's another option...
If you're able to install software on the machine, maybe you could install something like Cygwin or MinGW. They provide a command prompt with a Unix-like environment. I've used both. Personally, I think MinGW would give you a smoother, simpler experience with fewer gotchas, but Cygwin is very popular.