Ruby Rails环境完全关注路径,安装和酿造

时间:2022-09-12 23:25:03

and Thank you for Helping me!

谢谢你的帮助!

Long story short, I put this in the terminal

长话短说,我把它放在终端

curl https://raw.github.com/gist/1688857/rbenv.sh | sh ; rbenv global 1.9.3-p327-perf

I ended up downloading/installing ruby over my current ruby/rails. I stopped it in time but it was too late. Both my rails and my ruby commands didn't work .....

我最后在我当前的ruby / rails上下载/安装ruby。我及时停了下来,但为时已晚。我的rails和我的ruby命令都不起作用.....

Originally I installed railsinstaller to get my rails/ruby up and running.

最初我安装了railsinstaller来启动和运行我的rails / ruby​​。

I did rvm implode, removed rvm path in .bash_profile, removed /etc/rvmrc file as well. I figured the rmv * with the new ruby that I downloaded.

我做了rvm implode,删除了.bash_profile中的rvm路径,也删除了/ etc / rvmrc文件。我想到了rmv与我下载的新红宝石的冲突。

Originally I used railsinstaller to get ruby/rails up and running.

最初我使用railsinstaller来启动和运行ruby / rails。

Then I tried to install railsinstaller but it didn't work! I later uninstalled railsinstaller because I want to try brew.

然后我尝试安装railsinstaller但它没有用!我后来卸载了railsinstaller,因为我想尝试brew。

Here is my .bashrc profile

这是我的.bashrc个人资料

export PATH="/usr/bin:$PATH"
export PATH="/usr/local:$PATH"
export PATH="/usr/local/bin:$PATH"
export PATH=/usr/local/mysql/bin:$PATH
export PATH="/usr/local/opt/ruby/bin:$PATH"
export DYLD_LIBRARY_PATH=/usr/local/mysql/lib:$DYLD_LIBRARY_PATH

### Added by the Heroku Toolbelt
export PATH="/usr/local/heroku/bin:$PATH"

Here is what I get when I run brew doctor

这是我跑啤酒医生时得到的

Warning: Setting DYLD_* vars can break dynamic linking.
    Set variables:
DYLD_LIBRARY_PATH

Warning: The /usr/local directory is not writable.
Even if this directory was writable when you installed Homebrew, other
software may change permissions on this directory. Some versions of the
"InstantOn" component of Airfoil are known to do this.

You should probably change the ownership and permissions of /usr/local
back to your user account.

Warning: Experimental support for using Xcode without the "Command Line Tools".
You have only installed Xcode. If stuff is not building, try installing the
"Command Line Tools for Xcode" package provided by Apple.

Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:

autoconf
libtool

(I tried brew link above)

(我试过上面的brew链接)

Error: Could not symlink file: /usr/local/Cellar/autoconf/2.69/bin/ifnames
/usr/local/bin/ifnames may already exist.
/usr/local/bin may not be writable.

same thing happen with libtool

libtool也会发生同样的事情

Warning: Your Xcode is configured with an invalid path.
You should change it to the correct path:
sudo xcode-select -switch /Applications/Xcode.app

When I run brew install ruby .......

当我运行brew install ruby​​ .......

NOTE: By default, gem installed binaries will be placed into:
   /usr/local/opt/ruby/bin

 You may want to add this to your PATH.
 Warning: Could not link ruby. Unlinking...
 Error: The `brew link` step did not complete successfully
 The formula built, but is not symlinked into /usr/local
 You can try again using `brew link ruby'
     ==> Summary
????  /usr/local/Cellar/ruby/2.0.0-p0: 877 files, 18M, built in 2.7 minutes

There are bash commands that I can not access. I have to source my bashprofile everytime to get some bash commands to work.....

有无法访问的bash命令。我必须每次都来源我的bashprofile以获得一些bash命令工作.....


I am new to rails and I am developing a rails app. The rails mvc concepts are easy to grasp, but I didn't pay much attention to. -paths -environments -rbenv -rvm -brew -bash commands

我是rails的新手,我正在开发一个rails应用程序。 rails mvc概念很容易掌握,但我并没有太在意。 -paths -environments -rbenv -rvm -brew -bash命令

etc

等等

This is the type of thing where you start making the app after installing everything and don't quite know how ruby/rails work under the hood when something breaks.

这是你在安装所有东西之后开始制作应用程序的类型,并且在发生故障时不太清楚ruby / rails如何在引擎盖下工作。

If someone can point me to the right direction. I will love your help. I will try to research this further myself.

如果有人可以指出我正确的方向。我会爱你的帮助。我将尝试进一步研究这个问题。

Thanks! If you need more info please let me know and thanks!

谢谢!如果您需要更多信息,请告诉我并谢谢!


HI HERE IS MY UPDATE

我在这里是我的更新

Thanks! so I installed xcode, I went through this tutorial https://coderwall.com/p/auvm9g and installed everything successfully but my computer can't find the ruby/rails that I installed. It came on when the installation finished but I lost it after I exit the terminal.

谢谢!所以我安装了xcode,我浏览了这个教程https://coderwall.com/p/auvm9g并成功安装了所有内容但是我的电脑找不到我安装的ruby / rails。它在安装完成后出现但我在退出终端后丢失了它。


I did brew doctor

我做过酿造医生

Warning: Setting DYLD_* vars can break dynamic linking.
Set variables:
DYLD_LIBRARY_PATH

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:

/Library/Frameworks/Python.framework/Versions/2.7/bin/python-config
/Library/Frameworks/Python.framework/Versions/2.7/bin/python2-config
/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config

Here is my .bashrc

PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin


export PATH="/usr/local:$PATH"ls
export PATH=/usr/local/mysql/bin:$PATH
export DYLD_LIBRARY_PATH=/usr/local/mysql/lib:$DYLD_LIBRARY_PATH

### Added by the Heroku Toolbelt
export PATH="/usr/local/heroku/bin:$PATH"

Here is my .bash_profile

这是我的.bash_profile

# Setting PATH for Python 2.7
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export PATH

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into    shell session *as a function*
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"

PATH="/usr/local/bin:/usr/local/heroku/bin:/usr/local/mysql/bin:/usr/local/bin:$PATH"

ruby -v

红宝石-v

rbenv: ruby: command not found

The `ruby' command exists in these Ruby versions:
  1.9.3-p286

rails -v

rails -v

rbenv: rails: command not found

The `rails' command exists in these Ruby versions:
  1.9.3-p286

\curl -L https://get.rvm.io | bash -s stable --ruby

\ curl -L https://get.rvm.io | bash -s stable --ruby

Upgrading the RVM installation in /Users/judyngai/.rvm/
RVM PATH line found in /Users/judyngai/.zshrc.
RVM sourcing line found in /Users/judyngai/.bash_profile /Users/judyngai/.zlogin.
Installing rvm gem in 1 gemsets ERROR:  Loading command: install (LoadError)
cannot load such file -- openssl
ERROR:  While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass


Upgrade Notes:



 * WARNING: Above files contains `PATH=` with no `$PATH` inside, this can break RVM,
 for details check https://github.com/wayneeseguin/rvm/issues/1351#issuecomment-10939525
 to avoid this warning append #PATH.

 * No new notes to display.

my .rvm and .benv are in my Users/judyngai/.rvm

我的.rvm和.benv在我的用户/ judyngai / .rvm中

I am pretty sure I have a paths problem, if someone can enlighten me I will be really happy and grateful!

我很确定我有路径问题,如果有人可以开导我,我会非常高兴和感激!

1 个解决方案

#1


0  

You have a few things going on.

你有一些事情在继续。

First off, I haven't used railsinstaller, but it looks like a bad deal. Many of these "one-click-install" applications end up leaving you in a mess like you have here. I recommend removing everything rails installer has done and following something like this guide to get you going: https://coderwall.com/p/auvm9g. That does each part separately.

首先,我没有使用railsinstaller,但它看起来很糟糕。许多这些“一键安装”的应用程序最终会让您陷入困境,就像您在这里一样。我建议删除rails安装程序已完成的所有内容,并按照本指南的说明开始使用:https://coderwall.com/p/auvm9g。这分别是每个部分。

But, if you want to try and fix what you got...

但是,如果你想尝试修复你得到的东西......

First, looks you have some issues with homebrew according to brew doctor. Largest of which is you need to install Xcode Command Line Tools.

首先,根据brew医生的说法,看起来你有一些自制问题。其中最大的是你需要安装Xcode命令行工具。

That should also take care the autoconf and libtool warnings.

这也应该注意autoconf和libtool警告。

Looks like you also need change permissions on you /uar/local directory since that's where homebrew puts everything.

看起来你还需要对你/ uar /本地目录的更改权限,因为这是自制程序放置所有内容的地方。

Second, installing Ruby through brew is a bad idea. I recommend either rbenv or rvm.

其次,通过brew安装Ruby是个坏主意。我建议使用rbenv或rvm。

#1


0  

You have a few things going on.

你有一些事情在继续。

First off, I haven't used railsinstaller, but it looks like a bad deal. Many of these "one-click-install" applications end up leaving you in a mess like you have here. I recommend removing everything rails installer has done and following something like this guide to get you going: https://coderwall.com/p/auvm9g. That does each part separately.

首先,我没有使用railsinstaller,但它看起来很糟糕。许多这些“一键安装”的应用程序最终会让您陷入困境,就像您在这里一样。我建议删除rails安装程序已完成的所有内容,并按照本指南的说明开始使用:https://coderwall.com/p/auvm9g。这分别是每个部分。

But, if you want to try and fix what you got...

但是,如果你想尝试修复你得到的东西......

First, looks you have some issues with homebrew according to brew doctor. Largest of which is you need to install Xcode Command Line Tools.

首先,根据brew医生的说法,看起来你有一些自制问题。其中最大的是你需要安装Xcode命令行工具。

That should also take care the autoconf and libtool warnings.

这也应该注意autoconf和libtool警告。

Looks like you also need change permissions on you /uar/local directory since that's where homebrew puts everything.

看起来你还需要对你/ uar /本地目录的更改权限,因为这是自制程序放置所有内容的地方。

Second, installing Ruby through brew is a bad idea. I recommend either rbenv or rvm.

其次,通过brew安装Ruby是个坏主意。我建议使用rbenv或rvm。