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/
Related
Hi guys.
I wanna learn how to write a new gem by myself (I'm newbie).
So I found some document to do it but it's quite hard for me.
I want to write a gem. So when I install it, I can use it on terminal, for example:
$ search key_work
But all document just said that I have to use:
$ irb -Ilib -rMygem
And then I can use it with Mygem.search.But it's not my purpose.
My question is "How I can write a code for key-word that can run on terminal?"
Thanks for your help :)
You might not want to make a gem just yet. what you want - I think - is to make an executable. This does not require a full GEM.
I'll be making 2 assumptions here, you are on a UNIX system, and ~/bin is in your PATH.
First make a file with the name of your program (for this example call proga) in your ~/bin folder.
Start this file with (only first line matters)
#!/usr/bin/env ruby
# your code here
# p gets.strip
We just want to make it executable: chmod +x ~/bin/proga
If you really want to make a command line gem, you can find a good start here: http://robdodson.me/how-to-write-a-command-line-ruby-gem/ and http://blog.excelwithcode.com/build-commandline-apps.html
I'm trying to learn how to use TDBLoader using this example I found:
https://github.com/ijdickinson/jena-tdb-ont-example
However, when trying to run the init-demo script, I keep running into issues
https://github.com/ijdickinson/jena-tdb-ont-example/blob/master/src/main/script/init-demo
I'm using cygwin to attempt to run the script, but I keep getting please ensure $Path contains $TDBROOT/bin
I set TDBROOT= C:\Development\apache-jena-2.12.1
And my Path has "%TDBROOT\bin"
I'm really new to using command line and shell scripts, so I'm not at all familiar with how to go about debugging this.
I have my tdbloader in apache-jena-2.12.1\bin , is there a way I can check if this is even working? Or if my path is properly set?
I tried "tdbloader" and "-v tdbloader" in command line and I get "tdbloader" is not recognized...
That's not supposed to happen if my path is set correctly, right?
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
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.
ashamed to say, i got home decided to follow a tutorial and got stuck very early on. I'm running rails 3.1.1 on windows and attempting the tut from http://guides.rubyonrails.org/getting_started.html
If you look at 4.2 it tells us to run a command: $ rm public/index.html - which in windows i think is just in cmd type cd blog and then its just erase public/index.html
But i get the error returned: Invalid Switch "index.html".
Anyone who can shed some light i would be much appreciative. I can't beleive im stuck already!
Thanks
M
Your problem is that in windows you have to use backslash instead of slash in unix-like systems. Use erase public\index.html