rackup: command not found - ruby

I am currently working on a project that requires the rackup command on ubuntu 11.04, but I am getting an error: -bash: rackup: command not found. I have installed both the rails and rack ruby gems.
Any help with this would be awesome!

if you're using bundler then perhaps you need to use bundle exec
bundle exec rackup

Looks like rackup was really rackup1.8. Problem was solved right after that! Anybody who runs into a similar issue, be sure to try rackup[version] along with just rackup.

Related

How to fix "Unknown ruby interpreter version (do not know how to handle): RUBY_VERSION."

Today i just want to setup a jekyll Blog on my Mac, and have already install ruby 2.3.0, but when make '$ jekyll serve', it's error. and show this in terminal:
Error information:
Unknown ruby interpreter version (do not know how to handle): RUBY_VERSION.
So it looks like
bundle exec jekyll new
will create the a Gemfile with the line
ruby RUBY_VERSION
I believe you'll want to edit that file to be e.g.
ruby '2.1.1'
Coincidentally today I am also trying to setup Jekyll and am seeing the same problem. I am using RVM and it otherwise works fine (running multiple Rails dev sites locally). When I run env | grep 'RUBY' I get:
$ env | grep 'RUBY'
MY_RUBY_HOME=/Users/myusername/.rvm/rubies/ruby-2.0.0-p247
RUBY_VERSION=ruby-2.0.0-p247
However, I just continued and ran bundle install, then bundle exec jekyll serve and the site booted up without issue.
Seems like there is no variable RUBY_VERSION in your env.
Try in your shell: env | grep 'RUBY'
Output should be like this:
RUBY_VERSION=ruby-2.3.0
If you don't see anything, you need to reinstall ruby.
Use RVM or other ruby version manager. Here is a good manual
I used to have ruby '~> 2.6.3' in Gemfile and got same warning.
I changed it to ruby '2.6.3' and it fixed it.

Running 'bundle install' ruby

I've been trying to run a bundle install and I always seem to get the same error 'Could not locate Gemfile or .bundle/ directory'
If someone could explain a possibility of why I may be getting this it would be very helpful
Thanks :)
To confirm which file bundler is trying to use as its Gemfile, try this:
bundle exec ruby -e "puts ENV['BUNDLE_GEMFILE']"
To make sure you don't have a setting that's causing bundler not to use the Gemfile in your current (or a parent) directory, try this:
bundle config Gemfile

Rake aborted when running "rake install" for Octopress?

I want to build Octopress on my Windows 8.1 system.
I installed Ruby 2.0.0, and DevKit in C:\devKit, then ran gem install bundler and bundle install.
They run successfully but when I run rake install, I always get an error message like:
rake aborted! cannot load such file --
C:/Users/username/Documents/GitHub/octopress/Rakefile
I think the problem is that my username is Chinese, but could there be another problem?
I've tried bundle update or bundle exec rake install but it didn't work.
I hope someone can help me.
Just to clean up this question and to supply the right answer.
I think the problem is that my username is Chinese, but could there be another problem?
The problem is that that current user has non English characters as the windows username.
This cause error and rake cant load the desired file.
Changing teh name or moving the the Octopress to a different folder fixed the problem.

Problems with heroku toolbelt

I'm absolute newbie in Ruby and Rails project, so I'm sorry if this is dumb question.
I've installed heroku toolbelt using wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh. Also I tried gem install heroku. But when I type:
MY_USER#home-PC:~$ heroku version
<internal:gem_prelude>:1:in `require': cannot load such file -- rubygems.rb (LoadError)
from <internal:gem_prelude>:1:in `<compiled>'
I've checked in google and people suggest that gem and current ruby are different versions so I've checked it and they seem to the same:
MY_USER#home-PC:~$ which ruby
/home/MY_USER/.rvm/rubies/ruby-1.9.3-p327/bin/ruby
MY_USER#home-PC:~$ gem env | grep 'RUBY EXECUTABLE'
- RUBY EXECUTABLE: /home/MY_USER/.rvm/rubies/ruby-1.9.3-p327/bin/ruby
I have no idea what to do more, so please help.
Sorry for the maybe stupid question, thanks in advance.
EDIT:
Forgot to say I'm running Ubuntu 12.10.
The problem is that the heroku executable you installed probably starts with a line like this:
#!/usr/bin/ruby
This will force the heroku command to always use the system-wide ruby (/usr/bin/ruby) and it will never run your rvm version of ruby.
To fix it simply edit the first line of the heroku script to this:
#!/usr/bin/env ruby
This will make the heroku command run whichever ruby command is in the current PATH, instead of a hard coded path like previously.
To find the location of the heroku script, so you can edit it, simply type:
which heroku
It should print out the location of the script so you can find it and load it into your editor.
Also if you do not have write permission you may enter:
:w !sudo tee % > /dev/null
to save successfully .

Rake aborted ! Issue installing Octopress

I m trying to install the Octopress on my windows. As per their Tutorial on their website. But when I type the command
rake install
It gives me the following error
C:\Documents and Settings\admin\octopress>rake install
rake aborted!
You have already activated rake 0.9.2.2, but your Gemfile requires rake 0.9.2. U
sing bundle exec may solve this.
(See full trace by running task with --trace)
And as the error says I need to install rake 0.9.2
I tried it doing with the following command.
C:\Documents and Settings\admin\octopress>gem install rack -v=0.9.2.0
ERROR: Could not find a valid gem 'rack' (= 0.9.2.0) in any repository
ERROR: Possible alternatives: rack
I already have Ruby & Gems installed on my PC. But I m not able to figure out how to solve this issue. How do I even use the "bundle exec" to install Octopress ?
You probably need to use the bundle exec in this way
bundle exec rake install
This might just solve you problem.
I solve this with bundle update
it's a dependency problem and not big deal
The first time you spelled it rake and the second time you spelled it rack
First update the documentation to say,
bundle exec rake install
Then update the Gemfile.lock with,
bundle update

Resources