簡體   English   中英

使用rails generators的運行命令時,“ RVM不是功能”

[英]“RVM is not a function” when using rails generators' run command

我正在編寫一個rails generators gem,以模板化我的Rails應用程序設置。 但是,當執行以下代碼行時:

run  "rvm gemset create #{application_name} && rvm gemset use #{application_name}"

出現“ RVM不是功能”錯誤。 但是,似乎create命令確實起作用了:

ruby-2.1.0 - #gemset created /home/edward/.rvm/gems/ruby-2.1.0@blog
ruby-2.1.0 - #generating blog wrappers.

RVM is not a function, selecting rubies with 'rvm use ...' will not work.

You need to change your terminal emulator preferences to allow login shell.
Sometimes it is required to use `/bin/bash --login` as the command.
Please visit https://rvm.io/integration/gnome-terminal/ for a example.

順便說一句,很久以前我已經啟用了登錄外殼

我的終端配置文件首選項

由於Rails沒有提供完整的登錄外殼,因此可以通過以下兩種方法之一解決此問題:

1.使用RVM Ruby API

這可能是一個很好的解決方案,但可能很困難。 RVM Ruby API在這里: https : //github.com/wayneeseguin/rvm-gem

2.用RVM的腳本界面包裝命令。

通過像這樣通過RVM運行命令:

run "rvm #{current_ruby} do rvm gemset create #{app_name} --ruby-version"
run "rvm #{current_ruby}@#{app_name} do gem install bundler"
run "rvm #{current_ruby}@#{app_name} do bundle install"

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM